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 |
|---|---|---|---|---|---|---|---|
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F, Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M, Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98920 | 7 | 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_98920:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98920:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y-m-d'
SHORT_DATETIME_FORMAT = 'Y-m-d H:i'
FIRST_DAY_OF_WEEK = 1
DATE_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y', # '10/25/06'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98921 | 14 | 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_98921:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0286, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1714, 0.0286, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0286, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2286, 0.0286, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0286, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y-m-d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'Y-m-d H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3429, 0.0286, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.1429, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y', # '10/25/06'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5571, 0.1143, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 32], "level": 0, "parent": null, "vector": [14, 0, 0.7714, 0.3143, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'\n '%m/%d/%Y %H:%M', # '10/25/2006 14:30'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L33_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9429, 0.0286, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L34_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9714, 0.0286, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98921:Assign_L35_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0286, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# DATE_FORMAT =
# TIME_FORMAT =
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DAY_FORMAT =
# SHORT_DATE_FORMAT =
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
# DECIMAL_SEPARATOR =
# THOUSAND_SEPARATOR =
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98922 | 0 | 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"] | [] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'\N\gà\y d \t\há\n\g n \nă\m Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'H:i:s \N\gà\y d \t\há\n\g n \nă\m Y'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd-m-Y'
SHORT_DATETIME_FORMAT = 'H:i:s d-m-Y'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98923 | 9 | 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_98923:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'\\N\\g\u00e0\\y d \\t\\h\u00e1\\n\\g n \\n\u0103\\m Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'H:i:s \\N\\g\u00e0\\y d \\t\\h\u00e1\\n\\g n \\n\u0103\\m Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd-m-Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'H:i:s d-m-Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98923:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'F j'
SHORT_DATE_FORMAT = 'm/d/Y'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
FIRST_DAY_OF_WEEK = 0 # Sunday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98924 | 14 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1316, 0.0263, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'N j, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1579, 0.0263, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1842, 0.0263, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'N j, Y, P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2105, 0.0263, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2368, 0.0263, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'F j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2632, 0.0263, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'm/d/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2895, 0.0263, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'm/d/Y P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3158, 0.0263, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # Sunday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 19], "level": 0, "parent": null, "vector": [14, 0, 0.4211, 0.1842, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'\n # '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'\n # '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n # '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L20_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.5658, 0.1053, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L24_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [24, 34], "level": 0, "parent": null, "vector": [14, 0, 0.7632, 0.2895, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'\n '%m/%d/%Y %H:%M', # '10/25/2006 14:30'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L35_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9211, 0.0263, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L36_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.9474, 0.0263, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98924:Assign_L37_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.9737, 0.0263, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98925 | 14 | 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_98925:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0312, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2188, 0.0312, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2812, 0.0312, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3438, 0.0312, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0312, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4688, 0.1562, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'\n '%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'\n # '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6094, 0.125, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 29], "level": 0, "parent": null, "vector": [14, 0, 0.7969, 0.25, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L30_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.0312, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L31_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.9688, 0.0312, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98925:Assign_L32_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0312, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j ខែ F ឆ្នាំ Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j ខែ F ឆ្នាំ Y, G:i:s'
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
SHORT_DATETIME_FORMAT = 'j M Y, G:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98926 | 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_98926:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j \u1781\u17c2 F \u1786\u17d2\u1793\u17b6\u17c6 Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1429, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.2857, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j \u1781\u17c2 F \u1786\u17d2\u1793\u17b6\u17c6 Y, G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.4286, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.5714, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.7143, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j M Y, G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8571, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98926:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y à\s H:i'
YEAR_MONTH_FORMAT = r'F \de Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 0 # Sunday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
# '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
# '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98927 | 14 | 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_98927:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0286, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'j \\de F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1714, 0.0286, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0286, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'j \\de F \\de Y \u00e0\\s H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2286, 0.0286, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0286, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = r'j \\de F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3429, 0.0286, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # Sunday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.1429, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'\n # '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'\n # '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5571, 0.1143, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 32], "level": 0, "parent": null, "vector": [14, 0, 0.7714, 0.3143, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'\n '%d/%m/%Y %H:%M', # '25/10/2006 14:30'\n '%d/%m/%Y', # '25/10/2006'\n '%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L33_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9429, 0.0286, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L34_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9714, 0.0286, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98927:Assign_L35_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0286, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.m.Y.'
SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'
FIRST_DAY_OF_WEEK = 1
DATE_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'
'%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'
'%d.%m.%Y.', # '25.10.2006.'
'%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'
'%d.%m.%y. %H:%M', # '25.10.06. 14:30'
'%d.%m.%y.', # '25.10.06.'
'%d. %m. %Y. %H:%M:%S', # '25. 10. 2006. 14:30:59'
'%d. %m. %Y. %H:%M', # '25. 10. 2006. 14:30'
'%d. %m. %Y.', # '25. 10. 2006.'
'%d. %m. %y. %H:%M:%S', # '25. 10. 06. 14:30:59'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98928 | 14 | 42 | 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_98928:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.119, 0.0238, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0238, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0238, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1905, 0.0238, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2143, 0.0238, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2381, 0.0238, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.m.Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2619, 0.0238, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0238, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.3571, 0.119, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', # '2006-10-25'\n '%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'\n '%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.4643, 0.0952, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 38], "level": 0, "parent": null, "vector": [14, 0, 0.7143, 0.4048, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'\n '%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'\n '%d.%m.%Y.', # '25.10.2006.'\n '%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L40_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.9524, 0.0238, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L41_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.9762, 0.0238, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98928:Assign_L42_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0238, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F، Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd/m/Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98929 | 7 | 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_98929:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F\u060c Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd\u200f/m\u200f/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98929:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j F Y, G:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
SHORT_DATETIME_FORMAT = 'j M Y, G:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98930 | 9 | 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_98930:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y, G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j M Y, G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98930:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1
DATE_INPUT_FORMATS = (
'%d.%m.%Y', # '25.10.2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98931 | 14 | 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_98931:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1923, 0.0385, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2308, 0.0385, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2692, 0.0385, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.3077, 0.0385, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3462, 0.0385, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3846, 0.0385, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.4231, 0.0385, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4615, 0.0385, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 15], "level": 0, "parent": null, "vector": [14, 0, 0.5385, 0.1154, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y', # '25.10.2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L16_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [16, 19], "level": 0, "parent": null, "vector": [14, 0, 0.6731, 0.1538, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L20_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.8269, 0.1538, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L24_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.9231, 0.0385, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L25_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.9615, 0.0385, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98931:Assign_L26_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0385, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'Y. \g\a\d\a j. F'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'Y. \g\a\d\a j. F, H:i:s'
YEAR_MONTH_FORMAT = r'Y. \g. F'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = r'j.m.Y'
SHORT_DATETIME_FORMAT = 'j.m.Y H:i:s'
FIRST_DAY_OF_WEEK = 1 #Monday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
'%H.%M.%S', # '14.30.59'
'%H.%M', # '14.30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y %H.%M.%S', # '25.10.06 14.30.59'
'%d.%m.%y %H.%M', # '25.10.06 14.30'
'%d.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98932 | 14 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1389, 0.0278, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'Y. \\g\\a\\d\\a j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0278, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1944, 0.0278, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'Y. \\g\\a\\d\\a j. F, H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2222, 0.0278, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'Y. \\g. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0278, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0278, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = r'j.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3056, 0.0278, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j.m.Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0278, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 #Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0833, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%d.%m.%Y', '%d.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L16_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [16, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5139, 0.1667, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n '%H.%M.%S', # '14.30.59'\n '%H.%M', # '14.30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 33], "level": 0, "parent": null, "vector": [14, 0, 0.7639, 0.3333, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'\n '%d.%m.%y %H:%M', # '25.10.06 14:30'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L34_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0278, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L35_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9722, 0.0278, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '\u00a0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98932:Assign_L36_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0278, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'N j, Y' # 'Oct. 25, 2006'
TIME_FORMAT = 'P' # '2:30 pm'
DATETIME_FORMAT = 'N j, Y, P' # 'Oct. 25, 2006, 2:30 pm'
YEAR_MONTH_FORMAT = 'F Y' # 'October 2006'
MONTH_DAY_FORMAT = 'F j' # 'October 25'
SHORT_DATE_FORMAT = 'd/m/Y' # '25/10/2006'
SHORT_DATETIME_FORMAT = 'd/m/Y P' # '25/10/2006 2:30 pm'
FIRST_DAY_OF_WEEK = 0 # Sunday
DATE_INPUT_FORMATS = (
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%Y-%m-%d', # '2006-10-25'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98933 | 14 | 39 | 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_98933:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1282, 0.0256, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'N j, Y' # 'Oct. 25, 2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1538, 0.0256, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'P' # '2:30 pm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1795, 0.0256, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'N j, Y, P' # 'Oct. 25, 2006, 2:30 pm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2051, 0.0256, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y' # 'October 2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2308, 0.0256, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'F j' # 'October 25'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2564, 0.0256, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y' # '25/10/2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2821, 0.0256, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y P' # '25/10/2006 2:30 pm'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3077, 0.0256, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # Sunday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 20], "level": 0, "parent": null, "vector": [14, 0, 0.4231, 0.2051, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'\n '%Y-%m-%d', # '2006-10-25'\n # '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'\n # '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n # '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L21_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 24], "level": 0, "parent": null, "vector": [14, 0, 0.5769, 0.1026, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L25_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [25, 35], "level": 0, "parent": null, "vector": [14, 0, 0.7692, 0.2821, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'\n '%d/%m/%Y %H:%M', # '25/10/2006 14:30'\n '%d/%m/%Y', # '25/10/2006'\n '%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L36_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.9231, 0.0256, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L37_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.9487, 0.0256, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98933:Assign_L38_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.9744, 0.0256, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'Y \m. F j \d.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DAY_FORMAT =
SHORT_DATE_FORMAT = 'Y.m.d'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98934 | 5 | 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_98934:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'Y \\m. F j \\d.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98934:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.25, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98934:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.5, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y.m.d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98934:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.75, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98934:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98935 | 7 | 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_98935:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98935:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j. F Y G:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y G:i:s'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98936 | 14 | 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_98936:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0312, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2188, 0.0312, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2812, 0.0312, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3438, 0.0312, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0312, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4688, 0.1562, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'\n '%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'\n # '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6094, 0.125, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 29], "level": 0, "parent": null, "vector": [14, 0, 0.7969, 0.25, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L30_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.0312, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L31_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.9688, 0.0312, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98936:Assign_L32_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0312, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y г.'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j F Y г. G:i:s'
YEAR_MONTH_FORMAT = 'F Y г.'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%d.%m.%Y', # '25.10.2006'
'%d.%m.%y', # '25.10.06'
'%Y-%m-%d', # '2006-10-25'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y', # '25.10.06'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98937 | 14 | 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_98937:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0286, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y \u0433.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1714, 0.0286, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0286, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y \u0433. G:i:s' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2286, 0.0286, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y \u0433.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0286, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i' "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3429, 0.0286, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.1429, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y', # '25.10.2006'\n '%d.%m.%y', # '25.10.06'\n '%Y-%m-%d', # '2006-10-25'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5571, 0.1143, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 32], "level": 0, "parent": null, "vector": [14, 0, 0.7714, 0.3143, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'\n '%d.%m.%y %H:%M', # '25.10.06 14:30'\n '%d.%m.%y', # '25.10.06'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L33_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9429, 0.0286, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L34_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9714, 0.0286, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98937:Assign_L35_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0286, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'F j'
SHORT_DATE_FORMAT = 'm/d/Y'
SHORT_DATETIME_FORMAT = 'm/d/Y P'
FIRST_DAY_OF_WEEK = 0 # Sunday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98938 | 14 | 38 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1316, 0.0263, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'N j, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1579, 0.0263, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1842, 0.0263, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'N j, Y, P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2105, 0.0263, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2368, 0.0263, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'F j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2632, 0.0263, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'm/d/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2895, 0.0263, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'm/d/Y P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3158, 0.0263, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # Sunday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 19], "level": 0, "parent": null, "vector": [14, 0, 0.4211, 0.1842, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'\n # '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'\n # '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n # '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L20_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.5658, 0.1053, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L24_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [24, 34], "level": 0, "parent": null, "vector": [14, 0, 0.7632, 0.2895, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'\n '%m/%d/%Y %H:%M', # '10/25/2006 14:30'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L35_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9211, 0.0263, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L36_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.9474, 0.0263, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98938:Assign_L37_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [37, 37], "level": 0, "parent": null, "vector": [14, 0, 0.9737, 0.0263, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.m.Y.'
SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'
FIRST_DAY_OF_WEEK = 1
DATE_INPUT_FORMATS = (
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
'%Y-%m-%d', # '2006-10-25'
# '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
# '%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
# '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'
'%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'
'%d.%m.%Y.', # '25.10.2006.'
'%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'
'%d.%m.%y. %H:%M', # '25.10.06. 14:30'
'%d.%m.%y.', # '25.10.06.'
'%d. %m. %Y. %H:%M:%S', # '25. 10. 2006. 14:30:59'
'%d. %m. %Y. %H:%M', # '25. 10. 2006. 14:30'
'%d. %m. %Y.', # '25. 10. 2006.'
'%d. %m. %y. %H:%M:%S', # '25. 10. 06. 14:30:59'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98939 | 14 | 44 | 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_98939:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0227, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1364, 0.0227, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1591, 0.0227, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0227, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2045, 0.0227, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2273, 0.0227, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.m.Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0227, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2727, 0.0227, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 20], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.1818, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'\n '%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'\n '%Y-%m-%d', # '2006-10-25'\n # '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'\n # '%d. %b \\'%y.', '%d. %B \\'%y.', # '25. Oct '06.', '25. October '06.'\n # '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L21_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 24], "level": 0, "parent": null, "vector": [14, 0, 0.5114, 0.0909, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L25_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [25, 41], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.3864, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'\n '%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'\n '%d.%m.%Y.', # '25.10.2006.'\n '%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'\n '%d.%m.%y. %H:%M', # '25.10.06. 14:30'\n '%d.%m.%y.', # '25.10.06.'\n '%d. %m. %Y. %H:%M:%S', # '25. 10. 2006. 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L42_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.9545, 0.0227, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L43_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.9773, 0.0227, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98939:Assign_L44_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0227, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y \a \l\a\s H:i'
YEAR_MONTH_FORMAT = r'F \de Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
# '31/12/2009', '31/12/09'
'%d/%m/%Y', '%d/%m/%y'
)
TIME_INPUT_FORMATS = (
# '14:30:59', '14:30'
'%H:%M:%S', '%H:%M'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M',
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98940 | 14 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0333, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'j \\de F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0333, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2333, 0.0333, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'j \\de F \\de Y \\a \\l\\a\\s H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0333, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.0333, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = r'j \\de F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0333, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3667, 0.0333, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0333, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 16], "level": 0, "parent": null, "vector": [14, 0, 0.4833, 0.1333, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n # '31/12/2009', '31/12/09'\n '%d/%m/%Y', '%d/%m/%y'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L17_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [17, 20], "level": 0, "parent": null, "vector": [14, 0, 0.6167, 0.1333, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n # '14:30:59', '14:30'\n '%H:%M:%S', '%H:%M'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L21_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 26], "level": 0, "parent": null, "vector": [14, 0, 0.7833, 0.2, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S',\n '%d/%m/%Y %H:%M',\n '%d/%m/%y %H:%M:%S',\n '%d/%m/%y %H:%M',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L27_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.9, 0.0333, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L28_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.9333, 0.0333, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98940:Assign_L29_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.9667, 0.0333, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98941 | 6 | 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_98941:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98941:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.2, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98941:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.4, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98941:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98941:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98941:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
'%Y-%m-%j', # '2006-10-25',
# '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'
# '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'
# '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%Y-%m-%j', # '2006-10-25'
'%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%j.%m.%Y %H:%M', # '25.10.2006 14:30'
'%j.%m.%Y', # '25.10.2006'
'%j.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%j.%m.%y %H:%M', # '25.10.06 14:30'
'%j.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98942 | 14 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L1_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L2_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0588, 0.0294, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L3_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0882, 0.0294, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L4_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1176, 0.0294, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L5_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1471, 0.0294, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L6_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1765, 0.0294, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L7_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2059, 0.0294, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L8_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0294, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L9_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [9, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3529, 0.2059, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'\n '%Y-%m-%j', # '2006-10-25',\n # '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'\n # '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'\n # '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L16_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [16, 19], "level": 0, "parent": null, "vector": [14, 0, 0.5147, 0.1176, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L20_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 31], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.3529, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%Y-%m-%j', # '2006-10-25'\n '%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%j.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%j.%m.%Y', # '25.10.2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L32_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.9412, 0.0294, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L33_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9706, 0.0294, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98942:Assign_L34_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0294, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEAR_MONTH_FORMAT = 'F, Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j.M.Y'
SHORT_DATETIME_FORMAT = 'j.M.Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # (Monday)
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%d %b %Y', '%d %b, %Y', '%d %b. %Y', # '25 Oct 2006', '25 Oct, 2006', '25 Oct. 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
# '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%d.%m.%y %H:%M', # '25.10.06 14:30'
'%d.%m.%y', # '25.10.06'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = " "
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98943 | 14 | 42 | 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_98943:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.119, 0.0238, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'l, j F, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0238, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'h:i:s a'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0238, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F, Y h:i:s a'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1905, 0.0238, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2143, 0.0238, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2381, 0.0238, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.M.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2619, 0.0238, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j.M.Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0238, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # (Monday)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 18], "level": 0, "parent": null, "vector": [14, 0, 0.369, 0.1429, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'\n # '%d %b %Y', '%d %b, %Y', '%d %b. %Y', # '25 Oct 2006', '25 Oct, 2006', '25 Oct. 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n # '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L19_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [19, 22], "level": 0, "parent": null, "vector": [14, 0, 0.4881, 0.0952, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L23_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [23, 39], "level": 0, "parent": null, "vector": [14, 0, 0.7381, 0.4048, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%d.%m.%y %H:%M:%S', # '25.10.06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L40_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.9524, 0.0238, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L41_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.9762, 0.0238, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = \" \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98943:Assign_L42_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0238, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j N Y'
SHORT_DATETIME_FORMAT = 'j N Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
# '%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
'%d.%m.%Y %H:%M:%S', # Swiss (fr_CH), '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # Swiss (fr_CH), '25.10.2006 14:30'
'%d.%m.%Y', # Swiss (fr_CH), '25.10.2006'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98944 | 14 | 36 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1389, 0.0278, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0278, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1944, 0.0278, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2222, 0.0278, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0278, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0278, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j N Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3056, 0.0278, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j N Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0278, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 18], "level": 0, "parent": null, "vector": [14, 0, 0.4306, 0.1667, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'\n '%d.%m.%Y', '%d.%m.%y', # Swiss (fr_CH), '25.10.2006', '25.10.06'\n '%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'\n # '%d %B %Y', '%d %b %Y', # '25 octobre 2006', '25 oct. 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L19_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [19, 22], "level": 0, "parent": null, "vector": [14, 0, 0.5694, 0.1111, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L23_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [23, 33], "level": 0, "parent": null, "vector": [14, 0, 0.7778, 0.3056, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'\n '%d/%m/%Y %H:%M', # '25/10/2006 14:30'\n '%d/%m/%Y', # '25/10/2006'\n '%d.%m.%Y %H:%M:%S', # Swiss (fr_CH), '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # Swiss (fr_CH), '25.10.2006 14:30'\n '%d.%m.%Y', # Swiss (fr_CH), '25.10.2006'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L34_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0278, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L35_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9722, 0.0278, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98944:Assign_L36_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0278, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j N Y'
TIME_FORMAT = r'H:i:s'
DATETIME_FORMAT = r'j N Y H:i:s'
YEAR_MONTH_FORMAT = r'F Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = r'd/m/Y'
SHORT_DATETIME_FORMAT = r'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday
DATE_INPUT_FORMATS = (
'%d/%m/%Y', # '31/12/2009'
'%d/%m/%y', # '31/12/09'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M',
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98945 | 14 | 29 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1724, 0.0345, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'j N Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2069, 0.0345, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = r'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2414, 0.0345, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'j N Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2759, 0.0345, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3103, 0.0345, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = r'j \\de F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3448, 0.0345, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = r'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3793, 0.0345, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = r'd/m/Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4138, 0.0345, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # 0: Sunday, 1: Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 16], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.1379, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d/%m/%Y', # '31/12/2009'\n '%d/%m/%y', # '31/12/09'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L17_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [17, 20], "level": 0, "parent": null, "vector": [14, 0, 0.6379, 0.1379, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L21_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 26], "level": 0, "parent": null, "vector": [14, 0, 0.8103, 0.2069, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S',\n '%d/%m/%Y %H:%M',\n '%d/%m/%y %H:%M:%S',\n '%d/%m/%y %H:%M',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L27_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.931, 0.0345, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L28_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.9655, 0.0345, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98945:Assign_L29_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0345, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.m.Y.'
SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'
FIRST_DAY_OF_WEEK = 1
DATE_INPUT_FORMATS = (
'%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'
'%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'
'%Y-%m-%d', # '2006-10-25'
# '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'
# '%d. %b \'%y.', '%d. %B \'%y.', # '25. Oct '06.', '25. October '06.'
# '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'
'%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'
'%d.%m.%Y.', # '25.10.2006.'
'%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'
'%d.%m.%y. %H:%M', # '25.10.06. 14:30'
'%d.%m.%y.', # '25.10.06.'
'%d. %m. %Y. %H:%M:%S', # '25. 10. 2006. 14:30:59'
'%d. %m. %Y. %H:%M', # '25. 10. 2006. 14:30'
'%d. %m. %Y.', # '25. 10. 2006.'
'%d. %m. %y. %H:%M:%S', # '25. 10. 06. 14:30:59'
'%d. %m. %y. %H:%M', # '25. 10. 06. 14:30'
'%d. %m. %y.', # '25. 10. 06.'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98946 | 14 | 44 | 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_98946:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0227, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1364, 0.0227, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1591, 0.0227, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0227, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2045, 0.0227, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2273, 0.0227, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.m.Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0227, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'j.m.Y. H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2727, 0.0227, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 20], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.1818, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y.', '%d.%m.%y.', # '25.10.2006.', '25.10.06.'\n '%d. %m. %Y.', '%d. %m. %y.', # '25. 10. 2006.', '25. 10. 06.'\n '%Y-%m-%d', # '2006-10-25'\n # '%d. %b %y.', '%d. %B %y.', # '25. Oct 06.', '25. October 06.'\n # '%d. %b \\'%y.', '%d. %B \\'%y.', # '25. Oct '06.', '25. October '06.'\n # '%d. %b %Y.', '%d. %B %Y.', # '25. Oct 2006.', '25. October 2006.'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L21_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 24], "level": 0, "parent": null, "vector": [14, 0, 0.5114, 0.0909, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L25_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [25, 41], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.3864, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y. %H:%M:%S', # '25.10.2006. 14:30:59'\n '%d.%m.%Y. %H:%M', # '25.10.2006. 14:30'\n '%d.%m.%Y.', # '25.10.2006.'\n '%d.%m.%y. %H:%M:%S', # '25.10.06. 14:30:59'\n '%d.%m.%y. %H:%M', # '25.10.06. 14:30'\n '%d.%m.%y.', # '25.10.06.'\n '%d. %m. %Y. %H:%M:%S', # '25. 10. 2006. 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L42_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.9545, 0.0227, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L43_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.9773, 0.0227, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98946:Assign_L44_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0227, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F, Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M, Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
# DECIMAL_SEPARATOR =
# THOUSAND_SEPARATOR =
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98947 | 4 | 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_98947:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98947:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.3333, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98947:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.6667, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98947:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 1.0, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M, Y'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
# DECIMAL_SEPARATOR =
# THOUSAND_SEPARATOR =
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98948 | 4 | 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_98948:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98948:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.3333, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98948:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.6667, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98948:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 1.0, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \de N \de Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \de N \de Y à\s H:i'
YEAR_MONTH_FORMAT = r'F \de Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_WEEK = 0 # Sunday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
# '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'
# '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
'%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'
'%d/%m/%y %H:%M', # '25/10/06 14:30'
'%d/%m/%y', # '25/10/06'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98949 | 14 | 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_98949:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0286, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'j \\de N \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1714, 0.0286, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0286, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'j \\de N \\de Y \u00e0\\s H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2286, 0.0286, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2571, 0.0286, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = r'j \\de F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0286, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3143, 0.0286, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3429, 0.0286, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0 # Sunday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.1429, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'\n # '%d de %b de %Y', '%d de %b, %Y', # '25 de Out de 2006', '25 Out, 2006'\n # '%d de %B de %Y', '%d de %B, %Y', # '25 de Outubro de 2006', '25 de Outubro, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5571, 0.1143, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 32], "level": 0, "parent": null, "vector": [14, 0, 0.7714, 0.3143, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'\n '%d/%m/%Y %H:%M', # '25/10/2006 14:30'\n '%d/%m/%Y', # '25/10/2006'\n '%d/%m/%y %H:%M:%S', # '25/10/06 14:30:59'\n '%d/%m/%y %H:%M', # '25/10/06 14:30'\n '%d/%m/%y', # '25/10/06'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L33_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9429, 0.0286, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L34_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.9714, 0.0286, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98949:Assign_L35_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0286, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd-m-Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98950 | 6 | 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_98950:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98950:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.2, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98950:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.4, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98950:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd-m-Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98950:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98950:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y р.'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98951 | 7 | 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_98951:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y \u0440.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98951:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '\u00a0'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G.i.s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.n.Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98952 | 7 | 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_98952:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G.i.s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.n.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98952:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '\u00a0'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'Y年n月j日'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'Y年n月j日G:i:s'
YEAR_MONTH_FORMAT = 'Y年n月'
MONTH_DAY_FORMAT = 'n月j日'
SHORT_DATE_FORMAT = 'Y/m/d'
SHORT_DATETIME_FORMAT = 'Y/m/d G:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98953 | 9 | 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_98953:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'Y\u5e74n\u6708j\u65e5'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'Y\u5e74n\u6708j\u65e5G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'Y\u5e74n\u6708'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'n\u6708j\u65e5'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y/m/d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'Y/m/d G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98953:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j F Y، ساعت G:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y/n/j'
SHORT_DATETIME_FORMAT = 'Y/n/j، G:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98954 | 9 | 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_98954:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y\u060c \u0633\u0627\u0639\u062a G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y/n/j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'Y/n/j\u060c\u200f G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98954:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'Yeko M\re\n d\a'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DAY_FORMAT =
SHORT_DATE_FORMAT = 'Y M j'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98955 | 5 | 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_98955:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'Yeko M\\re\\n d\\a'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98955:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.25, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98955:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.5, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y M j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98955:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.75, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98955:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j F Y, H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y, H:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98956 | 9 | 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_98956:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y, H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y, H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98956:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd-m-Y'
SHORT_DATETIME_FORMAT = 'd-m-Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
# '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%d.%m.%Y %H:%M', # '25.10.2006 14:30'
'%d.%m.%Y', # '25.10.2006'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98957 | 14 | 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_98957:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0312, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2188, 0.0312, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j F Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2812, 0.0312, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd-m-Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3438, 0.0312, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd-m-Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0312, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4688, 0.1562, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d.%m.%Y', '%d.%m.%y', # '25.10.2006', '25.10.06'\n '%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'\n # '%d. %B %Y', '%d. %b. %Y', # '25. October 2006', '25. Oct. 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6094, 0.125, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 29], "level": 0, "parent": null, "vector": [14, 0, 0.7969, 0.25, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%d.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%d.%m.%Y', # '25.10.2006'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L30_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.0312, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L31_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.9688, 0.0312, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98957:Assign_L32_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0312, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g.i.s.A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'Y-m-d'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98958 | 7 | 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_98958:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g.i.s.A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y-m-d'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98958:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, G:i:s"
TIME_FORMAT = 'G:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd-m-Y'
SHORT_DATETIME_FORMAT = 'd-m-Y G:i:s'
FIRST_DAY_OF_WEEK = 1 #Monday
DATE_INPUT_FORMATS = (
'%d-%m-%y', '%d/%m/%y', # '25-10-09' , 25/10/09'
'%d-%m-%Y', '%d/%m/%Y', # '25-10-2009' , 25/10/2009'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d-%m-%Y %H:%M:%S', # '25-10-2009 14:30:59'
'%d-%m-%Y %H:%M', # '25-10-2009 14:30'
'%d-%m-%Y', # '25-10-2009'
'%d-%m-%y %H:%M:%S', # '25-10-09' 14:30:59'
'%d-%m-%y %H:%M', # '25-10-09' 14:30'
'%d-%m-%y', # '25-10-09''
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
'%m/%d/%Y %H:%M:%S', # '25/10/2009 14:30:59'
'%m/%d/%Y %H:%M', # '25/10/2009 14:30'
'%m/%d/%Y', # '10/25/2009'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98959 | 14 | 43 | 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_98959:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1163, 0.0233, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j N Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L6_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1395, 0.0233, 0, 0.66, 0.0769, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = \"j N Y, G:i:s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L7_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1628, 0.0233, 0, 0.66, 0.1538, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.186, 0.0233, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2093, 0.0233, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2326, 0.0233, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd-m-Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.2558, 0.0233, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd-m-Y G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.2791, 0.0233, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 #Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L14_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [14, 19], "level": 0, "parent": null, "vector": [14, 0, 0.3837, 0.1395, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d-%m-%y', '%d/%m/%y', # '25-10-09' , 25/10/09'\n '%d-%m-%Y', '%d/%m/%Y', # '25-10-2009' , 25/10/2009'\n # '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L21_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 24], "level": 0, "parent": null, "vector": [14, 0, 0.5233, 0.093, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L26_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [26, 39], "level": 0, "parent": null, "vector": [14, 0, 0.7558, 0.3256, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d-%m-%Y %H:%M:%S', # '25-10-2009 14:30:59'\n '%d-%m-%Y %H:%M', # '25-10-2009 14:30'\n '%d-%m-%Y', # '25-10-2009'\n '%d-%m-%y %H:%M:%S', # '25-10-09' 14:30:59'\n '%d-%m-%y %H:%M', # '25-10-09' 14:30'\n '%d-%m-%y', # '25-10-09''\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L41_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.9535, 0.0233, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L42_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.9767, 0.0233, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98959:Assign_L43_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0233, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = r'j \de F \de Y \a \le\s G:i'
YEAR_MONTH_FORMAT = r'F \de\l Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y G:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
# '31/12/2009', '31/12/09'
'%d/%m/%Y', '%d/%m/%y'
)
TIME_INPUT_FORMATS = (
# '14:30:59', '14:30'
'%H:%M:%S', '%H:%M'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S',
'%d/%m/%Y %H:%M',
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M',
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98960 | 14 | 30 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0333, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = r'j \\de F \\de Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0333, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2333, 0.0333, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = r'j \\de F \\de Y \\a \\le\\s G:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2667, 0.0333, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = r'F \\de\\l Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3, 0.0333, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = r'j \\de F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0333, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3667, 0.0333, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y G:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.0333, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 16], "level": 0, "parent": null, "vector": [14, 0, 0.4833, 0.1333, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n # '31/12/2009', '31/12/09'\n '%d/%m/%Y', '%d/%m/%y'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L17_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [17, 20], "level": 0, "parent": null, "vector": [14, 0, 0.6167, 0.1333, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n # '14:30:59', '14:30'\n '%H:%M:%S', '%H:%M'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L21_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 26], "level": 0, "parent": null, "vector": [14, 0, 0.7833, 0.2, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S',\n '%d/%m/%Y %H:%M',\n '%d/%m/%y %H:%M:%S',\n '%d/%m/%y %H:%M',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L27_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.9, 0.0333, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L28_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.9333, 0.0333, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98960:Assign_L29_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.9667, 0.0333, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
'%Y-%m-%j', # '2006-10-25',
# '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'
# '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'
# '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%Y-%m-%j', # '2006-10-25'
'%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%j.%m.%Y %H:%M', # '25.10.2006 14:30'
'%j.%m.%Y', # '25.10.2006'
'%j.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%j.%m.%y %H:%M', # '25.10.06 14:30'
'%j.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98961 | 14 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L1_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L2_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0588, 0.0294, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L3_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0882, 0.0294, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L4_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1176, 0.0294, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L5_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1471, 0.0294, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L6_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1765, 0.0294, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L7_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2059, 0.0294, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L8_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0294, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L9_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [9, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3529, 0.2059, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'\n '%Y-%m-%j', # '2006-10-25',\n # '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'\n # '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'\n # '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L16_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [16, 19], "level": 0, "parent": null, "vector": [14, 0, 0.5147, 0.1176, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L20_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 31], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.3529, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%Y-%m-%j', # '2006-10-25'\n '%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%j.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%j.%m.%Y', # '25.10.2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L32_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.9412, 0.0294, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L33_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9706, 0.0294, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98961:Assign_L34_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0294, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DAY_FORMAT =
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
# DECIMAL_SEPARATOR =
# THOUSAND_SEPARATOR =
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98962 | 3 | 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_98962:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98962:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.5, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98962:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 1.0, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M, Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98963 | 7 | 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_98963:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98963:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'h:i:s A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'j M Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
# DECIMAL_SEPARATOR =
# THOUSAND_SEPARATOR =
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98964 | 4 | 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_98964:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98964:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.3333, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'h:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98964:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.6667, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98964:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 1.0, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j M Y'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j בF Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j בF Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j בF'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i:s'
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98965 | 9 | 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_98965:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j \u05d1F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.125, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.25, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j \u05d1F Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.375, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j \u05d1F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.625, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd/m/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6111, 0.0556, 0, 0.66, 0.75, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd/m/Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.875, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98965:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}] | [] |
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i'
FIRST_DAY_OF_WEEK = 1 # Monday
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'
'%Y-%m-%j', # '2006-10-25',
# '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'
# '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'
# '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%Y-%m-%j', # '2006-10-25'
'%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'
'%j.%m.%Y %H:%M', # '25.10.2006 14:30'
'%j.%m.%Y', # '25.10.2006'
'%j.%m.%y %H:%M:%S', # '25.10.06 14:30:59'
'%j.%m.%y %H:%M', # '25.10.06 14:30'
'%j.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = ' '
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98966 | 14 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L1_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0294, 0.0294, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L2_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0588, 0.0294, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L3_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0882, 0.0294, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. F Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L4_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.1176, 0.0294, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L5_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1471, 0.0294, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L6_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1765, 0.0294, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd.m.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L7_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2059, 0.0294, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd.m.Y H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L8_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0294, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Monday"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L9_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [9, 15], "level": 0, "parent": null, "vector": [14, 0, 0.3529, 0.2059, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%j.%m.%Y', '%j.%m.%y', # '2006-10-25', '25.10.2006', '25.10.06'\n '%Y-%m-%j', # '2006-10-25',\n # '%j. %b %Y', '%j %b %Y', # '25. okt 2006', '25 okt 2006'\n # '%j. %b. %Y', '%j %b. %Y', # '25. okt. 2006', '25 okt. 2006'\n # '%j. %B %Y', '%j %B %Y', # '25. oktober 2006', '25 oktober 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L16_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [16, 19], "level": 0, "parent": null, "vector": [14, 0, 0.5147, 0.1176, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L20_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [20, 31], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.3529, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%Y-%m-%j', # '2006-10-25'\n '%j.%m.%Y %H:%M:%S', # '25.10.2006 14:30:59'\n '%j.%m.%Y %H:%M', # '25.10.2006 14:30'\n '%j.%m.%Y', # '25.10.2006'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L32_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.9412, 0.0294, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L33_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [33, 33], "level": 0, "parent": null, "vector": [14, 0, 0.9706, 0.0294, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98966:Assign_L34_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0294, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'd F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'd F'
SHORT_DATE_FORMAT = 'd M Y'
SHORT_DATETIME_FORMAT = 'd M Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Pazartesi
DATE_INPUT_FORMATS = (
'%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'
'%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'
# '%d %B %Y', '%d %b. %Y', # '25 Ekim 2006', '25 Eki. 2006'
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
DATETIME_INPUT_FORMATS = (
'%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'
'%d/%m/%Y %H:%M', # '25/10/2006 14:30'
'%d/%m/%Y', # '25/10/2006'
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98967 | 14 | 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_98967:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0312, 0, 0.66, 0.0769, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2188, 0.0312, 0, 0.66, 0.1538, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'd F Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.2308, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2812, 0.0312, 0, 0.66, 0.3077, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'd F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.3846, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'd M Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.3438, 0.0312, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'd M Y H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L12_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0312, 0, 0.66, 0.5385, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 1 # Pazartesi"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 17], "level": 0, "parent": null, "vector": [14, 0, 0.4688, 0.1562, 0, 0.66, 0.6154, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%d/%m/%Y', '%d/%m/%y', # '25/10/2006', '25/10/06'\n '%Y-%m-%d', '%y-%m-%d', # '2006-10-25', '06-10-25'\n # '%d %B %Y', '%d %b. %Y', # '25 Ekim 2006', '25 Eki. 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L18_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [18, 21], "level": 0, "parent": null, "vector": [14, 0, 0.6094, 0.125, 0, 0.66, 0.6923, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L22_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [22, 29], "level": 0, "parent": null, "vector": [14, 0, 0.7969, 0.25, 0, 0.66, 0.7692, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%d/%m/%Y %H:%M:%S', # '25/10/2006 14:30:59'\n '%d/%m/%Y %H:%M', # '25/10/2006 14:30'\n '%d/%m/%Y', # '25/10/2006'\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L30_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.0312, 0, 0.66, 0.8462, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L31_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.9688, 0.0312, 0, 0.66, 0.9231, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98967:Assign_L32_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0312, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j.n.Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98968 | 7 | 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_98968:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1667, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.3333, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6667, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j.n.Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98968:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'd. F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'j. M. Y'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98969 | 6 | 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_98969:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'd. F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98969:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.2, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'H:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98969:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.4, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98969:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.6, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'j. M. Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98969:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98969:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i:s'
DATETIME_FORMAT = 'Y년 n월 j일 g:i:s A'
YEAR_MONTH_FORMAT = 'Y년 F월'
MONTH_DAY_FORMAT = 'F월 j일'
SHORT_DATE_FORMAT = 'Y-n-j.'
SHORT_DATETIME_FORMAT = 'Y-n-j H:i'
# FIRST_DAY_OF_WEEK =
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
# '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
# '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
# '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
# '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
'%Y년 %m월 %d일', # '2006년 10월 25일', with localized suffix.
)
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
'%H시 %M분 %S초', # '14시 30분 59초'
'%H시 %M분', # '14시 30분'
)
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
'%Y년 %m월 %d일 %H시 %M분 %S초', # '2006년 10월 25일 14시 30분 59초'
'%Y년 %m월 %d일 %H시 %M분', # '2006년 10월 25일 14시 30분'
)
DECIMAL_SEPARATOR = '.'
THOUSAND_SEPARATOR = ','
NUMBER_GROUPING = 3
| ajibawa-2023/Python-Code-Large/train/row_98970 | 13 | 44 | 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_98970:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1136, 0.0227, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'Y\ub144 n\uc6d4 j\uc77c'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1364, 0.0227, 0, 0.66, 0.0833, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'A g:i:s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1591, 0.0227, 0, 0.66, 0.1667, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'Y\ub144 n\uc6d4 j\uc77c g:i:s A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1818, 0.0227, 0, 0.66, 0.25, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'Y\ub144 F\uc6d4'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2045, 0.0227, 0, 0.66, 0.3333, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'F\uc6d4 j\uc77c'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.2273, 0.0227, 0, 0.66, 0.4167, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y-n-j.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L11_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0227, 0, 0.66, 0.5, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'Y-n-j H:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L13_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [13, 20], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.1818, 0, 0.66, 0.5833, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'\n # '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'\n # '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n # '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'\n # '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n '%Y\ub144 %m\uc6d4 %d\uc77c', # '2006\ub144 10\uc6d4 25\uc77c', with localized suffix.\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L21_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [21, 26], "level": 0, "parent": null, "vector": [14, 0, 0.5341, 0.1364, 0, 0.66, 0.6667, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n '%H\uc2dc %M\ubd84 %S\ucd08', # '14\uc2dc 30\ubd84 59\ucd08'\n '%H\uc2dc %M\ubd84', # '14\uc2dc 30\ubd84'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L27_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [27, 40], "level": 0, "parent": null, "vector": [14, 0, 0.7614, 0.3182, 0, 0.66, 0.75, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'\n '%m/%d/%Y %H:%M', # '10/25/2006 14:30'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L42_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.9545, 0.0227, 0, 0.66, 0.8333, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L43_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.9773, 0.0227, 0, 0.66, 0.9167, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98970:Assign_L44_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0227, 0, 0.66, 1.0, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 3"}] | [] |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = 'j. N Y.'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j. N. Y. G:i T'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'Y M j'
# SHORT_DATETIME_FORMAT =
# FIRST_DAY_OF_WEEK =
# DATE_INPUT_FORMATS =
# TIME_INPUT_FORMATS =
# DATETIME_INPUT_FORMATS =
DECIMAL_SEPARATOR = ','
THOUSAND_SEPARATOR = '.'
# NUMBER_GROUPING =
| ajibawa-2023/Python-Code-Large/train/row_98971 | 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_98971:Assign_L5_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.2778, 0.0556, 0, 0.66, 0.0, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'j. N Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L6_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.3333, 0.0556, 0, 0.66, 0.1429, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'G:i'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L7_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.3889, 0.0556, 0, 0.66, 0.2857, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'j. N. Y. G:i T'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L8_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.4444, 0.0556, 0, 0.66, 0.4286, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L9_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0556, 0, 0.66, 0.5714, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'j. F'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L10_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.5556, 0.0556, 0, 0.66, 0.7143, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'Y M j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L16_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.8889, 0.0556, 0, 0.66, 0.8571, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98971:Assign_L17_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.9444, 0.0556, 0, 0.66, 1.0, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = '.'"}] | [] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings)
| ajibawa-2023/Python-Code-Large/train/row_98972 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98972:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management", "arg_names": [], "import_names": ["execute_manager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.management import execute_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "label": "try", "type": "try", "loc": [3, 8], "level": 0, "parent": null, "vector": [7, 0, 0.5, 0.5455, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import settings # Assumed to be in the same directory.\nexcept ImportError:\n import sys\n sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run django-admin.py, passing it your settings module.\\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\\n\" % __file__)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:Import_L4_C4", "label": "settings import settings", "type": "import", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "vector": [1, 1, 0.3636, 0.0909, 1, 0.8, 0.0, 168, 0, 1, 0, 0, 168, 0, 0], "semantic": {"name": "settings", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": " import settings # Assumed to be in the same directory."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:Import_L6_C4", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "vector": [1, 1, 0.5455, 0.0909, 1, 0.8, 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_98972:Expr_L7_C4", "label": "write()", "type": "expression", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "vector": [8, 1, 0.6364, 0.0909, 1, 0.8, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run django-admin.py, passing it your settings module.\\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\\n\" % __file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:Expr_L8_C4", "label": "exit()", "type": "expression", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "vector": [8, 1, 0.7273, 0.0909, 1, 0.8, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:If_L10_C0", "label": "if", "type": "if", "loc": [10, 11], "level": 0, "parent": null, "vector": [4, 0, 0.9545, 0.1818, 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 execute_manager(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98972:Expr_L11_C4", "label": "execute_manager()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98972:If_L10_C0", "vector": [8, 1, 1.0, 0.0909, 1, 0.26, 0.0, 383, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute_manager", "arg_names": [], "import_names": [], "rhs_call_name": "execute_manager", "annotation": ""}, "snippet": " execute_manager(settings)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98972:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98972:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98972:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98972:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98972:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98972:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98972:Expr_L11_C4"}] |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings)
| ajibawa-2023/Python-Code-Large/train/row_98973 | 8 | 11 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98973:ImportFrom_L2_C0", "label": "from django.core.management import execute_manager", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0909, 0, 0.66, 0.0, 879, 0, 1, 0, 0, 879, 0, 0], "semantic": {"name": "django.core.management", "arg_names": [], "import_names": ["execute_manager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.management import execute_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "label": "try", "type": "try", "loc": [3, 8], "level": 0, "parent": null, "vector": [7, 0, 0.5, 0.5455, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import settings # Assumed to be in the same directory.\nexcept ImportError:\n import sys\n sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run django-admin.py, passing it your settings module.\\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\\n\" % __file__)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:Import_L4_C4", "label": "settings import settings", "type": "import", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "vector": [1, 1, 0.3636, 0.0909, 1, 0.18, 0.0, 168, 0, 1, 0, 0, 168, 0, 0], "semantic": {"name": "settings", "arg_names": [], "import_names": ["settings"], "rhs_call_name": "", "annotation": ""}, "snippet": " import settings # Assumed to be in the same directory."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:Import_L6_C4", "label": "sys import sys", "type": "import", "loc": [6, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "vector": [1, 1, 0.5455, 0.0909, 1, 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_98973:Expr_L7_C4", "label": "write()", "type": "expression", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "vector": [8, 1, 0.6364, 0.0909, 1, 0.18, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sys.stderr.write(\"Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\\nYou'll have to run django-admin.py, passing it your settings module.\\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\\n\" % __file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:Expr_L8_C4", "label": "exit()", "type": "expression", "loc": [8, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "vector": [8, 1, 0.7273, 0.0909, 1, 0.18, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:If_L10_C0", "label": "if", "type": "if", "loc": [10, 11], "level": 0, "parent": null, "vector": [4, 0, 0.9545, 0.1818, 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 execute_manager(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98973:Expr_L11_C4", "label": "execute_manager()", "type": "expression", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98973:If_L10_C0", "vector": [8, 1, 1.0, 0.0909, 1, 0.21, 0.0, 383, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "execute_manager", "arg_names": [], "import_names": [], "rhs_call_name": "execute_manager", "annotation": ""}, "snippet": " execute_manager(settings)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98973:Import_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98973:Import_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98973:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98973:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98973:Expr_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98973:If_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98973:Expr_L11_C4"}] |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# (r'^admin/', include(admin.site.urls)),
)
| ajibawa-2023/Python-Code-Large/train/row_98974 | 2 | 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_98974:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf.urls.defaults import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98974:Assign_L7_C0", "label": "urlpatterns = patterns()", "type": "assigned_variable", "loc": [7, 16], "level": 0, "parent": null, "vector": [14, 0, 0.7188, 0.625, 0, 0.66, 1.0, 990, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "urlpatterns", "arg_names": [], "import_names": [], "rhs_call_name": "patterns", "annotation": ""}, "snippet": "urlpatterns = patterns('',\n # Example:\n # (r'^{{ project_name }}/', include('{{ project_name }}.foo.urls')),\n\n # Uncomment the admin/doc line below to enable admin documentation:\n # (r'^admin/doc/', include('django.contrib.admindocs.urls')),\n\n # Uncomment the next line to enable the admin:"}] | [] |
# Django settings for {{ project_name }} project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/static/"
STATICFILES_ROOT = ''
# URL that handles the static files served from STATICFILES_ROOT.
# Example: "http://static.lawrence.com/", "http://example.com/static/"
STATICFILES_URL = '/static/'
# URL prefix for admin media -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
# A list of locations of additional static files
STATICFILES_DIRS = ()
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = ''
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = '{{ project_name }}.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request':{
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
| ajibawa-2023/Python-Code-Large/train/row_98975 | 24 | 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_98975:Assign_L3_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0216, 0.0072, 0, 0.66, 0.0, 309, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEBUG = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L4_C0", "label": "TEMPLATE_DEBUG =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0288, 0.0072, 0, 0.66, 0.0435, 7, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "TEMPLATE_DEBUG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_DEBUG = DEBUG"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L6_C0", "label": "ADMINS =", "type": "assigned_variable", "loc": [6, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0504, 0.0216, 0, 0.66, 0.087, 223, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ADMINS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADMINS = (\n # ('Your Name', 'your_email@example.com'),\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L10_C0", "label": "MANAGERS =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0719, 0.0072, 0, 0.66, 0.1304, 275, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "MANAGERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MANAGERS = ADMINS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L12_C0", "label": "DATABASES =", "type": "assigned_variable", "loc": [12, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1187, 0.0719, 0, 0.66, 0.1739, 12, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "DATABASES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.\n 'NAME': '', # Or path to database file if using sqlite3.\n 'USER': '', # Not used with sqlite3.\n 'PASSWORD': '', # Not used with sqlite3.\n 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.\n 'PORT': '', # Set to empty string for default. Not used with sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L30_C0", "label": "TIME_ZONE =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.2158, 0.0072, 0, 0.66, 0.2174, 774, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_ZONE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_ZONE = 'America/Chicago'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L34_C0", "label": "LANGUAGE_CODE =", "type": "assigned_variable", "loc": [34, 34], "level": 0, "parent": null, "vector": [14, 0, 0.2446, 0.0072, 0, 0.66, 0.2609, 450, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LANGUAGE_CODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGUAGE_CODE = 'en-us'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L36_C0", "label": "SITE_ID =", "type": "assigned_variable", "loc": [36, 36], "level": 0, "parent": null, "vector": [14, 0, 0.259, 0.0072, 0, 0.66, 0.3043, 122, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "SITE_ID", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SITE_ID = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L40_C0", "label": "USE_I18N =", "type": "assigned_variable", "loc": [40, 40], "level": 0, "parent": null, "vector": [14, 0, 0.2878, 0.0072, 0, 0.66, 0.3478, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_I18N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_I18N = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L44_C0", "label": "USE_L10N =", "type": "assigned_variable", "loc": [44, 44], "level": 0, "parent": null, "vector": [14, 0, 0.3165, 0.0072, 0, 0.66, 0.3913, 754, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_L10N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_L10N = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L48_C0", "label": "MEDIA_ROOT =", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.3453, 0.0072, 0, 0.66, 0.4348, 764, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MEDIA_ROOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MEDIA_ROOT = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L53_C0", "label": "MEDIA_URL =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.3813, 0.0072, 0, 0.66, 0.4783, 120, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MEDIA_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MEDIA_URL = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L57_C0", "label": "STATICFILES_ROOT =", "type": "assigned_variable", "loc": [57, 57], "level": 0, "parent": null, "vector": [14, 0, 0.4101, 0.0072, 0, 0.66, 0.5217, 747, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATICFILES_ROOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_ROOT = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L61_C0", "label": "STATICFILES_URL =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 0.4388, 0.0072, 0, 0.66, 0.5652, 133, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATICFILES_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_URL = '/static/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L66_C0", "label": "ADMIN_MEDIA_PREFIX =", "type": "assigned_variable", "loc": [66, 66], "level": 0, "parent": null, "vector": [14, 0, 0.4748, 0.0072, 0, 0.66, 0.6087, 396, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ADMIN_MEDIA_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADMIN_MEDIA_PREFIX = '/static/admin/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L69_C0", "label": "STATICFILES_DIRS =", "type": "assigned_variable", "loc": [69, 69], "level": 0, "parent": null, "vector": [14, 0, 0.4964, 0.0072, 0, 0.66, 0.6522, 743, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "STATICFILES_DIRS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_DIRS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L73_C0", "label": "STATICFILES_FINDERS =", "type": "assigned_variable", "loc": [73, 77], "level": 0, "parent": null, "vector": [14, 0, 0.5396, 0.036, 0, 0.66, 0.6957, 94, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "STATICFILES_FINDERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_FINDERS = (\n 'django.contrib.staticfiles.finders.FileSystemFinder',\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n# 'django.contrib.staticfiles.finders.DefaultStorageFinder',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L80_C0", "label": "SECRET_KEY =", "type": "assigned_variable", "loc": [80, 80], "level": 0, "parent": null, "vector": [14, 0, 0.5755, 0.0072, 0, 0.66, 0.7391, 112, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SECRET_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SECRET_KEY = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L83_C0", "label": "TEMPLATE_LOADERS =", "type": "assigned_variable", "loc": [83, 87], "level": 0, "parent": null, "vector": [14, 0, 0.6115, 0.036, 0, 0.66, 0.7826, 473, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TEMPLATE_LOADERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_LOADERS = (\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n# 'django.template.loaders.eggs.Loader',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L89_C0", "label": "MIDDLEWARE_CLASSES =", "type": "assigned_variable", "loc": [89, 95], "level": 0, "parent": null, "vector": [14, 0, 0.6619, 0.0504, 0, 0.66, 0.8261, 641, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "MIDDLEWARE_CLASSES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L97_C0", "label": "ROOT_URLCONF =", "type": "assigned_variable", "loc": [97, 97], "level": 0, "parent": null, "vector": [14, 0, 0.6978, 0.0072, 0, 0.66, 0.8696, 281, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROOT_URLCONF", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROOT_URLCONF = '{{ project_name }}.urls'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L99_C0", "label": "TEMPLATE_DIRS =", "type": "assigned_variable", "loc": [99, 103], "level": 0, "parent": null, "vector": [14, 0, 0.7266, 0.036, 0, 0.66, 0.913, 910, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TEMPLATE_DIRS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_DIRS = (\n # Put strings here, like \"/home/html/django_templates\" or \"C:/www/django/templates\".\n # Always use forward slashes, even on Windows.\n # Don't forget to use absolute paths, not relative paths.\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L105_C0", "label": "INSTALLED_APPS =", "type": "assigned_variable", "loc": [105, 116], "level": 0, "parent": null, "vector": [14, 0, 0.795, 0.0863, 0, 0.66, 0.9565, 648, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "INSTALLED_APPS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INSTALLED_APPS = (\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n # Uncomment the next line to enable the admin:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98975:Assign_L123_C0", "label": "LOGGING =", "type": "assigned_variable", "loc": [123, 139], "level": 0, "parent": null, "vector": [14, 0, 0.9424, 0.1223, 0, 0.66, 1.0, 136, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "LOGGING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGGING = {\n 'version': 1,\n 'disable_existing_loggers': False,\n 'handlers': {\n 'mail_admins': {\n 'level': 'ERROR',\n 'class': 'django.utils.log.AdminEmailHandler'\n }"}] | [] |
from django.conf.urls.defaults import *
urlpatterns = patterns('django.views',
(r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
)
| ajibawa-2023/Python-Code-Large/train/row_98976 | 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_98976:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf.urls.defaults import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98976:Assign_L3_C0", "label": "urlpatterns = patterns()", "type": "assigned_variable", "loc": [3, 5], "level": 0, "parent": null, "vector": [14, 0, 0.8, 0.6, 0, 0.66, 1.0, 990, 3, 2, 0, 0, 75, 10, 1], "semantic": {"name": "urlpatterns", "arg_names": [], "import_names": [], "rhs_call_name": "patterns", "annotation": ""}, "snippet": "urlpatterns = patterns('django.views',\n (r'^(?P<content_type_id>\\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),\n)"}] | [] |
from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.core.exceptions import ImproperlyConfigured
__all__ = ['handler404', 'handler500', 'include', 'patterns', 'url']
handler404 = 'django.views.defaults.page_not_found'
handler500 = 'django.views.defaults.server_error'
def include(arg, namespace=None, app_name=None):
if isinstance(arg, tuple):
# callable returning a namespace hint
if namespace:
raise ImproperlyConfigured('Cannot override the namespace for a dynamic module that provides a namespace')
urlconf_module, app_name, namespace = arg
else:
# No namespace hint - use manually provided namespace
urlconf_module = arg
return (urlconf_module, app_name, namespace)
def patterns(prefix, *args):
pattern_list = []
for t in args:
if isinstance(t, (list, tuple)):
t = url(prefix=prefix, *t)
elif isinstance(t, RegexURLPattern):
t.add_prefix(prefix)
pattern_list.append(t)
return pattern_list
def url(regex, view, kwargs=None, name=None, prefix=''):
if isinstance(view, (list,tuple)):
# For include(...) processing.
urlconf_module, app_name, namespace = view
return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)
else:
if isinstance(view, basestring):
if not view:
raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)
if prefix:
view = prefix + '.' + view
return RegexURLPattern(regex, view, kwargs, name)
| ajibawa-2023/Python-Code-Large/train/row_98977 | 29 | 42 | 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_98977:ImportFrom_L1_C0", "label": "from django.core.urlresolvers import RegexURLPattern, RegexURLResolver", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0238, 0, 0.66, 0.0, 749, 0, 2, 0, 0, 749, 0, 0], "semantic": {"name": "django.core.urlresolvers", "arg_names": [], "import_names": ["RegexURLPattern", "RegexURLResolver"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.urlresolvers import RegexURLPattern, RegexURLResolver"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:ImportFrom_L2_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0238, 0, 0.66, 0.1429, 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_98977:Assign_L4_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.0952, 0.0238, 0, 0.66, 0.2857, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ['handler404', 'handler500', 'include', 'patterns', 'url']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L6_C0", "label": "handler404 =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1429, 0.0238, 0, 0.66, 0.4286, 882, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "handler404", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "handler404 = 'django.views.defaults.page_not_found'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L7_C0", "label": "handler500 =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.1667, 0.0238, 0, 0.66, 0.5714, 91, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "handler500", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "handler500 = 'django.views.defaults.server_error'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L9_C0", "label": "include", "type": "function", "loc": [9, 18], "level": 0, "parent": null, "vector": [2, 0, 0.3214, 0.2381, 0, 0.66, 0.7143, 142, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "include", "arg_names": ["arg", "namespace", "app_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def include(arg, namespace=None, app_name=None):\n if isinstance(arg, tuple):\n # callable returning a namespace hint\n if namespace:\n raise ImproperlyConfigured('Cannot override the namespace for a dynamic module that provides a namespace')\n urlconf_module, app_name, namespace = arg\n else:\n # No namespace hint - use manually provided namespace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "label": "if", "type": "if", "loc": [10, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L9_C0", "vector": [4, 1, 0.3214, 0.1905, 1, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(arg, tuple):\n # callable returning a namespace hint\n if namespace:\n raise ImproperlyConfigured('Cannot override the namespace for a dynamic module that provides a namespace')\n urlconf_module, app_name, namespace = arg\n else:\n # No namespace hint - use manually provided namespace\n urlconf_module = arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L12_C8", "label": "if", "type": "if", "loc": [12, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "vector": [4, 2, 0.2976, 0.0476, 2, 0.26, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if namespace:\n raise ImproperlyConfigured('Cannot override the namespace for a dynamic module that provides a namespace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L14_C8", "label": "urlconf_module, app_name, namespace =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "vector": [14, 2, 0.3333, 0.0238, 2, 0.26, 0.5, 31, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "urlconf_module, app_name, namespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " urlconf_module, app_name, namespace = arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L17_C8", "label": "urlconf_module =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "vector": [14, 2, 0.4048, 0.0238, 2, 0.26, 1.0, 360, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "urlconf_module", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " urlconf_module = arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L18_C4", "label": "return", "type": "return", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L9_C0", "vector": [13, 1, 0.4286, 0.0238, 1, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (urlconf_module, app_name, namespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "label": "patterns", "type": "function", "loc": [20, 28], "level": 0, "parent": null, "vector": [2, 0, 0.5714, 0.2143, 0, 0.66, 0.8571, 75, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "patterns", "arg_names": ["prefix", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def patterns(prefix, *args):\n pattern_list = []\n for t in args:\n if isinstance(t, (list, tuple)):\n t = url(prefix=prefix, *t)\n elif isinstance(t, RegexURLPattern):\n t.add_prefix(prefix)\n pattern_list.append(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L21_C4", "label": "pattern_list =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "vector": [14, 1, 0.5, 0.0238, 1, 0.8, 0.0, 188, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pattern_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pattern_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4", "label": "for t", "type": "for", "loc": [22, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "vector": [6, 1, 0.5833, 0.1429, 1, 0.8, 0.5, 15, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for t in args:\n if isinstance(t, (list, tuple)):\n t = url(prefix=prefix, *t)\n elif isinstance(t, RegexURLPattern):\n t.add_prefix(prefix)\n pattern_list.append(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8", "label": "if", "type": "if", "loc": [23, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4", "vector": [4, 2, 0.5833, 0.0952, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(t, (list, tuple)):\n t = url(prefix=prefix, *t)\n elif isinstance(t, RegexURLPattern):\n t.add_prefix(prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L24_C12", "label": "t = url()", "type": "assigned_variable", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8", "vector": [14, 3, 0.5714, 0.0238, 3, 0.91, 0.0, 15, 3, 2, 0, 0, 789, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "url", "annotation": ""}, "snippet": " t = url(prefix=prefix, *t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L25_C8", "label": "if", "type": "if", "loc": [25, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8", "vector": [4, 3, 0.6071, 0.0476, 3, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(t, RegexURLPattern):\n t.add_prefix(prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Expr_L26_C12", "label": "add_prefix()", "type": "expression", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L25_C8", "vector": [8, 4, 0.619, 0.0238, 4, 0.37, 0.0, 391, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "add_prefix", "annotation": ""}, "snippet": " t.add_prefix(prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Expr_L27_C8", "label": "append()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4", "vector": [8, 2, 0.6429, 0.0238, 2, 0.91, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pattern_list.append(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L28_C4", "label": "return", "type": "return", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "vector": [13, 1, 0.6667, 0.0238, 1, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return pattern_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L30_C0", "label": "url", "type": "function", "loc": [30, 41], "level": 0, "parent": null, "vector": [2, 0, 0.8452, 0.2857, 0, 0.66, 1.0, 789, 0, 5, 1, 0, 0, 0, 5], "semantic": {"name": "url", "arg_names": ["regex", "view", "kwargs", "name", "prefix"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def url(regex, view, kwargs=None, name=None, prefix=''):\n if isinstance(view, (list,tuple)):\n # For include(...) processing.\n urlconf_module, app_name, namespace = view\n return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)\n else:\n if isinstance(view, basestring):\n if not view:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "label": "if", "type": "if", "loc": [31, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L30_C0", "vector": [4, 1, 0.8571, 0.2619, 1, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(view, (list,tuple)):\n # For include(...) processing.\n urlconf_module, app_name, namespace = view\n return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)\n else:\n if isinstance(view, basestring):\n if not view:\n raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L33_C8", "label": "urlconf_module, app_name, namespace =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "vector": [14, 2, 0.7857, 0.0238, 2, 0.65, 0.0, 31, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "urlconf_module, app_name, namespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " urlconf_module, app_name, namespace = view"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "vector": [13, 2, 0.8095, 0.0238, 2, 0.65, 0.3333, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8", "label": "if", "type": "if", "loc": [36, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "vector": [4, 2, 0.9048, 0.119, 2, 0.65, 0.6667, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(view, basestring):\n if not view:\n raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)\n if prefix:\n view = prefix + '.' + view"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L37_C12", "label": "if", "type": "if", "loc": [37, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8", "vector": [4, 3, 0.8929, 0.0476, 3, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not view:\n raise ImproperlyConfigured('Empty URL pattern view name not permitted (for pattern %r)' % regex)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L39_C12", "label": "if", "type": "if", "loc": [39, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8", "vector": [4, 3, 0.9405, 0.0476, 3, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prefix:\n view = prefix + '.' + view"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L40_C16", "label": "view =", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L39_C12", "vector": [14, 4, 0.9524, 0.0238, 4, 0.78, 0.0, 781, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "view", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " view = prefix + '.' + view"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "vector": [13, 2, 0.9762, 0.0238, 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 RegexURLPattern(regex, view, kwargs, name)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Expr_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L39_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Assign_L40_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98977:If_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98977:Return_L41_C8"}] |
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^setlang/$', 'django.views.i18n.set_language'),
)
| ajibawa-2023/Python-Code-Large/train/row_98978 | 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_98978:ImportFrom_L1_C0", "label": "from django.conf.urls.defaults import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.2, 0, 0.66, 0.0, 341, 0, 1, 0, 0, 341, 0, 0], "semantic": {"name": "django.conf.urls.defaults", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.conf.urls.defaults import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98978:Assign_L3_C0", "label": "urlpatterns = patterns()", "type": "assigned_variable", "loc": [3, 5], "level": 0, "parent": null, "vector": [14, 0, 0.8, 0.6, 0, 0.66, 1.0, 990, 3, 2, 0, 0, 75, 10, 1], "semantic": {"name": "urlpatterns", "arg_names": [], "import_names": [], "rhs_call_name": "patterns", "annotation": ""}, "snippet": "urlpatterns = patterns('',\n (r'^setlang/$', 'django.views.i18n.set_language'),\n)"}] | [] |
# Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
####################
# CORE #
####################
DEBUG = False
TEMPLATE_DEBUG = False
# Whether the framework should propagate raw exceptions rather than catching
# them. This is useful under some testing siutations and should never be used
# on a live site.
DEBUG_PROPAGATE_EXCEPTIONS = False
# Whether to use the "Etag" header. This saves bandwidth but slows down performance.
USE_ETAGS = False
# People who get code error notifications.
# In the format (('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com'))
ADMINS = ()
# Tuple of IP addresses, as strings, that:
# * See debug comments, when DEBUG is true
# * Receive x-headers
INTERNAL_IPS = ()
# Local time zone for this installation. All choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all
# systems may support all possibilities).
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
# Languages we provide translations for, out of the box. The language name
# should be the utf-8 encoded local name for the language.
LANGUAGES = (
('ar', gettext_noop('Arabic')),
('bg', gettext_noop('Bulgarian')),
('bn', gettext_noop('Bengali')),
('bs', gettext_noop('Bosnian')),
('ca', gettext_noop('Catalan')),
('cs', gettext_noop('Czech')),
('cy', gettext_noop('Welsh')),
('da', gettext_noop('Danish')),
('de', gettext_noop('German')),
('el', gettext_noop('Greek')),
('en', gettext_noop('English')),
('en-gb', gettext_noop('British English')),
('es', gettext_noop('Spanish')),
('es-ar', gettext_noop('Argentinian Spanish')),
('et', gettext_noop('Estonian')),
('eu', gettext_noop('Basque')),
('fa', gettext_noop('Persian')),
('fi', gettext_noop('Finnish')),
('fr', gettext_noop('French')),
('fy-nl', gettext_noop('Frisian')),
('ga', gettext_noop('Irish')),
('gl', gettext_noop('Galician')),
('he', gettext_noop('Hebrew')),
('hi', gettext_noop('Hindi')),
('hr', gettext_noop('Croatian')),
('hu', gettext_noop('Hungarian')),
('id', gettext_noop('Indonesian')),
('is', gettext_noop('Icelandic')),
('it', gettext_noop('Italian')),
('ja', gettext_noop('Japanese')),
('ka', gettext_noop('Georgian')),
('km', gettext_noop('Khmer')),
('kn', gettext_noop('Kannada')),
('ko', gettext_noop('Korean')),
('lt', gettext_noop('Lithuanian')),
('lv', gettext_noop('Latvian')),
('mk', gettext_noop('Macedonian')),
('ml', gettext_noop('Malayalam')),
('mn', gettext_noop('Mongolian')),
('nl', gettext_noop('Dutch')),
('no', gettext_noop('Norwegian')),
('nb', gettext_noop('Norwegian Bokmal')),
('nn', gettext_noop('Norwegian Nynorsk')),
('pa', gettext_noop('Punjabi')),
('pl', gettext_noop('Polish')),
('pt', gettext_noop('Portuguese')),
('pt-br', gettext_noop('Brazilian Portuguese')),
('ro', gettext_noop('Romanian')),
('ru', gettext_noop('Russian')),
('sk', gettext_noop('Slovak')),
('sl', gettext_noop('Slovenian')),
('sq', gettext_noop('Albanian')),
('sr', gettext_noop('Serbian')),
('sr-latn', gettext_noop('Serbian Latin')),
('sv', gettext_noop('Swedish')),
('ta', gettext_noop('Tamil')),
('te', gettext_noop('Telugu')),
('th', gettext_noop('Thai')),
('tr', gettext_noop('Turkish')),
('uk', gettext_noop('Ukrainian')),
('vi', gettext_noop('Vietnamese')),
('zh-cn', gettext_noop('Simplified Chinese')),
('zh-tw', gettext_noop('Traditional Chinese')),
)
# Languages using BiDi (right-to-left) layout
LANGUAGES_BIDI = ("he", "ar", "fa")
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
LOCALE_PATHS = ()
LANGUAGE_COOKIE_NAME = 'django_language'
# If you set this to True, Django will format dates, numbers and calendars
# according to user current locale
USE_L10N = False
# Not-necessarily-technical managers of the site. They get broken link
# notifications and other various e-mails.
MANAGERS = ADMINS
# Default content type and charset to use for all HttpResponse objects, if a
# MIME type isn't manually specified. These are used to construct the
# Content-Type header.
DEFAULT_CONTENT_TYPE = 'text/html'
DEFAULT_CHARSET = 'utf-8'
# Encoding of files read from disk (template and initial SQL files).
FILE_CHARSET = 'utf-8'
# E-mail address that error messages come from.
SERVER_EMAIL = 'root@localhost'
# Whether to send broken-link e-mails.
SEND_BROKEN_LINK_EMAILS = False
# Database connection info.
# Legacy format
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
DATABASE_OPTIONS = {} # Set to empty dictionary for default.
# New format
DATABASES = {
}
# Classes used to implement db routing behaviour
DATABASE_ROUTERS = []
# The email backend to use. For possible shortcuts see django.core.mail.
# The default is to use the SMTP backend.
# Third-party backends can be specified by providing a Python path
# to a module that defines an EmailBackend class.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# Host for sending e-mail.
EMAIL_HOST = 'localhost'
# Port for sending e-mail.
EMAIL_PORT = 25
# Optional SMTP authentication information for EMAIL_HOST.
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
# List of strings representing installed apps.
INSTALLED_APPS = ()
# List of locations of the template source files, in search order.
TEMPLATE_DIRS = ()
# List of callables that know how to import templates from various sources.
# See the comments in django/core/template/loader.py for interface
# documentation.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
# List of processors used by RequestContext to populate the context.
# Each one should be a callable that takes the request object as its
# only parameter and returns a dictionary to add to the context.
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
# 'django.core.context_processors.request',
'django.contrib.messages.context_processors.messages',
'django.contrib.staticfiles.context_processors.staticfiles',
)
# Output to use in template system for invalid (e.g. misspelled) variables.
TEMPLATE_STRING_IF_INVALID = ''
# Default e-mail address to use for various automated correspondence from
# the site managers.
DEFAULT_FROM_EMAIL = 'webmaster@localhost'
# Subject-line prefix for email messages send with django.core.mail.mail_admins
# or ...mail_managers. Make sure to include the trailing space.
EMAIL_SUBJECT_PREFIX = '[Django] '
# Whether to append trailing slashes to URLs.
APPEND_SLASH = True
# Whether to prepend the "www." subdomain to URLs that don't have it.
PREPEND_WWW = False
# Override the server-derived value of SCRIPT_NAME
FORCE_SCRIPT_NAME = None
# List of compiled regular expression objects representing User-Agent strings
# that are not allowed to visit any page, systemwide. Use this for bad
# robots/crawlers. Here are a few examples:
# import re
# DISALLOWED_USER_AGENTS = (
# re.compile(r'^NaverBot.*'),
# re.compile(r'^EmailSiphon.*'),
# re.compile(r'^SiteSucker.*'),
# re.compile(r'^sohu-search')
# )
DISALLOWED_USER_AGENTS = ()
ABSOLUTE_URL_OVERRIDES = {}
# Tuple of strings representing allowed prefixes for the {% ssi %} tag.
# Example: ('/home/html', '/var/www')
ALLOWED_INCLUDE_ROOTS = ()
# If this is a admin settings module, this should be a list of
# settings modules (in the format 'foo.bar.baz') for which this admin
# is an admin.
ADMIN_FOR = ()
# 404s that may be ignored.
IGNORABLE_404_STARTS = ('/cgi-bin/', '/_vti_bin', '/_vti_inf')
IGNORABLE_404_ENDS = ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')
# A secret key for this particular Django installation. Used in secret-key
# hashing algorithms. Set this in your settings, or Django will complain
# loudly.
SECRET_KEY = ''
# Default file storage mechanism that holds media.
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
MEDIA_URL = ''
# List of upload handler classes to be applied in order.
FILE_UPLOAD_HANDLERS = (
'django.core.files.uploadhandler.MemoryFileUploadHandler',
'django.core.files.uploadhandler.TemporaryFileUploadHandler',
)
# Maximum size, in bytes, of a request before it will be streamed to the
# file system instead of into memory.
FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB
# Directory in which upload streamed files will be temporarily saved. A value of
# `None` will make Django use the operating system's default temporary directory
# (i.e. "/tmp" on *nix systems).
FILE_UPLOAD_TEMP_DIR = None
# The numeric mode to set newly-uploaded files to. The value should be a mode
# you'd pass directly to os.chmod; see http://docs.python.org/lib/os-file-dir.html.
FILE_UPLOAD_PERMISSIONS = None
# Python module path where user will place custom format definition.
# The directory where this setting is pointing should contain subdirectories
# named as the locales, containing a formats.py file
# (i.e. "myproject.locale" for myproject/locale/en/formats.py etc. use)
FORMAT_MODULE_PATH = None
# Default formatting for date objects. See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
# Default formatting for datetime objects. See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATETIME_FORMAT = 'N j, Y, P'
# Default formatting for time objects. See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
TIME_FORMAT = 'P'
# Default formatting for date objects when only the year and month are relevant.
# See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
YEAR_MONTH_FORMAT = 'F Y'
# Default formatting for date objects when only the month and day are relevant.
# See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
MONTH_DAY_FORMAT = 'F j'
# Default short formatting for date objects. See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
SHORT_DATE_FORMAT = 'm/d/Y'
# Default short formatting for datetime objects.
# See all available format strings here:
# http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
SHORT_DATETIME_FORMAT = 'm/d/Y P'
# Default formats to be used when parsing dates from input boxes, in order
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'
'%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'
)
# Default formats to be used when parsing times from input boxes, in order
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
TIME_INPUT_FORMATS = (
'%H:%M:%S', # '14:30:59'
'%H:%M', # '14:30'
)
# Default formats to be used when parsing dates and times from input boxes,
# in order
# See all available format string here:
# http://docs.python.org/library/datetime.html#strftime-behavior
# * Note that these format strings are different from the ones to display dates
DATETIME_INPUT_FORMATS = (
'%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'
'%Y-%m-%d %H:%M', # '2006-10-25 14:30'
'%Y-%m-%d', # '2006-10-25'
'%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'
'%m/%d/%Y %H:%M', # '10/25/2006 14:30'
'%m/%d/%Y', # '10/25/2006'
'%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'
'%m/%d/%y %H:%M', # '10/25/06 14:30'
'%m/%d/%y', # '10/25/06'
)
# First day of week, to be used on calendars
# 0 means Sunday, 1 means Monday...
FIRST_DAY_OF_WEEK = 0
# Decimal separator symbol
DECIMAL_SEPARATOR = '.'
# Boolean that sets whether to add thousand separator when formatting numbers
USE_THOUSAND_SEPARATOR = False
# Number of digits that will be together, when spliting them by
# THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands...
NUMBER_GROUPING = 0
# Thousand separator symbol
THOUSAND_SEPARATOR = ','
# Do you want to manage transactions manually?
# Hint: you really don't!
TRANSACTIONS_MANAGED = False
# The User-Agent string to use when checking for URL validity through the
# isExistingURL validator.
from django import get_version
URL_VALIDATOR_USER_AGENT = "Django/%s (http://www.djangoproject.com)" % get_version()
# The tablespaces to use for each model when not specified otherwise.
DEFAULT_TABLESPACE = ''
DEFAULT_INDEX_TABLESPACE = ''
##############
# MIDDLEWARE #
##############
# List of middleware classes to use. Order is important; in the request phase,
# this middleware classes will be applied in the order given, and in the
# response phase the middleware will be applied in reverse order.
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# 'django.middleware.http.ConditionalGetMiddleware',
# 'django.middleware.gzip.GZipMiddleware',
)
############
# SESSIONS #
############
SESSION_COOKIE_NAME = 'sessionid' # Cookie name. This can be whatever you want.
SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds (default: 2 weeks).
SESSION_COOKIE_DOMAIN = None # A string like ".lawrence.com", or None for standard domain cookie.
SESSION_COOKIE_SECURE = False # Whether the session cookie should be secure (https:// only).
SESSION_COOKIE_PATH = '/' # The path of the session cookie.
SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request.
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether a user's session cookie expires when the Web browser is closed.
SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data
SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If None, the backend will use a sensible default.
#########
# CACHE #
#########
# The cache backend to use. See the docstring in django.core.cache for the
# possible values.
CACHE_BACKEND = 'locmem://'
CACHE_MIDDLEWARE_KEY_PREFIX = ''
CACHE_MIDDLEWARE_SECONDS = 600
####################
# COMMENTS #
####################
COMMENTS_ALLOW_PROFANITIES = False
# The profanities that will trigger a validation error in the
# 'hasNoProfanities' validator. All of these should be in lowercase.
PROFANITIES_LIST = ()
# The group ID that designates which users are banned.
# Set to None if you're not using it.
COMMENTS_BANNED_USERS_GROUP = None
# The group ID that designates which users can moderate comments.
# Set to None if you're not using it.
COMMENTS_MODERATORS_GROUP = None
# The group ID that designates the users whose comments should be e-mailed to MANAGERS.
# Set to None if you're not using it.
COMMENTS_SKETCHY_USERS_GROUP = None
# The system will e-mail MANAGERS the first COMMENTS_FIRST_FEW comments by each
# user. Set this to 0 if you want to disable it.
COMMENTS_FIRST_FEW = 0
# A tuple of IP addresses that have been banned from participating in various
# Django-powered features.
BANNED_IPS = ()
##################
# AUTHENTICATION #
##################
AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
LOGIN_URL = '/accounts/login/'
LOGOUT_URL = '/accounts/logout/'
LOGIN_REDIRECT_URL = '/accounts/profile/'
# The number of days a password reset link is valid for
PASSWORD_RESET_TIMEOUT_DAYS = 3
########
# CSRF #
########
# Dotted path to callable to be used as view when a request is
# rejected by the CSRF middleware.
CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'
# Name and domain for CSRF cookie.
CSRF_COOKIE_NAME = 'csrftoken'
CSRF_COOKIE_DOMAIN = None
############
# MESSAGES #
############
# Class to use as messges backend
MESSAGE_STORAGE = 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'
# Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within
# django.contrib.messages to avoid imports in this settings file.
###########
# LOGGING #
###########
# The callable to use to configure logging
LOGGING_CONFIG = 'django.utils.log.dictConfig'
# The default logging configuration. This sends an email to
# the site admins on every HTTP 500 error. All other log
# records are sent to the bit bucket.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request':{
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
###########
# TESTING #
###########
# The name of the class to use to run the test suite
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
# The name of the database to use for testing purposes.
# If None, a name of 'test_' + DATABASE_NAME will be assumed
TEST_DATABASE_NAME = None
# Strings used to set the character set and collation order for the test
# database. These values are passed literally to the server, so they are
# backend-dependent. If None, no special settings are sent (system defaults are
# used).
TEST_DATABASE_CHARSET = None
TEST_DATABASE_COLLATION = None
############
# FIXTURES #
############
# The list of directories to search for fixtures
FIXTURE_DIRS = ()
###############
# STATICFILES #
###############
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/static/"
STATICFILES_ROOT = ''
# URL that handles the static files served from STATICFILES_ROOT.
# Example: "http://media.lawrence.com/static/"
STATICFILES_URL = '/static/'
# A list of locations of additional static files
STATICFILES_DIRS = ()
# The default file storage backend used during the build process
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# URL prefix for admin media -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'
| ajibawa-2023/Python-Code-Large/train/row_98980 | 123 | 580 | 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_98980:Assign_L6_C0", "label": "gettext_noop =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0103, 0.0017, 0, 0.66, 0.0, 651, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "gettext_noop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "gettext_noop = lambda s: s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L12_C0", "label": "DEBUG =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0207, 0.0017, 0, 0.66, 0.0082, 309, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEBUG = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L13_C0", "label": "TEMPLATE_DEBUG =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0224, 0.0017, 0, 0.66, 0.0164, 7, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "TEMPLATE_DEBUG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_DEBUG = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L18_C0", "label": "DEBUG_PROPAGATE_EXCEPTIONS =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.031, 0.0017, 0, 0.66, 0.0246, 182, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "DEBUG_PROPAGATE_EXCEPTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEBUG_PROPAGATE_EXCEPTIONS = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L21_C0", "label": "USE_ETAGS =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0362, 0.0017, 0, 0.66, 0.0328, 536, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_ETAGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_ETAGS = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L25_C0", "label": "ADMINS =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.0431, 0.0017, 0, 0.66, 0.041, 223, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ADMINS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADMINS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L30_C0", "label": "INTERNAL_IPS =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.0517, 0.0017, 0, 0.66, 0.0492, 939, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "INTERNAL_IPS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INTERNAL_IPS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L35_C0", "label": "TIME_ZONE =", "type": "assigned_variable", "loc": [35, 35], "level": 0, "parent": null, "vector": [14, 0, 0.0603, 0.0017, 0, 0.66, 0.0574, 774, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_ZONE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_ZONE = 'America/Chicago'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L39_C0", "label": "LANGUAGE_CODE =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.0672, 0.0017, 0, 0.66, 0.0656, 450, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LANGUAGE_CODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGUAGE_CODE = 'en-us'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L43_C0", "label": "LANGUAGES =", "type": "assigned_variable", "loc": [43, 107], "level": 0, "parent": null, "vector": [14, 0, 0.1293, 0.1121, 0, 0.66, 0.0738, 598, 0, 0, 0, 0, 0, 8, 63], "semantic": {"name": "LANGUAGES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGUAGES = (\n ('ar', gettext_noop('Arabic')),\n ('bg', gettext_noop('Bulgarian')),\n ('bn', gettext_noop('Bengali')),\n ('bs', gettext_noop('Bosnian')),\n ('ca', gettext_noop('Catalan')),\n ('cs', gettext_noop('Czech')),\n ('cy', gettext_noop('Welsh')),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L110_C0", "label": "LANGUAGES_BIDI =", "type": "assigned_variable", "loc": [110, 110], "level": 0, "parent": null, "vector": [14, 0, 0.1897, 0.0017, 0, 0.66, 0.082, 812, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "LANGUAGES_BIDI", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGUAGES_BIDI = (\"he\", \"ar\", \"fa\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L114_C0", "label": "USE_I18N =", "type": "assigned_variable", "loc": [114, 114], "level": 0, "parent": null, "vector": [14, 0, 0.1966, 0.0017, 0, 0.66, 0.0902, 547, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_I18N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_I18N = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L115_C0", "label": "LOCALE_PATHS =", "type": "assigned_variable", "loc": [115, 115], "level": 0, "parent": null, "vector": [14, 0, 0.1983, 0.0017, 0, 0.66, 0.0984, 801, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "LOCALE_PATHS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOCALE_PATHS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L116_C0", "label": "LANGUAGE_COOKIE_NAME =", "type": "assigned_variable", "loc": [116, 116], "level": 0, "parent": null, "vector": [14, 0, 0.2, 0.0017, 0, 0.66, 0.1066, 149, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LANGUAGE_COOKIE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LANGUAGE_COOKIE_NAME = 'django_language'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L120_C0", "label": "USE_L10N =", "type": "assigned_variable", "loc": [120, 120], "level": 0, "parent": null, "vector": [14, 0, 0.2069, 0.0017, 0, 0.66, 0.1148, 754, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_L10N", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_L10N = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L124_C0", "label": "MANAGERS =", "type": "assigned_variable", "loc": [124, 124], "level": 0, "parent": null, "vector": [14, 0, 0.2138, 0.0017, 0, 0.66, 0.123, 275, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "MANAGERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MANAGERS = ADMINS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L129_C0", "label": "DEFAULT_CONTENT_TYPE =", "type": "assigned_variable", "loc": [129, 129], "level": 0, "parent": null, "vector": [14, 0, 0.2224, 0.0017, 0, 0.66, 0.1311, 54, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_CONTENT_TYPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_CONTENT_TYPE = 'text/html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L130_C0", "label": "DEFAULT_CHARSET =", "type": "assigned_variable", "loc": [130, 130], "level": 0, "parent": null, "vector": [14, 0, 0.2241, 0.0017, 0, 0.66, 0.1393, 187, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_CHARSET", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_CHARSET = 'utf-8'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L133_C0", "label": "FILE_CHARSET =", "type": "assigned_variable", "loc": [133, 133], "level": 0, "parent": null, "vector": [14, 0, 0.2293, 0.0017, 0, 0.66, 0.1475, 344, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "FILE_CHARSET", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FILE_CHARSET = 'utf-8'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L136_C0", "label": "SERVER_EMAIL =", "type": "assigned_variable", "loc": [136, 136], "level": 0, "parent": null, "vector": [14, 0, 0.2345, 0.0017, 0, 0.66, 0.1557, 177, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SERVER_EMAIL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SERVER_EMAIL = 'root@localhost'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L139_C0", "label": "SEND_BROKEN_LINK_EMAILS =", "type": "assigned_variable", "loc": [139, 139], "level": 0, "parent": null, "vector": [14, 0, 0.2397, 0.0017, 0, 0.66, 0.1639, 647, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SEND_BROKEN_LINK_EMAILS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SEND_BROKEN_LINK_EMAILS = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L143_C0", "label": "DATABASE_ENGINE =", "type": "assigned_variable", "loc": [143, 143], "level": 0, "parent": null, "vector": [14, 0, 0.2466, 0.0017, 0, 0.66, 0.1721, 96, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_ENGINE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L144_C0", "label": "DATABASE_NAME =", "type": "assigned_variable", "loc": [144, 144], "level": 0, "parent": null, "vector": [14, 0, 0.2483, 0.0017, 0, 0.66, 0.1803, 982, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_NAME = '' # Or path to database file if using sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L145_C0", "label": "DATABASE_USER =", "type": "assigned_variable", "loc": [145, 145], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0017, 0, 0.66, 0.1885, 730, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_USER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_USER = '' # Not used with sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L146_C0", "label": "DATABASE_PASSWORD =", "type": "assigned_variable", "loc": [146, 146], "level": 0, "parent": null, "vector": [14, 0, 0.2517, 0.0017, 0, 0.66, 0.1967, 678, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_PASSWORD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_PASSWORD = '' # Not used with sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L147_C0", "label": "DATABASE_HOST =", "type": "assigned_variable", "loc": [147, 147], "level": 0, "parent": null, "vector": [14, 0, 0.2534, 0.0017, 0, 0.66, 0.2049, 709, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_HOST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L148_C0", "label": "DATABASE_PORT =", "type": "assigned_variable", "loc": [148, 148], "level": 0, "parent": null, "vector": [14, 0, 0.2552, 0.0017, 0, 0.66, 0.2131, 53, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATABASE_PORT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L149_C0", "label": "DATABASE_OPTIONS =", "type": "assigned_variable", "loc": [149, 149], "level": 0, "parent": null, "vector": [14, 0, 0.2569, 0.0017, 0, 0.66, 0.2213, 18, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "DATABASE_OPTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_OPTIONS = {} # Set to empty dictionary for default."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L152_C0", "label": "DATABASES =", "type": "assigned_variable", "loc": [152, 153], "level": 0, "parent": null, "vector": [14, 0, 0.2629, 0.0034, 0, 0.66, 0.2295, 12, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "DATABASES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASES = {\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L156_C0", "label": "DATABASE_ROUTERS =", "type": "assigned_variable", "loc": [156, 156], "level": 0, "parent": null, "vector": [14, 0, 0.269, 0.0017, 0, 0.66, 0.2377, 331, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "DATABASE_ROUTERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATABASE_ROUTERS = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L162_C0", "label": "EMAIL_BACKEND =", "type": "assigned_variable", "loc": [162, 162], "level": 0, "parent": null, "vector": [14, 0, 0.2793, 0.0017, 0, 0.66, 0.2459, 837, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EMAIL_BACKEND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L165_C0", "label": "EMAIL_HOST =", "type": "assigned_variable", "loc": [165, 165], "level": 0, "parent": null, "vector": [14, 0, 0.2845, 0.0017, 0, 0.66, 0.2541, 55, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EMAIL_HOST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_HOST = 'localhost'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L168_C0", "label": "EMAIL_PORT =", "type": "assigned_variable", "loc": [168, 168], "level": 0, "parent": null, "vector": [14, 0, 0.2897, 0.0017, 0, 0.66, 0.2623, 267, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "EMAIL_PORT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_PORT = 25"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L171_C0", "label": "EMAIL_HOST_USER =", "type": "assigned_variable", "loc": [171, 171], "level": 0, "parent": null, "vector": [14, 0, 0.2948, 0.0017, 0, 0.66, 0.2705, 88, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EMAIL_HOST_USER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_HOST_USER = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L172_C0", "label": "EMAIL_HOST_PASSWORD =", "type": "assigned_variable", "loc": [172, 172], "level": 0, "parent": null, "vector": [14, 0, 0.2966, 0.0017, 0, 0.66, 0.2787, 772, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EMAIL_HOST_PASSWORD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_HOST_PASSWORD = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L173_C0", "label": "EMAIL_USE_TLS =", "type": "assigned_variable", "loc": [173, 173], "level": 0, "parent": null, "vector": [14, 0, 0.2983, 0.0017, 0, 0.66, 0.2869, 611, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "EMAIL_USE_TLS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_USE_TLS = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L176_C0", "label": "INSTALLED_APPS =", "type": "assigned_variable", "loc": [176, 176], "level": 0, "parent": null, "vector": [14, 0, 0.3034, 0.0017, 0, 0.66, 0.2951, 648, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "INSTALLED_APPS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INSTALLED_APPS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L179_C0", "label": "TEMPLATE_DIRS =", "type": "assigned_variable", "loc": [179, 179], "level": 0, "parent": null, "vector": [14, 0, 0.3086, 0.0017, 0, 0.66, 0.3033, 910, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TEMPLATE_DIRS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_DIRS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L184_C0", "label": "TEMPLATE_LOADERS =", "type": "assigned_variable", "loc": [184, 188], "level": 0, "parent": null, "vector": [14, 0, 0.3207, 0.0086, 0, 0.66, 0.3115, 473, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TEMPLATE_LOADERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_LOADERS = (\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n# 'django.template.loaders.eggs.Loader',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L193_C0", "label": "TEMPLATE_CONTEXT_PROCESSORS =", "type": "assigned_variable", "loc": [193, 201], "level": 0, "parent": null, "vector": [14, 0, 0.3397, 0.0155, 0, 0.66, 0.3197, 470, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TEMPLATE_CONTEXT_PROCESSORS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_CONTEXT_PROCESSORS = (\n 'django.contrib.auth.context_processors.auth',\n 'django.core.context_processors.debug',\n 'django.core.context_processors.i18n',\n 'django.core.context_processors.media',\n# 'django.core.context_processors.request',\n 'django.contrib.messages.context_processors.messages',\n 'django.contrib.staticfiles.context_processors.staticfiles',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L204_C0", "label": "TEMPLATE_STRING_IF_INVALID =", "type": "assigned_variable", "loc": [204, 204], "level": 0, "parent": null, "vector": [14, 0, 0.3517, 0.0017, 0, 0.66, 0.3279, 40, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TEMPLATE_STRING_IF_INVALID", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEMPLATE_STRING_IF_INVALID = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L208_C0", "label": "DEFAULT_FROM_EMAIL =", "type": "assigned_variable", "loc": [208, 208], "level": 0, "parent": null, "vector": [14, 0, 0.3586, 0.0017, 0, 0.66, 0.3361, 396, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_FROM_EMAIL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_FROM_EMAIL = 'webmaster@localhost'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L212_C0", "label": "EMAIL_SUBJECT_PREFIX =", "type": "assigned_variable", "loc": [212, 212], "level": 0, "parent": null, "vector": [14, 0, 0.3655, 0.0017, 0, 0.66, 0.3443, 529, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EMAIL_SUBJECT_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EMAIL_SUBJECT_PREFIX = '[Django] '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L215_C0", "label": "APPEND_SLASH =", "type": "assigned_variable", "loc": [215, 215], "level": 0, "parent": null, "vector": [14, 0, 0.3707, 0.0017, 0, 0.66, 0.3525, 634, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "APPEND_SLASH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "APPEND_SLASH = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L218_C0", "label": "PREPEND_WWW =", "type": "assigned_variable", "loc": [218, 218], "level": 0, "parent": null, "vector": [14, 0, 0.3759, 0.0017, 0, 0.66, 0.3607, 263, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "PREPEND_WWW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PREPEND_WWW = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L221_C0", "label": "FORCE_SCRIPT_NAME =", "type": "assigned_variable", "loc": [221, 221], "level": 0, "parent": null, "vector": [14, 0, 0.381, 0.0017, 0, 0.66, 0.3689, 672, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "FORCE_SCRIPT_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FORCE_SCRIPT_NAME = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L233_C0", "label": "DISALLOWED_USER_AGENTS =", "type": "assigned_variable", "loc": [233, 233], "level": 0, "parent": null, "vector": [14, 0, 0.4017, 0.0017, 0, 0.66, 0.377, 211, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DISALLOWED_USER_AGENTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DISALLOWED_USER_AGENTS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L235_C0", "label": "ABSOLUTE_URL_OVERRIDES =", "type": "assigned_variable", "loc": [235, 235], "level": 0, "parent": null, "vector": [14, 0, 0.4052, 0.0017, 0, 0.66, 0.3852, 543, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ABSOLUTE_URL_OVERRIDES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ABSOLUTE_URL_OVERRIDES = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L239_C0", "label": "ALLOWED_INCLUDE_ROOTS =", "type": "assigned_variable", "loc": [239, 239], "level": 0, "parent": null, "vector": [14, 0, 0.4121, 0.0017, 0, 0.66, 0.3934, 539, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ALLOWED_INCLUDE_ROOTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ALLOWED_INCLUDE_ROOTS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L244_C0", "label": "ADMIN_FOR =", "type": "assigned_variable", "loc": [244, 244], "level": 0, "parent": null, "vector": [14, 0, 0.4207, 0.0017, 0, 0.66, 0.4016, 447, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ADMIN_FOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADMIN_FOR = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L247_C0", "label": "IGNORABLE_404_STARTS =", "type": "assigned_variable", "loc": [247, 247], "level": 0, "parent": null, "vector": [14, 0, 0.4259, 0.0017, 0, 0.66, 0.4098, 152, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "IGNORABLE_404_STARTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "IGNORABLE_404_STARTS = ('/cgi-bin/', '/_vti_bin', '/_vti_inf')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L248_C0", "label": "IGNORABLE_404_ENDS =", "type": "assigned_variable", "loc": [248, 248], "level": 0, "parent": null, "vector": [14, 0, 0.4276, 0.0017, 0, 0.66, 0.418, 359, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "IGNORABLE_404_ENDS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "IGNORABLE_404_ENDS = ('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L253_C0", "label": "SECRET_KEY =", "type": "assigned_variable", "loc": [253, 253], "level": 0, "parent": null, "vector": [14, 0, 0.4362, 0.0017, 0, 0.66, 0.4262, 112, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SECRET_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SECRET_KEY = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L256_C0", "label": "DEFAULT_FILE_STORAGE =", "type": "assigned_variable", "loc": [256, 256], "level": 0, "parent": null, "vector": [14, 0, 0.4414, 0.0017, 0, 0.66, 0.4344, 300, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_FILE_STORAGE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L260_C0", "label": "MEDIA_ROOT =", "type": "assigned_variable", "loc": [260, 260], "level": 0, "parent": null, "vector": [14, 0, 0.4483, 0.0017, 0, 0.66, 0.4426, 764, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MEDIA_ROOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MEDIA_ROOT = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L264_C0", "label": "MEDIA_URL =", "type": "assigned_variable", "loc": [264, 264], "level": 0, "parent": null, "vector": [14, 0, 0.4552, 0.0017, 0, 0.66, 0.4508, 120, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MEDIA_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MEDIA_URL = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L267_C0", "label": "FILE_UPLOAD_HANDLERS =", "type": "assigned_variable", "loc": [267, 270], "level": 0, "parent": null, "vector": [14, 0, 0.4629, 0.0069, 0, 0.66, 0.459, 216, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "FILE_UPLOAD_HANDLERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FILE_UPLOAD_HANDLERS = (\n 'django.core.files.uploadhandler.MemoryFileUploadHandler',\n 'django.core.files.uploadhandler.TemporaryFileUploadHandler',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L274_C0", "label": "FILE_UPLOAD_MAX_MEMORY_SIZE =", "type": "assigned_variable", "loc": [274, 274], "level": 0, "parent": null, "vector": [14, 0, 0.4724, 0.0017, 0, 0.66, 0.4672, 432, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FILE_UPLOAD_MAX_MEMORY_SIZE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L279_C0", "label": "FILE_UPLOAD_TEMP_DIR =", "type": "assigned_variable", "loc": [279, 279], "level": 0, "parent": null, "vector": [14, 0, 0.481, 0.0017, 0, 0.66, 0.4754, 519, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "FILE_UPLOAD_TEMP_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FILE_UPLOAD_TEMP_DIR = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L283_C0", "label": "FILE_UPLOAD_PERMISSIONS =", "type": "assigned_variable", "loc": [283, 283], "level": 0, "parent": null, "vector": [14, 0, 0.4879, 0.0017, 0, 0.66, 0.4836, 905, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "FILE_UPLOAD_PERMISSIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FILE_UPLOAD_PERMISSIONS = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L289_C0", "label": "FORMAT_MODULE_PATH =", "type": "assigned_variable", "loc": [289, 289], "level": 0, "parent": null, "vector": [14, 0, 0.4983, 0.0017, 0, 0.66, 0.4918, 607, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "FORMAT_MODULE_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FORMAT_MODULE_PATH = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L293_C0", "label": "DATE_FORMAT =", "type": "assigned_variable", "loc": [293, 293], "level": 0, "parent": null, "vector": [14, 0, 0.5052, 0.0017, 0, 0.66, 0.5, 843, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_FORMAT = 'N j, Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L297_C0", "label": "DATETIME_FORMAT =", "type": "assigned_variable", "loc": [297, 297], "level": 0, "parent": null, "vector": [14, 0, 0.5121, 0.0017, 0, 0.66, 0.5082, 146, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_FORMAT = 'N j, Y, P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L301_C0", "label": "TIME_FORMAT =", "type": "assigned_variable", "loc": [301, 301], "level": 0, "parent": null, "vector": [14, 0, 0.519, 0.0017, 0, 0.66, 0.5164, 662, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_FORMAT = 'P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L306_C0", "label": "YEAR_MONTH_FORMAT =", "type": "assigned_variable", "loc": [306, 306], "level": 0, "parent": null, "vector": [14, 0, 0.5276, 0.0017, 0, 0.66, 0.5246, 693, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "YEAR_MONTH_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "YEAR_MONTH_FORMAT = 'F Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L311_C0", "label": "MONTH_DAY_FORMAT =", "type": "assigned_variable", "loc": [311, 311], "level": 0, "parent": null, "vector": [14, 0, 0.5362, 0.0017, 0, 0.66, 0.5328, 609, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MONTH_DAY_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MONTH_DAY_FORMAT = 'F j'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L315_C0", "label": "SHORT_DATE_FORMAT =", "type": "assigned_variable", "loc": [315, 315], "level": 0, "parent": null, "vector": [14, 0, 0.5431, 0.0017, 0, 0.66, 0.541, 881, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATE_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATE_FORMAT = 'm/d/Y'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L320_C0", "label": "SHORT_DATETIME_FORMAT =", "type": "assigned_variable", "loc": [320, 320], "level": 0, "parent": null, "vector": [14, 0, 0.5517, 0.0017, 0, 0.66, 0.5492, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SHORT_DATETIME_FORMAT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SHORT_DATETIME_FORMAT = 'm/d/Y P'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L326_C0", "label": "DATE_INPUT_FORMATS =", "type": "assigned_variable", "loc": [326, 332], "level": 0, "parent": null, "vector": [14, 0, 0.5672, 0.0121, 0, 0.66, 0.5574, 764, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATE_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATE_INPUT_FORMATS = (\n '%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', # '2006-10-25', '10/25/2006', '10/25/06'\n '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'\n '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'\n '%B %d %Y', '%B %d, %Y', # 'October 25 2006', 'October 25, 2006'\n '%d %B %Y', '%d %B, %Y', # '25 October 2006', '25 October, 2006'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L338_C0", "label": "TIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [338, 341], "level": 0, "parent": null, "vector": [14, 0, 0.5853, 0.0069, 0, 0.66, 0.5656, 416, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "TIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TIME_INPUT_FORMATS = (\n '%H:%M:%S', # '14:30:59'\n '%H:%M', # '14:30'\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L348_C0", "label": "DATETIME_INPUT_FORMATS =", "type": "assigned_variable", "loc": [348, 358], "level": 0, "parent": null, "vector": [14, 0, 0.6086, 0.019, 0, 0.66, 0.5738, 531, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DATETIME_INPUT_FORMATS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATETIME_INPUT_FORMATS = (\n '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59'\n '%Y-%m-%d %H:%M', # '2006-10-25 14:30'\n '%Y-%m-%d', # '2006-10-25'\n '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59'\n '%m/%d/%Y %H:%M', # '10/25/2006 14:30'\n '%m/%d/%Y', # '10/25/2006'\n '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L362_C0", "label": "FIRST_DAY_OF_WEEK =", "type": "assigned_variable", "loc": [362, 362], "level": 0, "parent": null, "vector": [14, 0, 0.6241, 0.0017, 0, 0.66, 0.582, 317, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FIRST_DAY_OF_WEEK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIRST_DAY_OF_WEEK = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L365_C0", "label": "DECIMAL_SEPARATOR =", "type": "assigned_variable", "loc": [365, 365], "level": 0, "parent": null, "vector": [14, 0, 0.6293, 0.0017, 0, 0.66, 0.5902, 357, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DECIMAL_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DECIMAL_SEPARATOR = '.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L368_C0", "label": "USE_THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [368, 368], "level": 0, "parent": null, "vector": [14, 0, 0.6345, 0.0017, 0, 0.66, 0.5984, 444, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "USE_THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "USE_THOUSAND_SEPARATOR = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L372_C0", "label": "NUMBER_GROUPING =", "type": "assigned_variable", "loc": [372, 372], "level": 0, "parent": null, "vector": [14, 0, 0.6414, 0.0017, 0, 0.66, 0.6066, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NUMBER_GROUPING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NUMBER_GROUPING = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L375_C0", "label": "THOUSAND_SEPARATOR =", "type": "assigned_variable", "loc": [375, 375], "level": 0, "parent": null, "vector": [14, 0, 0.6466, 0.0017, 0, 0.66, 0.6148, 316, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "THOUSAND_SEPARATOR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "THOUSAND_SEPARATOR = ','"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L379_C0", "label": "TRANSACTIONS_MANAGED =", "type": "assigned_variable", "loc": [379, 379], "level": 0, "parent": null, "vector": [14, 0, 0.6534, 0.0017, 0, 0.66, 0.623, 695, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "TRANSACTIONS_MANAGED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TRANSACTIONS_MANAGED = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:ImportFrom_L383_C0", "label": "from django import get_version", "type": "import", "loc": [383, 383], "level": 0, "parent": null, "vector": [1, 0, 0.6603, 0.0017, 0, 0.66, 0.6311, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L384_C0", "label": "URL_VALIDATOR_USER_AGENT =", "type": "assigned_variable", "loc": [384, 384], "level": 0, "parent": null, "vector": [14, 0, 0.6621, 0.0017, 0, 0.66, 0.6393, 637, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "URL_VALIDATOR_USER_AGENT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "URL_VALIDATOR_USER_AGENT = \"Django/%s (http://www.djangoproject.com)\" % get_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L387_C0", "label": "DEFAULT_TABLESPACE =", "type": "assigned_variable", "loc": [387, 387], "level": 0, "parent": null, "vector": [14, 0, 0.6672, 0.0017, 0, 0.66, 0.6475, 397, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_TABLESPACE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_TABLESPACE = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L388_C0", "label": "DEFAULT_INDEX_TABLESPACE =", "type": "assigned_variable", "loc": [388, 388], "level": 0, "parent": null, "vector": [14, 0, 0.669, 0.0017, 0, 0.66, 0.6557, 628, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DEFAULT_INDEX_TABLESPACE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_INDEX_TABLESPACE = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L397_C0", "label": "MIDDLEWARE_CLASSES =", "type": "assigned_variable", "loc": [397, 405], "level": 0, "parent": null, "vector": [14, 0, 0.6914, 0.0155, 0, 0.66, 0.6639, 641, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "MIDDLEWARE_CLASSES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n# 'django.middleware.http.ConditionalGetMiddleware',\n# 'django.middleware.gzip.GZipMiddleware',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L411_C0", "label": "SESSION_COOKIE_NAME =", "type": "assigned_variable", "loc": [411, 411], "level": 0, "parent": null, "vector": [14, 0, 0.7086, 0.0017, 0, 0.66, 0.6721, 945, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SESSION_COOKIE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_COOKIE_NAME = 'sessionid' # Cookie name. This can be whatever you want."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L412_C0", "label": "SESSION_COOKIE_AGE =", "type": "assigned_variable", "loc": [412, 412], "level": 0, "parent": null, "vector": [14, 0, 0.7103, 0.0017, 0, 0.66, 0.6803, 209, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "SESSION_COOKIE_AGE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds (default: 2 weeks)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L413_C0", "label": "SESSION_COOKIE_DOMAIN =", "type": "assigned_variable", "loc": [413, 413], "level": 0, "parent": null, "vector": [14, 0, 0.7121, 0.0017, 0, 0.66, 0.6885, 365, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "SESSION_COOKIE_DOMAIN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_COOKIE_DOMAIN = None # A string like \".lawrence.com\", or None for standard domain cookie."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L414_C0", "label": "SESSION_COOKIE_SECURE =", "type": "assigned_variable", "loc": [414, 414], "level": 0, "parent": null, "vector": [14, 0, 0.7138, 0.0017, 0, 0.66, 0.6967, 653, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SESSION_COOKIE_SECURE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_COOKIE_SECURE = False # Whether the session cookie should be secure (https:// only)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L415_C0", "label": "SESSION_COOKIE_PATH =", "type": "assigned_variable", "loc": [415, 415], "level": 0, "parent": null, "vector": [14, 0, 0.7155, 0.0017, 0, 0.66, 0.7049, 438, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SESSION_COOKIE_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_COOKIE_PATH = '/' # The path of the session cookie."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L416_C0", "label": "SESSION_SAVE_EVERY_REQUEST =", "type": "assigned_variable", "loc": [416, 416], "level": 0, "parent": null, "vector": [14, 0, 0.7172, 0.0017, 0, 0.66, 0.7131, 371, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SESSION_SAVE_EVERY_REQUEST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L417_C0", "label": "SESSION_EXPIRE_AT_BROWSER_CLOSE =", "type": "assigned_variable", "loc": [417, 417], "level": 0, "parent": null, "vector": [14, 0, 0.719, 0.0017, 0, 0.66, 0.7213, 617, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "SESSION_EXPIRE_AT_BROWSER_CLOSE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether a user's session cookie expires when the Web browser is closed."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L418_C0", "label": "SESSION_ENGINE =", "type": "assigned_variable", "loc": [418, 418], "level": 0, "parent": null, "vector": [14, 0, 0.7207, 0.0017, 0, 0.66, 0.7295, 359, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SESSION_ENGINE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L419_C0", "label": "SESSION_FILE_PATH =", "type": "assigned_variable", "loc": [419, 419], "level": 0, "parent": null, "vector": [14, 0, 0.7224, 0.0017, 0, 0.66, 0.7377, 100, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "SESSION_FILE_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If None, the backend will use a sensible default."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L427_C0", "label": "CACHE_BACKEND =", "type": "assigned_variable", "loc": [427, 427], "level": 0, "parent": null, "vector": [14, 0, 0.7362, 0.0017, 0, 0.66, 0.7459, 820, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CACHE_BACKEND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CACHE_BACKEND = 'locmem://'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L428_C0", "label": "CACHE_MIDDLEWARE_KEY_PREFIX =", "type": "assigned_variable", "loc": [428, 428], "level": 0, "parent": null, "vector": [14, 0, 0.7379, 0.0017, 0, 0.66, 0.7541, 796, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CACHE_MIDDLEWARE_KEY_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CACHE_MIDDLEWARE_KEY_PREFIX = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L429_C0", "label": "CACHE_MIDDLEWARE_SECONDS =", "type": "assigned_variable", "loc": [429, 429], "level": 0, "parent": null, "vector": [14, 0, 0.7397, 0.0017, 0, 0.66, 0.7623, 881, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CACHE_MIDDLEWARE_SECONDS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CACHE_MIDDLEWARE_SECONDS = 600"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L435_C0", "label": "COMMENTS_ALLOW_PROFANITIES =", "type": "assigned_variable", "loc": [435, 435], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0017, 0, 0.66, 0.7705, 785, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "COMMENTS_ALLOW_PROFANITIES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMMENTS_ALLOW_PROFANITIES = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L439_C0", "label": "PROFANITIES_LIST =", "type": "assigned_variable", "loc": [439, 439], "level": 0, "parent": null, "vector": [14, 0, 0.7569, 0.0017, 0, 0.66, 0.7787, 454, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "PROFANITIES_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PROFANITIES_LIST = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L443_C0", "label": "COMMENTS_BANNED_USERS_GROUP =", "type": "assigned_variable", "loc": [443, 443], "level": 0, "parent": null, "vector": [14, 0, 0.7638, 0.0017, 0, 0.66, 0.7869, 238, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "COMMENTS_BANNED_USERS_GROUP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMMENTS_BANNED_USERS_GROUP = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L447_C0", "label": "COMMENTS_MODERATORS_GROUP =", "type": "assigned_variable", "loc": [447, 447], "level": 0, "parent": null, "vector": [14, 0, 0.7707, 0.0017, 0, 0.66, 0.7951, 619, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "COMMENTS_MODERATORS_GROUP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMMENTS_MODERATORS_GROUP = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L451_C0", "label": "COMMENTS_SKETCHY_USERS_GROUP =", "type": "assigned_variable", "loc": [451, 451], "level": 0, "parent": null, "vector": [14, 0, 0.7776, 0.0017, 0, 0.66, 0.8033, 690, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "COMMENTS_SKETCHY_USERS_GROUP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMMENTS_SKETCHY_USERS_GROUP = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L455_C0", "label": "COMMENTS_FIRST_FEW =", "type": "assigned_variable", "loc": [455, 455], "level": 0, "parent": null, "vector": [14, 0, 0.7845, 0.0017, 0, 0.66, 0.8115, 929, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "COMMENTS_FIRST_FEW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMMENTS_FIRST_FEW = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L459_C0", "label": "BANNED_IPS =", "type": "assigned_variable", "loc": [459, 459], "level": 0, "parent": null, "vector": [14, 0, 0.7914, 0.0017, 0, 0.66, 0.8197, 179, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "BANNED_IPS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BANNED_IPS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L465_C0", "label": "AUTHENTICATION_BACKENDS =", "type": "assigned_variable", "loc": [465, 465], "level": 0, "parent": null, "vector": [14, 0, 0.8017, 0.0017, 0, 0.66, 0.8279, 513, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "AUTHENTICATION_BACKENDS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L467_C0", "label": "LOGIN_URL =", "type": "assigned_variable", "loc": [467, 467], "level": 0, "parent": null, "vector": [14, 0, 0.8052, 0.0017, 0, 0.66, 0.8361, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOGIN_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGIN_URL = '/accounts/login/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L469_C0", "label": "LOGOUT_URL =", "type": "assigned_variable", "loc": [469, 469], "level": 0, "parent": null, "vector": [14, 0, 0.8086, 0.0017, 0, 0.66, 0.8443, 834, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOGOUT_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGOUT_URL = '/accounts/logout/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L471_C0", "label": "LOGIN_REDIRECT_URL =", "type": "assigned_variable", "loc": [471, 471], "level": 0, "parent": null, "vector": [14, 0, 0.8121, 0.0017, 0, 0.66, 0.8525, 901, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOGIN_REDIRECT_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGIN_REDIRECT_URL = '/accounts/profile/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L474_C0", "label": "PASSWORD_RESET_TIMEOUT_DAYS =", "type": "assigned_variable", "loc": [474, 474], "level": 0, "parent": null, "vector": [14, 0, 0.8172, 0.0017, 0, 0.66, 0.8607, 262, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PASSWORD_RESET_TIMEOUT_DAYS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PASSWORD_RESET_TIMEOUT_DAYS = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L482_C0", "label": "CSRF_FAILURE_VIEW =", "type": "assigned_variable", "loc": [482, 482], "level": 0, "parent": null, "vector": [14, 0, 0.831, 0.0017, 0, 0.66, 0.8689, 479, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CSRF_FAILURE_VIEW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L485_C0", "label": "CSRF_COOKIE_NAME =", "type": "assigned_variable", "loc": [485, 485], "level": 0, "parent": null, "vector": [14, 0, 0.8362, 0.0017, 0, 0.66, 0.877, 105, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CSRF_COOKIE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CSRF_COOKIE_NAME = 'csrftoken'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L486_C0", "label": "CSRF_COOKIE_DOMAIN =", "type": "assigned_variable", "loc": [486, 486], "level": 0, "parent": null, "vector": [14, 0, 0.8379, 0.0017, 0, 0.66, 0.8852, 792, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "CSRF_COOKIE_DOMAIN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CSRF_COOKIE_DOMAIN = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L493_C0", "label": "MESSAGE_STORAGE =", "type": "assigned_variable", "loc": [493, 493], "level": 0, "parent": null, "vector": [14, 0, 0.85, 0.0017, 0, 0.66, 0.8934, 74, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MESSAGE_STORAGE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MESSAGE_STORAGE = 'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L503_C0", "label": "LOGGING_CONFIG =", "type": "assigned_variable", "loc": [503, 503], "level": 0, "parent": null, "vector": [14, 0, 0.8672, 0.0017, 0, 0.66, 0.9016, 920, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOGGING_CONFIG", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGGING_CONFIG = 'django.utils.log.dictConfig'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L508_C0", "label": "LOGGING =", "type": "assigned_variable", "loc": [508, 524], "level": 0, "parent": null, "vector": [14, 0, 0.8897, 0.0293, 0, 0.66, 0.9098, 136, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "LOGGING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOGGING = {\n 'version': 1,\n 'disable_existing_loggers': False,\n 'handlers': {\n 'mail_admins': {\n 'level': 'ERROR',\n 'class': 'django.utils.log.AdminEmailHandler'\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L531_C0", "label": "TEST_RUNNER =", "type": "assigned_variable", "loc": [531, 531], "level": 0, "parent": null, "vector": [14, 0, 0.9155, 0.0017, 0, 0.66, 0.918, 533, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TEST_RUNNER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L535_C0", "label": "TEST_DATABASE_NAME =", "type": "assigned_variable", "loc": [535, 535], "level": 0, "parent": null, "vector": [14, 0, 0.9224, 0.0017, 0, 0.66, 0.9262, 28, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "TEST_DATABASE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEST_DATABASE_NAME = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L541_C0", "label": "TEST_DATABASE_CHARSET =", "type": "assigned_variable", "loc": [541, 541], "level": 0, "parent": null, "vector": [14, 0, 0.9328, 0.0017, 0, 0.66, 0.9344, 443, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "TEST_DATABASE_CHARSET", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEST_DATABASE_CHARSET = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L542_C0", "label": "TEST_DATABASE_COLLATION =", "type": "assigned_variable", "loc": [542, 542], "level": 0, "parent": null, "vector": [14, 0, 0.9345, 0.0017, 0, 0.66, 0.9426, 822, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "TEST_DATABASE_COLLATION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TEST_DATABASE_COLLATION = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L549_C0", "label": "FIXTURE_DIRS =", "type": "assigned_variable", "loc": [549, 549], "level": 0, "parent": null, "vector": [14, 0, 0.9466, 0.0017, 0, 0.66, 0.9508, 854, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "FIXTURE_DIRS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FIXTURE_DIRS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L557_C0", "label": "STATICFILES_ROOT =", "type": "assigned_variable", "loc": [557, 557], "level": 0, "parent": null, "vector": [14, 0, 0.9603, 0.0017, 0, 0.66, 0.959, 747, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATICFILES_ROOT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_ROOT = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L561_C0", "label": "STATICFILES_URL =", "type": "assigned_variable", "loc": [561, 561], "level": 0, "parent": null, "vector": [14, 0, 0.9672, 0.0017, 0, 0.66, 0.9672, 133, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATICFILES_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_URL = '/static/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L564_C0", "label": "STATICFILES_DIRS =", "type": "assigned_variable", "loc": [564, 564], "level": 0, "parent": null, "vector": [14, 0, 0.9724, 0.0017, 0, 0.66, 0.9754, 743, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "STATICFILES_DIRS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_DIRS = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L567_C0", "label": "STATICFILES_STORAGE =", "type": "assigned_variable", "loc": [567, 567], "level": 0, "parent": null, "vector": [14, 0, 0.9776, 0.0017, 0, 0.66, 0.9836, 131, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STATICFILES_STORAGE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L571_C0", "label": "STATICFILES_FINDERS =", "type": "assigned_variable", "loc": [571, 575], "level": 0, "parent": null, "vector": [14, 0, 0.9879, 0.0086, 0, 0.66, 0.9918, 94, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "STATICFILES_FINDERS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STATICFILES_FINDERS = (\n 'django.contrib.staticfiles.finders.FileSystemFinder',\n 'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n# 'django.contrib.staticfiles.finders.DefaultStorageFinder',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98980:Assign_L580_C0", "label": "ADMIN_MEDIA_PREFIX =", "type": "assigned_variable", "loc": [580, 580], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0017, 0, 0.66, 1.0, 396, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ADMIN_MEDIA_PREFIX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADMIN_MEDIA_PREFIX = '/static/admin/'"}] | [] |
from django.db import models
# Create your models here.
| ajibawa-2023/Python-Code-Large/train/row_98981 | 1 | 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_98981:ImportFrom_L1_C0", "label": "from django.db import models", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.3333, 0, 0.66, 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"}] | [] |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.failUnlessEqual(1 + 1, 2)
__test__ = {"doctest": """
Another way to test that 1 + 1 is equal to 2.
>>> 1 + 1 == 2
True
"""}
| ajibawa-2023/Python-Code-Large/train/row_98982 | 7 | 23 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_98982:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.1522, 0.2609, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThis file demonstrates two different styles of tests (one doctest and one\nunittest). These will both pass when you run \"manage.py test\".\n\nReplace these with more appropriate tests for your application.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:ImportFrom_L8_C0", "label": "from django.test import TestCase", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.3478, 0.0435, 0, 0.66, 0.3333, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.test", "arg_names": [], "import_names": ["TestCase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.test import TestCase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:ClassDef_L10_C0", "label": "SimpleTest", "type": "class", "loc": [10, 15], "level": 0, "parent": null, "vector": [3, 0, 0.5435, 0.2609, 0, 0.66, 0.6667, 47, 0, 1, 0, 0, 3, 0, 1], "semantic": {"name": "SimpleTest", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleTest(TestCase):\n def test_basic_addition(self):\n \"\"\"\n Tests that 1 + 1 always equals 2.\n \"\"\"\n self.failUnlessEqual(1 + 1, 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4", "label": "test_basic_addition", "type": "function", "loc": [11, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98982:ClassDef_L10_C0", "vector": [2, 1, 0.5652, 0.2174, 1, 0.09, 0.0, 153, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "test_basic_addition", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_basic_addition(self):\n \"\"\"\n Tests that 1 + 1 always equals 2.\n \"\"\"\n self.failUnlessEqual(1 + 1, 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:Expr_L12_C8", "label": "expression", "type": "expression", "loc": [12, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4", "vector": [8, 2, 0.5652, 0.1304, 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 Tests that 1 + 1 always equals 2.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:Expr_L15_C8", "label": "failUnlessEqual()", "type": "expression", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4", "vector": [8, 2, 0.6522, 0.0435, 2, 0.07, 1.0, 21, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "failUnlessEqual", "arg_names": [], "import_names": [], "rhs_call_name": "failUnlessEqual", "annotation": ""}, "snippet": " self.failUnlessEqual(1 + 1, 2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98982:Assign_L17_C0", "label": "__test__ =", "type": "assigned_variable", "loc": [17, 22], "level": 0, "parent": null, "vector": [14, 0, 0.8478, 0.2609, 0, 0.66, 1.0, 761, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "__test__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__test__ = {\"doctest\": \"\"\"\nAnother way to test that 1 + 1 is equal to 2.\n\n>>> 1 + 1 == 2\nTrue\n\"\"\"}"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98982:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98982:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98982:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98982:Expr_L15_C8"}] |
# Create your views here.
| ajibawa-2023/Python-Code-Large/train/row_98983 | 0 | 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"] | [] | [] |
"""
Parser and utilities for the smart 'if' tag
"""
import operator
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase(object):
"""
Base class for operators and literals, mainly for debugging and for throwing
syntax errors.
"""
id = None # node/token type name
value = None # used by literals
first = second = None # used by tree nodes
def nud(self, parser):
# Null denotation - called in prefix context
raise parser.error_class(
"Not expecting '%s' in this position in if tag." % self.id
)
def led(self, left, parser):
# Left denotation - called in infix context
raise parser.error_class(
"Not expecting '%s' as infix operator in if tag." % self.id
)
def display(self):
"""
Returns what to display in error messages for this node
"""
return self.id
def __repr__(self):
out = [str(x) for x in [self.id, self.first, self.second] if x is not None]
return "(" + " ".join(out) + ")"
def infix(bp, func):
"""
Creates an infix operator, given a binding power and a function that
evaluates the node
"""
class Operator(TokenBase):
lbp = bp
def led(self, left, parser):
self.first = left
self.second = parser.expression(bp)
return self
def eval(self, context):
try:
return func(context, self.first, self.second)
except Exception:
# Templates shouldn't throw exceptions when rendering. We are
# most likely to get exceptions for things like {% if foo in bar
# %} where 'bar' does not support 'in', so default to False
return False
return Operator
def prefix(bp, func):
"""
Creates a prefix operator, given a binding power and a function that
evaluates the node.
"""
class Operator(TokenBase):
lbp = bp
def nud(self, parser):
self.first = parser.expression(bp)
self.second = None
return self
def eval(self, context):
try:
return func(context, self.first)
except Exception:
return False
return Operator
# Operator precedence follows Python.
# NB - we can get slightly more accurate syntax error messages by not using the
# same object for '==' and '='.
# We defer variable evaluation to the lambda to ensure that terms are
# lazily evaluated using Python's boolean parsing logic.
OPERATORS = {
'or': infix(6, lambda context, x, y: x.eval(context) or y.eval(context)),
'and': infix(7, lambda context, x, y: x.eval(context) and y.eval(context)),
'not': prefix(8, lambda context, x: not x.eval(context)),
'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)),
'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)),
'=': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
'==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
'!=': infix(10, lambda context, x, y: x.eval(context) != y.eval(context)),
'>': infix(10, lambda context, x, y: x.eval(context) > y.eval(context)),
'>=': infix(10, lambda context, x, y: x.eval(context) >= y.eval(context)),
'<': infix(10, lambda context, x, y: x.eval(context) < y.eval(context)),
'<=': infix(10, lambda context, x, y: x.eval(context) <= y.eval(context)),
}
# Assign 'id' to each:
for key, op in OPERATORS.items():
op.id = key
class Literal(TokenBase):
"""
A basic self-resolvable object similar to a Django template variable.
"""
# IfParser uses Literal in create_var, but TemplateIfParser overrides
# create_var so that a proper implementation that actually resolves
# variables, filters etc is used.
id = "literal"
lbp = 0
def __init__(self, value):
self.value = value
def display(self):
return repr(self.value)
def nud(self, parser):
return self
def eval(self, context):
return self.value
def __repr__(self):
return "(%s %r)" % (self.id, self.value)
class EndToken(TokenBase):
lbp = 0
def nud(self, parser):
raise parser.error_class("Unexpected end of expression in if tag.")
EndToken = EndToken()
class IfParser(object):
error_class = ValueError
def __init__(self, tokens):
# pre-pass necessary to turn 'not','in' into single token
l = len(tokens)
mapped_tokens = []
i = 0
while i < l:
token = tokens[i]
if token == "not" and i + 1 < l and tokens[i+1] == "in":
token = "not in"
i += 1 # skip 'in'
mapped_tokens.append(self.translate_token(token))
i += 1
self.tokens = mapped_tokens
self.pos = 0
self.current_token = self.next()
def translate_token(self, token):
try:
op = OPERATORS[token]
except (KeyError, TypeError):
return self.create_var(token)
else:
return op()
def next(self):
if self.pos >= len(self.tokens):
return EndToken
else:
retval = self.tokens[self.pos]
self.pos += 1
return retval
def parse(self):
retval = self.expression()
# Check that we have exhausted all the tokens
if self.current_token is not EndToken:
raise self.error_class("Unused '%s' at end of if expression." %
self.current_token.display())
return retval
def expression(self, rbp=0):
t = self.current_token
self.current_token = self.next()
left = t.nud(self)
while rbp < self.current_token.lbp:
t = self.current_token
self.current_token = self.next()
left = t.led(left, self)
return left
def create_var(self, value):
return Literal(value)
| ajibawa-2023/Python-Code-Large/train/row_98984 | 101 | 206 | 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_98984:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0097, 0.0146, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nParser and utilities for the smart 'if' tag\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Import_L4_C0", "label": "operator import operator", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0194, 0.0049, 0, 0.66, 0.1, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["operator"], "rhs_call_name": "", "annotation": ""}, "snippet": "import operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "label": "TokenBase", "type": "class", "loc": [12, 41], "level": 0, "parent": null, "vector": [3, 0, 0.1286, 0.1456, 0, 0.66, 0.2, 35, 0, 4, 0, 0, 186, 0, 4], "semantic": {"name": "TokenBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TokenBase(object):\n \"\"\"\n Base class for operators and literals, mainly for debugging and for throwing\n syntax errors.\n \"\"\"\n id = None # node/token type name\n value = None # used by literals\n first = second = None # used by tree nodes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L13_C4", "label": "expression", "type": "expression", "loc": [13, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [8, 1, 0.0704, 0.0194, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Base class for operators and literals, mainly for debugging and for throwing\n syntax errors.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L17_C4", "label": "id =", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [14, 1, 0.0825, 0.0049, 1, 0.62, 0.1429, 941, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id = None # node/token type name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L18_C4", "label": "value =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [14, 1, 0.0874, 0.0049, 1, 0.62, 0.2857, 441, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = None # used by literals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L19_C4", "label": "first =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [14, 1, 0.0922, 0.0049, 1, 0.62, 0.4286, 199, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = second = None # used by tree nodes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L21_C4", "label": "nud", "type": "function", "loc": [21, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [2, 1, 0.1117, 0.0243, 1, 0.62, 0.5714, 624, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "nud", "arg_names": ["self", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nud(self, parser):\n # Null denotation - called in prefix context\n raise parser.error_class(\n \"Not expecting '%s' in this position in if tag.\" % self.id\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L27_C4", "label": "led", "type": "function", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [2, 1, 0.1408, 0.0243, 1, 0.62, 0.7143, 5, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "led", "arg_names": ["self", "left", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def led(self, left, parser):\n # Left denotation - called in infix context\n raise parser.error_class(\n \"Not expecting '%s' as infix operator in if tag.\" % self.id\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4", "label": "display", "type": "function", "loc": [33, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [2, 1, 0.1699, 0.0243, 1, 0.62, 0.8571, 669, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "display", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def display(self):\n \"\"\"\n Returns what to display in error messages for this node\n \"\"\"\n return self.id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L34_C8", "label": "expression", "type": "expression", "loc": [34, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4", "vector": [8, 2, 0.1699, 0.0146, 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 Returns what to display in error messages for this node\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4", "vector": [13, 2, 0.1796, 0.0049, 2, 0.96, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4", "label": "__repr__", "type": "function", "loc": [39, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "vector": [2, 1, 0.1942, 0.0146, 1, 0.62, 1.0, 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 out = [str(x) for x in [self.id, self.first, self.second] if x is not None]\n return \"(\" + \" \".join(out) + \")\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L40_C8", "label": "out =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4", "vector": [14, 2, 0.1942, 0.0049, 2, 0.73, 0.0, 434, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "out", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " out = [str(x) for x in [self.id, self.first, self.second] if x is not None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4", "vector": [13, 2, 0.199, 0.0049, 2, 0.73, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"(\" + \" \".join(out) + \")\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "label": "infix", "type": "function", "loc": [44, 66], "level": 0, "parent": null, "vector": [2, 0, 0.267, 0.1117, 0, 0.66, 0.3, 156, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "infix", "arg_names": ["bp", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def infix(bp, func):\n \"\"\"\n Creates an infix operator, given a binding power and a function that\n evaluates the node\n \"\"\"\n class Operator(TokenBase):\n lbp = bp\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L45_C4", "label": "expression", "type": "expression", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "vector": [8, 1, 0.2257, 0.0194, 1, 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 an infix operator, given a binding power and a function that\n evaluates the node\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "label": "Operator", "type": "class", "loc": [49, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "vector": [3, 1, 0.2743, 0.0777, 1, 0.66, 0.5, 546, 0, 2, 0, 0, 35, 0, 2], "semantic": {"name": "Operator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Operator(TokenBase):\n lbp = bp\n\n def led(self, left, parser):\n self.first = left\n self.second = parser.expression(bp)\n return self\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L50_C8", "label": "lbp =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "vector": [14, 2, 0.2427, 0.0049, 2, 0.83, 0.0, 573, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lbp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lbp = bp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "label": "led", "type": "function", "loc": [52, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "vector": [2, 2, 0.2597, 0.0194, 2, 0.83, 0.5, 5, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "led", "arg_names": ["self", "left", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def led(self, left, parser):\n self.first = left\n self.second = parser.expression(bp)\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L53_C12", "label": "self.first =", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "vector": [14, 3, 0.2573, 0.0049, 3, 0.86, 0.0, 968, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.first = left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L54_C12", "label": "self.second = expression()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "vector": [14, 3, 0.2621, 0.0049, 3, 0.86, 0.5, 374, 3, 1, 0, 0, 657, 10, 1], "semantic": {"name": "self.second", "arg_names": [], "import_names": [], "rhs_call_name": "expression", "annotation": ""}, "snippet": " self.second = parser.expression(bp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L55_C12", "label": "return", "type": "return", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "vector": [13, 3, 0.267, 0.0049, 3, 0.86, 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_98984:FunctionDef_L57_C8", "label": "eval", "type": "function", "loc": [57, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "vector": [2, 2, 0.2937, 0.0388, 2, 0.83, 1.0, 776, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "eval", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eval(self, context):\n try:\n return func(context, self.first, self.second)\n except Exception:\n # Templates shouldn't throw exceptions when rendering. We are\n # most likely to get exceptions for things like {% if foo in bar\n # %} where 'bar' does not support 'in', so default to False\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12", "label": "try", "type": "try", "loc": [58, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L57_C8", "vector": [7, 3, 0.2961, 0.034, 3, 0.49, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return func(context, self.first, self.second)\n except Exception:\n # Templates shouldn't throw exceptions when rendering. We are\n # most likely to get exceptions for things like {% if foo in bar\n # %} where 'bar' does not support 'in', so default to False\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L59_C16", "label": "return", "type": "return", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12", "vector": [13, 4, 0.2864, 0.0049, 4, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return func(context, self.first, self.second)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L64_C16", "label": "return", "type": "return", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12", "vector": [13, 4, 0.3107, 0.0049, 4, 0.83, 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_98984:Return_L66_C4", "label": "return", "type": "return", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "vector": [13, 1, 0.3204, 0.0049, 1, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "label": "prefix", "type": "function", "loc": [69, 88], "level": 0, "parent": null, "vector": [2, 0, 0.3811, 0.0971, 0, 0.66, 0.4, 284, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "prefix", "arg_names": ["bp", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def prefix(bp, func):\n \"\"\"\n Creates a prefix operator, given a binding power and a function that\n evaluates the node.\n \"\"\"\n class Operator(TokenBase):\n lbp = bp\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L70_C4", "label": "expression", "type": "expression", "loc": [70, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "vector": [8, 1, 0.3471, 0.0194, 1, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Creates a prefix operator, given a binding power and a function that\n evaluates the node.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "label": "Operator", "type": "class", "loc": [74, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "vector": [3, 1, 0.3883, 0.0631, 1, 0.49, 0.5, 546, 0, 2, 0, 0, 35, 0, 2], "semantic": {"name": "Operator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Operator(TokenBase):\n lbp = bp\n\n def nud(self, parser):\n self.first = parser.expression(bp)\n self.second = None\n return self\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L75_C8", "label": "lbp =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "vector": [14, 2, 0.3641, 0.0049, 2, 0.0, 0.0, 573, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lbp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lbp = bp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "label": "nud", "type": "function", "loc": [77, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "vector": [2, 2, 0.3811, 0.0194, 2, 0.0, 0.5, 624, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "nud", "arg_names": ["self", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nud(self, parser):\n self.first = parser.expression(bp)\n self.second = None\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L78_C12", "label": "self.first = expression()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "vector": [14, 3, 0.3786, 0.0049, 3, 0.62, 0.0, 968, 3, 1, 0, 0, 657, 10, 1], "semantic": {"name": "self.first", "arg_names": [], "import_names": [], "rhs_call_name": "expression", "annotation": ""}, "snippet": " self.first = parser.expression(bp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L79_C12", "label": "self.second =", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "vector": [14, 3, 0.3835, 0.0049, 3, 0.62, 0.5, 374, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.second", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.second = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L80_C12", "label": "return", "type": "return", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "vector": [13, 3, 0.3883, 0.0049, 3, 0.62, 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_98984:FunctionDef_L82_C8", "label": "eval", "type": "function", "loc": [82, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "vector": [2, 2, 0.4078, 0.0243, 2, 0.0, 1.0, 776, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "eval", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eval(self, context):\n try:\n return func(context, self.first)\n except Exception:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12", "label": "try", "type": "try", "loc": [83, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L82_C8", "vector": [7, 3, 0.4102, 0.0194, 3, 0.3, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return func(context, self.first)\n except Exception:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L84_C16", "label": "return", "type": "return", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12", "vector": [13, 4, 0.4078, 0.0049, 4, 0.44, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return func(context, self.first)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L86_C16", "label": "return", "type": "return", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12", "vector": [13, 4, 0.4175, 0.0049, 4, 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_98984:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "vector": [13, 1, 0.4272, 0.0049, 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 Operator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L96_C0", "label": "OPERATORS =", "type": "assigned_variable", "loc": [96, 109], "level": 0, "parent": null, "vector": [14, 0, 0.4976, 0.068, 0, 0.66, 0.5, 165, 0, 0, 0, 0, 0, 6, 35], "semantic": {"name": "OPERATORS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OPERATORS = {\n 'or': infix(6, lambda context, x, y: x.eval(context) or y.eval(context)),\n 'and': infix(7, lambda context, x, y: x.eval(context) and y.eval(context)),\n 'not': prefix(8, lambda context, x: not x.eval(context)),\n 'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)),\n 'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)),\n '=': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),\n '==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:For_L112_C0", "label": "for key, op", "type": "for", "loc": [112, 113], "level": 0, "parent": null, "vector": [6, 0, 0.5461, 0.0097, 0, 0.66, 0.6, 117, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "key, op", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for key, op in OPERATORS.items():\n op.id = key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L113_C4", "label": "op.id =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:For_L112_C0", "vector": [14, 1, 0.5485, 0.0049, 1, 0.73, 0.0, 258, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "op.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " op.id = key"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "label": "Literal", "type": "class", "loc": [116, 139], "level": 0, "parent": null, "vector": [3, 0, 0.6189, 0.1165, 0, 0.66, 0.7, 566, 0, 5, 0, 0, 35, 0, 1], "semantic": {"name": "Literal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Literal(TokenBase):\n \"\"\"\n A basic self-resolvable object similar to a Django template variable.\n \"\"\"\n # IfParser uses Literal in create_var, but TemplateIfParser overrides\n # create_var so that a proper implementation that actually resolves\n # variables, filters etc is used.\n id = \"literal\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L117_C4", "label": "expression", "type": "expression", "loc": [117, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [8, 1, 0.5728, 0.0146, 1, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A basic self-resolvable object similar to a Django template variable.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L123_C4", "label": "id =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [14, 1, 0.5971, 0.0049, 1, 0.88, 0.1429, 941, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id = \"literal\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L124_C4", "label": "lbp =", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [14, 1, 0.6019, 0.0049, 1, 0.88, 0.2857, 573, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "lbp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lbp = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L126_C4", "label": "__init__", "type": "function", "loc": [126, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [2, 1, 0.6141, 0.0097, 1, 0.88, 0.4286, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, value):\n self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L127_C8", "label": "self.value =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L126_C4", "vector": [14, 2, 0.6165, 0.0049, 2, 0.7, 0.0, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L129_C4", "label": "display", "type": "function", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [2, 1, 0.6286, 0.0097, 1, 0.88, 0.5714, 669, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "display", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def display(self):\n return repr(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L129_C4", "vector": [13, 2, 0.6311, 0.0049, 2, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L132_C4", "label": "nud", "type": "function", "loc": [132, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [2, 1, 0.6432, 0.0097, 1, 0.88, 0.7143, 624, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "nud", "arg_names": ["self", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nud(self, parser):\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L132_C4", "vector": [13, 2, 0.6456, 0.0049, 2, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L135_C4", "label": "eval", "type": "function", "loc": [135, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [2, 1, 0.6578, 0.0097, 1, 0.88, 0.8571, 776, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "eval", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def eval(self, context):\n return self.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L135_C4", "vector": [13, 2, 0.6602, 0.0049, 2, 0.59, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L138_C4", "label": "__repr__", "type": "function", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "vector": [2, 1, 0.6723, 0.0097, 1, 0.88, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return \"(%s %r)\" % (self.id, self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L138_C4", "vector": [13, 2, 0.6748, 0.0049, 2, 0.76, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"(%s %r)\" % (self.id, self.value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L142_C0", "label": "EndToken", "type": "class", "loc": [142, 146], "level": 0, "parent": null, "vector": [3, 0, 0.699, 0.0243, 0, 0.66, 0.8, 371, 0, 1, 0, 0, 35, 0, 1], "semantic": {"name": "EndToken", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EndToken(TokenBase):\n lbp = 0\n\n def nud(self, parser):\n raise parser.error_class(\"Unexpected end of expression in if tag.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L143_C4", "label": "lbp =", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L142_C0", "vector": [14, 1, 0.6942, 0.0049, 1, 0.97, 0.0, 573, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "lbp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lbp = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L145_C4", "label": "nud", "type": "function", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L142_C0", "vector": [2, 1, 0.7063, 0.0097, 1, 0.97, 1.0, 624, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "nud", "arg_names": ["self", "parser"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nud(self, parser):\n raise parser.error_class(\"Unexpected end of expression in if tag.\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L148_C0", "label": "EndToken = EndToken()", "type": "assigned_variable", "loc": [148, 148], "level": 0, "parent": null, "vector": [14, 0, 0.7184, 0.0049, 0, 0.66, 0.9, 371, 3, 0, 0, 0, 371, 10, 1], "semantic": {"name": "EndToken", "arg_names": [], "import_names": [], "rhs_call_name": "EndToken", "annotation": ""}, "snippet": "EndToken = EndToken()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "label": "IfParser", "type": "class", "loc": [151, 206], "level": 0, "parent": null, "vector": [3, 0, 0.8665, 0.2718, 0, 0.66, 1.0, 730, 0, 6, 0, 0, 186, 0, 15], "semantic": {"name": "IfParser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IfParser(object):\n error_class = ValueError\n\n def __init__(self, tokens):\n # pre-pass necessary to turn 'not','in' into single token\n l = len(tokens)\n mapped_tokens = []\n i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L152_C4", "label": "error_class =", "type": "assigned_variable", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [14, 1, 0.7379, 0.0049, 1, 0.8, 0.0, 541, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_class = ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "label": "__init__", "type": "function", "loc": [154, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.784, 0.0777, 1, 0.8, 0.1667, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "tokens"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, tokens):\n # pre-pass necessary to turn 'not','in' into single token\n l = len(tokens)\n mapped_tokens = []\n i = 0\n while i < l:\n token = tokens[i]\n if token == \"not\" and i + 1 < l and tokens[i+1] == \"in\":"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L156_C8", "label": "l = len()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.7573, 0.0049, 2, 0.24, 0.0, 810, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "l", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " l = len(tokens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L157_C8", "label": "mapped_tokens =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.7621, 0.0049, 2, 0.24, 0.1667, 503, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "mapped_tokens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mapped_tokens = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L158_C8", "label": "i =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.767, 0.0049, 2, 0.24, 0.3333, 826, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " i = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "label": "while", "type": "while", "loc": [159, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [5, 2, 0.7864, 0.034, 2, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while i < l:\n token = tokens[i]\n if token == \"not\" and i + 1 < l and tokens[i+1] == \"in\":\n token = \"not in\"\n i += 1 # skip 'in'\n mapped_tokens.append(self.translate_token(token))\n i += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L160_C12", "label": "token =", "type": "assigned_variable", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "vector": [14, 3, 0.7767, 0.0049, 3, 0.92, 0.0, 129, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token = tokens[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L161_C12", "label": "if", "type": "if", "loc": [161, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "vector": [4, 3, 0.7864, 0.0146, 3, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token == \"not\" and i + 1 < l and tokens[i+1] == \"in\":\n token = \"not in\"\n i += 1 # skip 'in'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L162_C16", "label": "token =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L161_C12", "vector": [14, 4, 0.7864, 0.0049, 4, 0.63, 0.0, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " token = \"not in\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L164_C12", "label": "append()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "vector": [8, 3, 0.7961, 0.0049, 3, 0.92, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " mapped_tokens.append(self.translate_token(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L167_C8", "label": "self.tokens =", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.8107, 0.0049, 2, 0.24, 0.6667, 128, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.tokens", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tokens = mapped_tokens"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L168_C8", "label": "self.pos =", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.8155, 0.0049, 2, 0.24, 0.8333, 283, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.pos", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pos = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L169_C8", "label": "self.current_token = next()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "vector": [14, 2, 0.8204, 0.0049, 2, 0.24, 1.0, 274, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "self.current_token", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " self.current_token = self.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L171_C4", "label": "translate_token", "type": "function", "loc": [171, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.8447, 0.034, 1, 0.8, 0.3333, 788, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "translate_token", "arg_names": ["self", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def translate_token(self, token):\n try:\n op = OPERATORS[token]\n except (KeyError, TypeError):\n return self.create_var(token)\n else:\n return op()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "label": "try", "type": "try", "loc": [172, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L171_C4", "vector": [7, 2, 0.8471, 0.0291, 2, 0.28, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n op = OPERATORS[token]\n except (KeyError, TypeError):\n return self.create_var(token)\n else:\n return op()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L173_C12", "label": "op =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "vector": [14, 3, 0.8398, 0.0049, 3, 0.47, 0.0, 316, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "op", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " op = OPERATORS[token]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L175_C12", "label": "return", "type": "return", "loc": [175, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "vector": [13, 3, 0.8495, 0.0049, 3, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.create_var(token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L177_C12", "label": "return", "type": "return", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "vector": [13, 3, 0.8592, 0.0049, 3, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return op()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L179_C4", "label": "next", "type": "function", "loc": [179, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.8835, 0.034, 1, 0.8, 0.5, 11, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "next", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def next(self):\n if self.pos >= len(self.tokens):\n return EndToken\n else:\n retval = self.tokens[self.pos]\n self.pos += 1\n return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "label": "if", "type": "if", "loc": [180, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L179_C4", "vector": [4, 2, 0.8859, 0.0291, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.pos >= len(self.tokens):\n return EndToken\n else:\n retval = self.tokens[self.pos]\n self.pos += 1\n return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L181_C12", "label": "return", "type": "return", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "vector": [13, 3, 0.8786, 0.0049, 3, 0.94, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EndToken"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L183_C12", "label": "retval =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "vector": [14, 3, 0.8883, 0.0049, 3, 0.94, 0.5, 991, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " retval = self.tokens[self.pos]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L185_C12", "label": "return", "type": "return", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "vector": [13, 3, 0.8981, 0.0049, 3, 0.94, 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_98984:FunctionDef_L187_C4", "label": "parse", "type": "function", "loc": [187, 193], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.9223, 0.034, 1, 0.8, 0.6667, 678, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "parse", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def parse(self):\n retval = self.expression()\n # Check that we have exhausted all the tokens\n if self.current_token is not EndToken:\n raise self.error_class(\"Unused '%s' at end of if expression.\" %\n self.current_token.display())\n return retval"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L188_C8", "label": "retval = expression()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "vector": [14, 2, 0.9126, 0.0049, 2, 0.94, 0.0, 991, 3, 0, 0, 0, 657, 10, 1], "semantic": {"name": "retval", "arg_names": [], "import_names": [], "rhs_call_name": "expression", "annotation": ""}, "snippet": " retval = self.expression()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L190_C8", "label": "if", "type": "if", "loc": [190, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "vector": [4, 2, 0.9272, 0.0146, 2, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_token is not EndToken:\n raise self.error_class(\"Unused '%s' at end of if expression.\" %\n self.current_token.display())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L193_C8", "label": "return", "type": "return", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "vector": [13, 2, 0.9369, 0.0049, 2, 0.94, 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_98984:FunctionDef_L195_C4", "label": "expression", "type": "function", "loc": [195, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.966, 0.0437, 1, 0.8, 0.8333, 657, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "expression", "arg_names": ["self", "rbp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def expression(self, rbp=0):\n t = self.current_token\n self.current_token = self.next()\n left = t.nud(self)\n while rbp < self.current_token.lbp:\n t = self.current_token\n self.current_token = self.next()\n left = t.led(left, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L196_C8", "label": "t =", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "vector": [14, 2, 0.9515, 0.0049, 2, 0.92, 0.0, 15, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = self.current_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L197_C8", "label": "self.current_token = next()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "vector": [14, 2, 0.9563, 0.0049, 2, 0.92, 0.25, 274, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "self.current_token", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " self.current_token = self.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L198_C8", "label": "left = nud()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "vector": [14, 2, 0.9612, 0.0049, 2, 0.92, 0.5, 605, 3, 1, 0, 0, 624, 10, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "nud", "annotation": ""}, "snippet": " left = t.nud(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "label": "while", "type": "while", "loc": [199, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "vector": [5, 2, 0.9733, 0.0194, 2, 0.92, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while rbp < self.current_token.lbp:\n t = self.current_token\n self.current_token = self.next()\n left = t.led(left, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L200_C12", "label": "t =", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "vector": [14, 3, 0.9709, 0.0049, 3, 0.02, 0.0, 15, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " t = self.current_token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L201_C12", "label": "self.current_token = next()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "vector": [14, 3, 0.9757, 0.0049, 3, 0.02, 0.5, 274, 3, 0, 0, 0, 11, 10, 1], "semantic": {"name": "self.current_token", "arg_names": [], "import_names": [], "rhs_call_name": "next", "annotation": ""}, "snippet": " self.current_token = self.next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L202_C12", "label": "left = led()", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "vector": [14, 3, 0.9806, 0.0049, 3, 0.02, 1.0, 605, 3, 2, 0, 0, 5, 10, 1], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "led", "annotation": ""}, "snippet": " left = t.led(left, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "vector": [13, 2, 0.9854, 0.0049, 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 left"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L205_C4", "label": "create_var", "type": "function", "loc": [205, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "vector": [2, 1, 0.9976, 0.0097, 1, 0.8, 1.0, 918, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "create_var", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_var(self, value):\n return Literal(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L206_C8", "label": "return", "type": "return", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L205_C4", "vector": [13, 2, 1.0, 0.0049, 2, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Literal(value)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L58_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L86_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L69_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:For_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L161_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L162_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L175_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:Try_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L180_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:If_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:While_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:ClassDef_L151_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98984:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98984:Return_L206_C8"}] |
"""
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_origin
from django.utils.hashcompat import sha_constructor
from django.utils.importlib import import_module
class Loader(BaseLoader):
is_usable = True
def __init__(self, loaders):
self.template_cache = {}
self._loaders = loaders
self._cached_loaders = []
@property
def loaders(self):
# Resolve loaders on demand to avoid circular imports
if not self._cached_loaders:
for loader in self._loaders:
self._cached_loaders.append(find_template_loader(loader))
return self._cached_loaders
def find_template(self, name, dirs=None):
for loader in self.loaders:
try:
template, display_name = loader(name, dirs)
return (template, make_origin(display_name, loader, name, dirs))
except TemplateDoesNotExist:
pass
raise TemplateDoesNotExist(name)
def load_template(self, template_name, template_dirs=None):
key = template_name
if template_dirs:
# If template directories were specified, use a hash to differentiate
key = '-'.join([template_name, sha_constructor('|'.join(template_dirs)).hexdigest()])
if key not in self.template_cache:
template, origin = self.find_template(template_name, template_dirs)
if not hasattr(template, 'render'):
try:
template = get_template_from_string(template, origin, template_name)
except TemplateDoesNotExist:
# If compiling the template we found raises TemplateDoesNotExist,
# back off to returning the source and display name for the template
# we were asked to load. This allows for correct identification (later)
# of the actual template that does not exist.
return template, origin
self.template_cache[key] = template
return self.template_cache[key], None
def reset(self):
"Empty the template cache."
self.template_cache.clear()
| ajibawa-2023/Python-Code-Large/train/row_98985 | 37 | 59 | 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_98985:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0424, 0.0678, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nWrapper class that takes a list of template loaders as an argument and attempts\nto load templates from them in order, caching the result.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:ImportFrom_L6_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1017, 0.0169, 0, 0.66, 0.1667, 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_98985:ImportFrom_L7_C0", "label": "from django.template import TemplateDoesNotExist", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1186, 0.0169, 0, 0.66, 0.3333, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["TemplateDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import TemplateDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:ImportFrom_L8_C0", "label": "from django.template.loader import BaseLoader, get_template_from_string, find_template_loader\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1356, 0.0169, 0, 0.66, 0.5, 970, 0, 4, 0, 0, 970, 0, 0], "semantic": {"name": "django.template.loader", "arg_names": [], "import_names": ["BaseLoader", "get_template_from_string", "find_template_loader", "make_origin"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_origin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:ImportFrom_L9_C0", "label": "from django.utils.hashcompat import sha_constructor", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1525, 0.0169, 0, 0.66, 0.6667, 474, 0, 1, 0, 0, 474, 0, 0], "semantic": {"name": "django.utils.hashcompat", "arg_names": [], "import_names": ["sha_constructor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.hashcompat import sha_constructor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:ImportFrom_L10_C0", "label": "from django.utils.importlib import import_module", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1695, 0.0169, 0, 0.66, 0.8333, 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_98985:ClassDef_L12_C0", "label": "Loader", "type": "class", "loc": [12, 59], "level": 0, "parent": null, "vector": [3, 0, 0.6017, 0.8136, 0, 0.66, 1.0, 739, 0, 5, 0, 0, 461, 0, 13], "semantic": {"name": "Loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Loader(BaseLoader):\n is_usable = True\n\n def __init__(self, loaders):\n self.template_cache = {}\n self._loaders = loaders\n self._cached_loaders = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L13_C4", "label": "is_usable =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [14, 1, 0.2203, 0.0169, 1, 0.84, 0.0, 275, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_usable = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [2, 1, 0.2797, 0.0678, 1, 0.84, 0.2, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "loaders"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, loaders):\n self.template_cache = {}\n self._loaders = loaders\n self._cached_loaders = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L16_C8", "label": "self.template_cache =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "vector": [14, 2, 0.2712, 0.0169, 2, 0.89, 0.0, 391, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.template_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.template_cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L17_C8", "label": "self._loaders =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "vector": [14, 2, 0.2881, 0.0169, 2, 0.89, 0.5, 412, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._loaders", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._loaders = loaders"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L18_C8", "label": "self._cached_loaders =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "vector": [14, 2, 0.3051, 0.0169, 2, 0.89, 1.0, 361, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._cached_loaders", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._cached_loaders = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4", "label": "loaders", "type": "function", "loc": [21, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [2, 1, 0.3983, 0.1017, 1, 0.84, 0.4, 298, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "loaders", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def loaders(self):\n # Resolve loaders on demand to avoid circular imports\n if not self._cached_loaders:\n for loader in self._loaders:\n self._cached_loaders.append(find_template_loader(loader))\n return self._cached_loaders"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L23_C8", "label": "if", "type": "if", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4", "vector": [4, 2, 0.4068, 0.0508, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._cached_loaders:\n for loader in self._loaders:\n self._cached_loaders.append(find_template_loader(loader))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L24_C12", "label": "for loader", "type": "for", "loc": [24, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L23_C8", "vector": [6, 3, 0.4153, 0.0339, 3, 0.01, 0.0, 368, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loader in self._loaders:\n self._cached_loaders.append(find_template_loader(loader))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L25_C16", "label": "append()", "type": "expression", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L24_C12", "vector": [8, 4, 0.4237, 0.0169, 4, 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": " self._cached_loaders.append(find_template_loader(loader))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L26_C8", "label": "return", "type": "return", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4", "vector": [13, 2, 0.4407, 0.0169, 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._cached_loaders"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L28_C4", "label": "find_template", "type": "function", "loc": [28, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [2, 1, 0.5339, 0.1356, 1, 0.84, 0.6, 521, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "find_template", "arg_names": ["self", "name", "dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_template(self, name, dirs=None):\n for loader in self.loaders:\n try:\n template, display_name = loader(name, dirs)\n return (template, make_origin(display_name, loader, name, dirs))\n except TemplateDoesNotExist:\n pass\n raise TemplateDoesNotExist(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L29_C8", "label": "for loader", "type": "for", "loc": [29, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L28_C4", "vector": [6, 2, 0.5339, 0.1017, 2, 0.62, 0.0, 368, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for loader in self.loaders:\n try:\n template, display_name = loader(name, dirs)\n return (template, make_origin(display_name, loader, name, dirs))\n except TemplateDoesNotExist:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12", "label": "try", "type": "try", "loc": [30, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L29_C8", "vector": [7, 3, 0.5424, 0.0847, 3, 0.76, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n template, display_name = loader(name, dirs)\n return (template, make_origin(display_name, loader, name, dirs))\n except TemplateDoesNotExist:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L31_C16", "label": "template, display_name = loader()", "type": "assigned_variable", "loc": [31, 31], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12", "vector": [14, 4, 0.5254, 0.0169, 4, 0.55, 0.0, 906, 3, 2, 0, 0, 368, 10, 1], "semantic": {"name": "template, display_name", "arg_names": [], "import_names": [], "rhs_call_name": "loader", "annotation": ""}, "snippet": " template, display_name = loader(name, dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L32_C16", "label": "return", "type": "return", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12", "vector": [13, 4, 0.5424, 0.0169, 4, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (template, make_origin(display_name, loader, name, dirs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "label": "load_template", "type": "function", "loc": [37, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [2, 1, 0.7797, 0.322, 1, 0.84, 0.8, 24, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "load_template", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_template(self, template_name, template_dirs=None):\n key = template_name\n if template_dirs:\n # If template directories were specified, use a hash to differentiate\n key = '-'.join([template_name, sha_constructor('|'.join(template_dirs)).hexdigest()])\n\n if key not in self.template_cache:\n template, origin = self.find_template(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L38_C8", "label": "key =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "vector": [14, 2, 0.6441, 0.0169, 2, 0.65, 0.0, 230, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = template_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L39_C8", "label": "if", "type": "if", "loc": [39, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "vector": [4, 2, 0.678, 0.0508, 2, 0.65, 0.3333, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if template_dirs:\n # If template directories were specified, use a hash to differentiate\n key = '-'.join([template_name, sha_constructor('|'.join(template_dirs)).hexdigest()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L41_C12", "label": "key = join()", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L39_C8", "vector": [14, 3, 0.6949, 0.0169, 3, 0.32, 0.0, 230, 3, 1, 0, 0, 933, 10, 4], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " key = '-'.join([template_name, sha_constructor('|'.join(template_dirs)).hexdigest()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "label": "if", "type": "if", "loc": [43, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "vector": [4, 2, 0.822, 0.2034, 2, 0.65, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in self.template_cache:\n template, origin = self.find_template(template_name, template_dirs)\n if not hasattr(template, 'render'):\n try:\n template = get_template_from_string(template, origin, template_name)\n except TemplateDoesNotExist:\n # If compiling the template we found raises TemplateDoesNotExist,\n # back off to returning the source and display name for the template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L44_C12", "label": "template, origin = find_template()", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "vector": [14, 3, 0.7458, 0.0169, 3, 0.98, 0.0, 265, 3, 2, 0, 0, 521, 10, 1], "semantic": {"name": "template, origin", "arg_names": [], "import_names": [], "rhs_call_name": "find_template", "annotation": ""}, "snippet": " template, origin = self.find_template(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L45_C12", "label": "if", "type": "if", "loc": [45, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "vector": [4, 3, 0.8305, 0.1525, 3, 0.98, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(template, 'render'):\n try:\n template = get_template_from_string(template, origin, template_name)\n except TemplateDoesNotExist:\n # If compiling the template we found raises TemplateDoesNotExist,\n # back off to returning the source and display name for the template\n # we were asked to load. This allows for correct identification (later)\n # of the actual template that does not exist."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16", "label": "try", "type": "try", "loc": [46, 53], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L45_C12", "vector": [7, 4, 0.839, 0.1356, 4, 0.72, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n template = get_template_from_string(template, origin, template_name)\n except TemplateDoesNotExist:\n # If compiling the template we found raises TemplateDoesNotExist,\n # back off to returning the source and display name for the template\n # we were asked to load. This allows for correct identification (later)\n # of the actual template that does not exist.\n return template, origin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L47_C20", "label": "template = get_template_from_string()", "type": "assigned_variable", "loc": [47, 47], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16", "vector": [14, 5, 0.7966, 0.0169, 5, 0.94, 0.0, 549, 3, 3, 0, 0, 813, 10, 1], "semantic": {"name": "template", "arg_names": [], "import_names": [], "rhs_call_name": "get_template_from_string", "annotation": ""}, "snippet": " template = get_template_from_string(template, origin, template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L53_C20", "label": "return", "type": "return", "loc": [53, 53], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16", "vector": [13, 5, 0.8983, 0.0169, 5, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return template, origin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L54_C12", "label": "assign", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "vector": [14, 3, 0.9153, 0.0169, 3, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.template_cache[key] = template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "vector": [13, 2, 0.9322, 0.0169, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.template_cache[key], None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4", "label": "reset", "type": "function", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "vector": [2, 1, 0.9831, 0.0508, 1, 0.84, 1.0, 944, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n \"Empty the template cache.\"\n self.template_cache.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L58_C8", "label": "expression", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4", "vector": [8, 2, 0.9831, 0.0169, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Empty the template cache.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L59_C8", "label": "clear()", "type": "expression", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4", "vector": [8, 2, 1.0, 0.0169, 2, 0.21, 1.0, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " self.template_cache.clear()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:For_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L31_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L32_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L47_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:Try_L46_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L53_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98985:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98985:Expr_L59_C8"}] |
# Wrapper for loading templates from eggs via pkg_resources.resource_string.
try:
from pkg_resources import resource_string
except ImportError:
resource_string = None
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.conf import settings
class Loader(BaseLoader):
is_usable = resource_string is not None
def load_template_source(self, template_name, template_dirs=None):
"""
Loads templates from Python eggs via pkg_resource.resource_string.
For every installed app, it tries to get the resource (app, template_name).
"""
if resource_string is not None:
pkg_name = 'templates/' + template_name
for app in settings.INSTALLED_APPS:
try:
return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))
except:
pass
raise TemplateDoesNotExist(template_name)
_loader = Loader()
def load_template_source(template_name, template_dirs=None):
import warnings
warnings.warn(
"'django.template.loaders.eggs.load_template_source' is deprecated; use 'django.template.loaders.eggs.Loader' instead.",
DeprecationWarning
)
return _loader.load_template_source(template_name, template_dirs)
load_template_source.is_usable = resource_string is not None
| ajibawa-2023/Python-Code-Large/train/row_98986 | 21 | 39 | 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_98986:Try_L3_C0", "label": "try", "type": "try", "loc": [3, 6], "level": 0, "parent": null, "vector": [7, 0, 0.1154, 0.1026, 0, 0.66, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from pkg_resources import resource_string\nexcept ImportError:\n resource_string = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:ImportFrom_L4_C4", "label": "from pkg_resources import resource_string", "type": "import", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L3_C0", "vector": [1, 1, 0.1026, 0.0256, 1, 0.76, 0.0, 947, 0, 1, 0, 0, 947, 0, 0], "semantic": {"name": "pkg_resources", "arg_names": [], "import_names": ["resource_string"], "rhs_call_name": "", "annotation": ""}, "snippet": " from pkg_resources import resource_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L6_C4", "label": "resource_string =", "type": "assigned_variable", "loc": [6, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L3_C0", "vector": [14, 1, 0.1538, 0.0256, 1, 0.76, 0.0, 814, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "resource_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " resource_string = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:ImportFrom_L8_C0", "label": "from django.template import TemplateDoesNotExist", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2051, 0.0256, 0, 0.66, 0.1429, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["TemplateDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import TemplateDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:ImportFrom_L9_C0", "label": "from django.template.loader import BaseLoader", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2308, 0.0256, 0, 0.66, 0.2857, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "django.template.loader", "arg_names": [], "import_names": ["BaseLoader"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template.loader import BaseLoader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:ImportFrom_L10_C0", "label": "from django.conf import settings", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2564, 0.0256, 0, 0.66, 0.4286, 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_98986:ClassDef_L12_C0", "label": "Loader", "type": "class", "loc": [12, 28], "level": 0, "parent": null, "vector": [3, 0, 0.5128, 0.4359, 0, 0.66, 0.5714, 739, 0, 1, 0, 0, 461, 0, 3], "semantic": {"name": "Loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Loader(BaseLoader):\n is_usable = resource_string is not None\n\n def load_template_source(self, template_name, template_dirs=None):\n \"\"\"\n Loads templates from Python eggs via pkg_resource.resource_string.\n\n For every installed app, it tries to get the resource (app, template_name)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L13_C4", "label": "is_usable =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:ClassDef_L12_C0", "vector": [14, 1, 0.3333, 0.0256, 1, 0.11, 0.0, 275, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_usable = resource_string is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4", "label": "load_template_source", "type": "function", "loc": [15, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:ClassDef_L12_C0", "vector": [2, 1, 0.5513, 0.359, 1, 0.11, 1.0, 521, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "load_template_source", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_template_source(self, template_name, template_dirs=None):\n \"\"\"\n Loads templates from Python eggs via pkg_resource.resource_string.\n\n For every installed app, it tries to get the resource (app, template_name).\n \"\"\"\n if resource_string is not None:\n pkg_name = 'templates/' + template_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Expr_L16_C8", "label": "expression", "type": "expression", "loc": [16, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4", "vector": [8, 2, 0.4615, 0.1282, 2, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Loads templates from Python eggs via pkg_resource.resource_string.\n\n For every installed app, it tries to get the resource (app, template_name).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8", "label": "if", "type": "if", "loc": [21, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4", "vector": [4, 2, 0.6154, 0.1795, 2, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resource_string is not None:\n pkg_name = 'templates/' + template_name\n for app in settings.INSTALLED_APPS:\n try:\n return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L22_C12", "label": "pkg_name =", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8", "vector": [14, 3, 0.5641, 0.0256, 3, 0.43, 0.0, 485, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pkg_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pkg_name = 'templates/' + template_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:For_L23_C12", "label": "for app", "type": "for", "loc": [23, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8", "vector": [6, 3, 0.641, 0.1282, 3, 0.43, 1.0, 494, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app in settings.INSTALLED_APPS:\n try:\n return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L24_C16", "label": "try", "type": "try", "loc": [24, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:For_L23_C12", "vector": [7, 4, 0.6538, 0.1026, 4, 0.04, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Return_L25_C20", "label": "return", "type": "return", "loc": [25, 25], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L24_C16", "vector": [13, 5, 0.641, 0.0256, 5, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (resource_string(app, pkg_name).decode(settings.FILE_CHARSET), 'egg:%s:%s' % (app, pkg_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L30_C0", "label": "_loader = Loader()", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.7692, 0.0256, 0, 0.66, 0.7143, 384, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "_loader", "arg_names": [], "import_names": [], "rhs_call_name": "Loader", "annotation": ""}, "snippet": "_loader = Loader()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "label": "load_template_source", "type": "function", "loc": [32, 38], "level": 0, "parent": null, "vector": [2, 0, 0.8974, 0.1795, 0, 0.66, 0.8571, 521, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "load_template_source", "arg_names": ["template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_template_source(template_name, template_dirs=None):\n import warnings\n warnings.warn(\n \"'django.template.loaders.eggs.load_template_source' is deprecated; use 'django.template.loaders.eggs.Loader' instead.\",\n DeprecationWarning\n )\n return _loader.load_template_source(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Import_L33_C4", "label": "warnings import warnings", "type": "import", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "vector": [1, 1, 0.8462, 0.0256, 1, 0.77, 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_98986:Expr_L34_C4", "label": "warn()", "type": "expression", "loc": [34, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "vector": [8, 1, 0.9103, 0.1026, 1, 0.77, 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 \"'django.template.loaders.eggs.load_template_source' is deprecated; use 'django.template.loaders.eggs.Loader' instead.\",\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Return_L38_C4", "label": "return", "type": "return", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "vector": [13, 1, 0.9744, 0.0256, 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 _loader.load_template_source(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L39_C0", "label": "load_template_source.is_usable =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0256, 0, 0.66, 1.0, 464, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "load_template_source.is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "load_template_source.is_usable = resource_string is not None"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:For_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:For_L23_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:Try_L24_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Return_L25_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Import_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98986:FunctionDef_L32_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98986:Return_L38_C4"}] |
"""
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
from django.utils.importlib import import_module
# At compile time, cache the directories to search.
fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
app_template_dirs = []
for app in settings.INSTALLED_APPS:
try:
mod = import_module(app)
except ImportError, e:
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
template_dir = os.path.join(os.path.dirname(mod.__file__), 'templates')
if os.path.isdir(template_dir):
app_template_dirs.append(template_dir.decode(fs_encoding))
# It won't change, so convert it to a tuple to save memory.
app_template_dirs = tuple(app_template_dirs)
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, template_name, template_dirs=None):
"""
Returns the absolute paths to "template_name", when appended to each
directory in "template_dirs". Any paths that don't lie inside one of the
template dirs are excluded from the result set, for security reasons.
"""
if not template_dirs:
template_dirs = app_template_dirs
for template_dir in template_dirs:
try:
yield safe_join(template_dir, template_name)
except UnicodeDecodeError:
# The template dir name was a bytestring that wasn't valid UTF-8.
raise
except ValueError:
# The joined path was located outside of template_dir.
pass
def load_template_source(self, template_name, template_dirs=None):
for filepath in self.get_template_sources(template_name, template_dirs):
try:
file = open(filepath)
try:
return (file.read().decode(settings.FILE_CHARSET), filepath)
finally:
file.close()
except IOError:
pass
raise TemplateDoesNotExist(template_name)
_loader = Loader()
def load_template_source(template_name, template_dirs=None):
# For backwards compatibility
import warnings
warnings.warn(
"'django.template.loaders.app_directories.load_template_source' is deprecated; use 'django.template.loaders.app_directories.Loader' instead.",
DeprecationWarning
)
return _loader.load_template_source(template_name, template_dirs)
load_template_source.is_usable = True
| ajibawa-2023/Python-Code-Large/train/row_98987 | 28 | 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_98987:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0196, 0.0196, 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_98987:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0392, 0.0196, 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_98987:ImportFrom_L4_C0", "label": "from django.conf import settings", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0784, 0.0196, 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_98987:ImportFrom_L5_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.098, 0.0196, 0, 0.66, 0.3333, 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_98987:ImportFrom_L6_C0", "label": "from django.template import TemplateDoesNotExist", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0196, 0, 0.66, 0.4444, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["TemplateDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import TemplateDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:ImportFrom_L7_C0", "label": "from django.template.loader import BaseLoader", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1373, 0.0196, 0, 0.66, 0.5556, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "django.template.loader", "arg_names": [], "import_names": ["BaseLoader"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template.loader import BaseLoader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:ImportFrom_L8_C0", "label": "from django.utils._os import safe_join", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1569, 0.0196, 0, 0.66, 0.6667, 656, 0, 1, 0, 0, 656, 0, 0], "semantic": {"name": "django.utils._os", "arg_names": [], "import_names": ["safe_join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils._os import safe_join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:ImportFrom_L9_C0", "label": "from django.utils.importlib import import_module", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0196, 0, 0.66, 0.7778, 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_98987:ClassDef_L11_C0", "label": "Loader", "type": "class", "loc": [11, 42], "level": 0, "parent": null, "vector": [3, 0, 0.5196, 0.6275, 0, 0.66, 0.8889, 739, 0, 2, 0, 0, 461, 0, 7], "semantic": {"name": "Loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Loader(BaseLoader):\n is_usable = True\n\n def get_template_sources(self, template_name, template_dirs=None):\n \"\"\"\n Returns the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L12_C4", "label": "is_usable =", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "vector": [14, 1, 0.2353, 0.0196, 1, 0.74, 0.0, 275, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_usable = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "label": "get_template_sources", "type": "function", "loc": [14, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "vector": [2, 1, 0.4314, 0.3333, 1, 0.74, 0.5, 281, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "get_template_sources", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_template_sources(self, template_name, template_dirs=None):\n \"\"\"\n Returns the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons.\n \"\"\"\n if not template_dirs:\n template_dirs = app_template_dirs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L15_C8", "label": "expression", "type": "expression", "loc": [15, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "vector": [8, 2, 0.3333, 0.098, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:If_L20_C8", "label": "if", "type": "if", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "vector": [4, 2, 0.402, 0.0392, 2, 0.05, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not template_dirs:\n template_dirs = app_template_dirs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L21_C12", "label": "template_dirs =", "type": "assigned_variable", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:If_L20_C8", "vector": [14, 3, 0.4118, 0.0196, 3, 0.09, 0.0, 799, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "template_dirs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_dirs = app_template_dirs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L22_C8", "label": "for template_dir", "type": "for", "loc": [22, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "vector": [6, 2, 0.5098, 0.1765, 2, 0.05, 1.0, 127, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "template_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for template_dir in template_dirs:\n try:\n yield safe_join(template_dir, template_name)\n except UnicodeDecodeError:\n # The template dir name was a bytestring that wasn't valid UTF-8.\n raise\n except ValueError:\n # The joined path was located outside of template_dir."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L23_C12", "label": "try", "type": "try", "loc": [23, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L22_C8", "vector": [7, 3, 0.5196, 0.1569, 3, 0.87, 0.0, 0, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n yield safe_join(template_dir, template_name)\n except UnicodeDecodeError:\n # The template dir name was a bytestring that wasn't valid UTF-8.\n raise\n except ValueError:\n # The joined path was located outside of template_dir.\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L24_C16", "label": "expression", "type": "expression", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L23_C12", "vector": [8, 4, 0.4706, 0.0196, 4, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield safe_join(template_dir, template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L32_C4", "label": "load_template_source", "type": "function", "loc": [32, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "vector": [2, 1, 0.7255, 0.2157, 1, 0.74, 1.0, 521, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "load_template_source", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_template_source(self, template_name, template_dirs=None):\n for filepath in self.get_template_sources(template_name, template_dirs):\n try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L33_C8", "label": "for filepath", "type": "for", "loc": [33, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L32_C4", "vector": [6, 2, 0.7255, 0.1765, 2, 0.03, 0.0, 137, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "filepath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filepath in self.get_template_sources(template_name, template_dirs):\n try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()\n except IOError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12", "label": "try", "type": "try", "loc": [34, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L33_C8", "vector": [7, 3, 0.7353, 0.1569, 3, 0.02, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()\n except IOError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L35_C16", "label": "file = open()", "type": "assigned_variable", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12", "vector": [14, 4, 0.6863, 0.0196, 4, 0.56, 0.0, 107, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " file = open(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16", "label": "try", "type": "try", "loc": [36, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12", "vector": [7, 4, 0.7353, 0.0784, 4, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Return_L37_C20", "label": "return", "type": "return", "loc": [37, 37], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16", "vector": [13, 5, 0.7255, 0.0196, 5, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (file.read().decode(settings.FILE_CHARSET), filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L39_C20", "label": "close()", "type": "expression", "loc": [39, 39], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16", "vector": [8, 5, 0.7647, 0.0196, 5, 0.9, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "label": "load_template_source", "type": "function", "loc": [44, 51], "level": 0, "parent": null, "vector": [2, 0, 0.9314, 0.1569, 0, 0.66, 1.0, 521, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "load_template_source", "arg_names": ["template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_template_source(template_name, template_dirs=None):\n # For backwards compatibility\n import warnings\n warnings.warn(\n \"'django.template.loaders.app_directories.load_template_source' is deprecated; use 'django.template.loaders.app_directories.Loader' instead.\",\n DeprecationWarning\n )\n return _loader.load_template_source(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Import_L46_C4", "label": "warnings import warnings", "type": "import", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "vector": [1, 1, 0.902, 0.0196, 1, 0.77, 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_98987:Expr_L47_C4", "label": "warn()", "type": "expression", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "vector": [8, 1, 0.951, 0.0784, 1, 0.77, 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 \"'django.template.loaders.app_directories.load_template_source' is deprecated; use 'django.template.loaders.app_directories.Loader' instead.\",\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98987:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "vector": [13, 1, 1.0, 0.0196, 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 _loader.load_template_source(template_name, template_dirs)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:If_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:If_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L23_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:ClassDef_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Assign_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Return_L37_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:Try_L36_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L39_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Import_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Expr_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98987:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98987:Return_L51_C4"}] |
"""
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, template_name, template_dirs=None):
"""
Returns the absolute paths to "template_name", when appended to each
directory in "template_dirs". Any paths that don't lie inside one of the
template dirs are excluded from the result set, for security reasons.
"""
if not template_dirs:
template_dirs = settings.TEMPLATE_DIRS
for template_dir in template_dirs:
try:
yield safe_join(template_dir, template_name)
except UnicodeDecodeError:
# The template dir name was a bytestring that wasn't valid UTF-8.
raise
except ValueError:
# The joined path was located outside of this particular
# template_dir (it might be inside another one, so this isn't
# fatal).
pass
def load_template_source(self, template_name, template_dirs=None):
tried = []
for filepath in self.get_template_sources(template_name, template_dirs):
try:
file = open(filepath)
try:
return (file.read().decode(settings.FILE_CHARSET), filepath)
finally:
file.close()
except IOError:
tried.append(filepath)
if tried:
error_msg = "Tried %s" % tried
else:
error_msg = "Your TEMPLATE_DIRS setting is empty. Change it to point to at least one template directory."
raise TemplateDoesNotExist(error_msg)
load_template_source.is_usable = True
_loader = Loader()
def load_template_source(template_name, template_dirs=None):
# For backwards compatibility
import warnings
warnings.warn(
"'django.template.loaders.filesystem.load_template_source' is deprecated; use 'django.template.loaders.filesystem.Loader' instead.",
DeprecationWarning
)
return _loader.load_template_source(template_name, template_dirs)
load_template_source.is_usable = True
| ajibawa-2023/Python-Code-Large/train/row_98988 | 33 | 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_98988:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0328, 0.0492, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nWrapper for loading templates from the filesystem.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:ImportFrom_L5_C0", "label": "from django.conf import settings", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.082, 0.0164, 0, 0.66, 0.125, 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_98988:ImportFrom_L6_C0", "label": "from django.template import TemplateDoesNotExist", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0984, 0.0164, 0, 0.66, 0.25, 213, 0, 1, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["TemplateDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import TemplateDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:ImportFrom_L7_C0", "label": "from django.template.loader import BaseLoader", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1148, 0.0164, 0, 0.66, 0.375, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "django.template.loader", "arg_names": [], "import_names": ["BaseLoader"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template.loader import BaseLoader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:ImportFrom_L8_C0", "label": "from django.utils._os import safe_join", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.1311, 0.0164, 0, 0.66, 0.5, 656, 0, 1, 0, 0, 656, 0, 0], "semantic": {"name": "django.utils._os", "arg_names": [], "import_names": ["safe_join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils._os import safe_join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "label": "Loader", "type": "class", "loc": [10, 49], "level": 0, "parent": null, "vector": [3, 0, 0.4836, 0.6557, 0, 0.66, 0.625, 739, 0, 2, 0, 0, 461, 0, 8], "semantic": {"name": "Loader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Loader(BaseLoader):\n is_usable = True\n\n def get_template_sources(self, template_name, template_dirs=None):\n \"\"\"\n Returns the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L11_C4", "label": "is_usable =", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "vector": [14, 1, 0.1803, 0.0164, 1, 0.07, 0.0, 275, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_usable = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "label": "get_template_sources", "type": "function", "loc": [13, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "vector": [2, 1, 0.3607, 0.3115, 1, 0.07, 0.3333, 281, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "get_template_sources", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_template_sources(self, template_name, template_dirs=None):\n \"\"\"\n Returns the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons.\n \"\"\"\n if not template_dirs:\n template_dirs = settings.TEMPLATE_DIRS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L14_C8", "label": "expression", "type": "expression", "loc": [14, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "vector": [8, 2, 0.2623, 0.082, 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 the absolute paths to \"template_name\", when appended to each\n directory in \"template_dirs\". Any paths that don't lie inside one of the\n template dirs are excluded from the result set, for security reasons.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L19_C8", "label": "if", "type": "if", "loc": [19, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "vector": [4, 2, 0.3197, 0.0328, 2, 0.08, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not template_dirs:\n template_dirs = settings.TEMPLATE_DIRS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L20_C12", "label": "template_dirs =", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L19_C8", "vector": [14, 3, 0.3279, 0.0164, 3, 0.33, 0.0, 799, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "template_dirs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_dirs = settings.TEMPLATE_DIRS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L21_C8", "label": "for template_dir", "type": "for", "loc": [21, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "vector": [6, 2, 0.4262, 0.1803, 2, 0.08, 1.0, 127, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "template_dir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for template_dir in template_dirs:\n try:\n yield safe_join(template_dir, template_name)\n except UnicodeDecodeError:\n # The template dir name was a bytestring that wasn't valid UTF-8.\n raise\n except ValueError:\n # The joined path was located outside of this particular"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L22_C12", "label": "try", "type": "try", "loc": [22, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L21_C8", "vector": [7, 3, 0.4344, 0.1639, 3, 0.42, 0.0, 0, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n yield safe_join(template_dir, template_name)\n except UnicodeDecodeError:\n # The template dir name was a bytestring that wasn't valid UTF-8.\n raise\n except ValueError:\n # The joined path was located outside of this particular\n # template_dir (it might be inside another one, so this isn't"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L23_C16", "label": "expression", "type": "expression", "loc": [23, 23], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L22_C12", "vector": [8, 4, 0.377, 0.0164, 4, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield safe_join(template_dir, template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "label": "load_template_source", "type": "function", "loc": [33, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "vector": [2, 1, 0.6639, 0.2623, 1, 0.07, 0.6667, 521, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "load_template_source", "arg_names": ["self", "template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_template_source(self, template_name, template_dirs=None):\n tried = []\n for filepath in self.get_template_sources(template_name, template_dirs):\n try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L34_C8", "label": "tried =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "vector": [14, 2, 0.5574, 0.0164, 2, 0.46, 0.0, 874, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "tried", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tried = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L35_C8", "label": "for filepath", "type": "for", "loc": [35, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "vector": [6, 2, 0.6393, 0.1475, 2, 0.46, 0.5, 137, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "filepath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filepath in self.get_template_sources(template_name, template_dirs):\n try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()\n except IOError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "label": "try", "type": "try", "loc": [36, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L35_C8", "vector": [7, 3, 0.6475, 0.1311, 3, 0.24, 0.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n file = open(filepath)\n try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()\n except IOError:\n tried.append(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L37_C16", "label": "file = open()", "type": "assigned_variable", "loc": [37, 37], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "vector": [14, 4, 0.6066, 0.0164, 4, 0.76, 0.0, 107, 3, 1, 0, 0, 693, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " file = open(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16", "label": "try", "type": "try", "loc": [38, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "vector": [7, 4, 0.6475, 0.0656, 4, 0.76, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return (file.read().decode(settings.FILE_CHARSET), filepath)\n finally:\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Return_L39_C20", "label": "return", "type": "return", "loc": [39, 39], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16", "vector": [13, 5, 0.6393, 0.0164, 5, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (file.read().decode(settings.FILE_CHARSET), filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L41_C20", "label": "close()", "type": "expression", "loc": [41, 41], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16", "vector": [8, 5, 0.6721, 0.0164, 5, 0.49, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L43_C16", "label": "append()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "vector": [8, 4, 0.7049, 0.0164, 4, 0.76, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " tried.append(filepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8", "label": "if", "type": "if", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "vector": [4, 2, 0.7459, 0.0656, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tried:\n error_msg = \"Tried %s\" % tried\n else:\n error_msg = \"Your TEMPLATE_DIRS setting is empty. Change it to point to at least one template directory.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L45_C12", "label": "error_msg =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8", "vector": [14, 3, 0.7377, 0.0164, 3, 0.08, 0.0, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = \"Tried %s\" % tried"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L47_C12", "label": "error_msg =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8", "vector": [14, 3, 0.7705, 0.0164, 3, 0.08, 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 = \"Your TEMPLATE_DIRS setting is empty. Change it to point to at least one template directory.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L49_C4", "label": "load_template_source.is_usable =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "vector": [14, 1, 0.8033, 0.0164, 1, 0.07, 1.0, 464, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "load_template_source.is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " load_template_source.is_usable = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L51_C0", "label": "_loader = Loader()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.8361, 0.0164, 0, 0.66, 0.75, 384, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "_loader", "arg_names": [], "import_names": [], "rhs_call_name": "Loader", "annotation": ""}, "snippet": "_loader = Loader()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "label": "load_template_source", "type": "function", "loc": [53, 60], "level": 0, "parent": null, "vector": [2, 0, 0.9262, 0.1311, 0, 0.66, 0.875, 521, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "load_template_source", "arg_names": ["template_name", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def load_template_source(template_name, template_dirs=None):\n # For backwards compatibility\n import warnings\n warnings.warn(\n \"'django.template.loaders.filesystem.load_template_source' is deprecated; use 'django.template.loaders.filesystem.Loader' instead.\",\n DeprecationWarning\n )\n return _loader.load_template_source(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Import_L55_C4", "label": "warnings import warnings", "type": "import", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "vector": [1, 1, 0.9016, 0.0164, 1, 0.41, 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_98988:Expr_L56_C4", "label": "warn()", "type": "expression", "loc": [56, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "vector": [8, 1, 0.9426, 0.0656, 1, 0.41, 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 \"'django.template.loaders.filesystem.load_template_source' is deprecated; use 'django.template.loaders.filesystem.Loader' instead.\",\n DeprecationWarning\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Return_L60_C4", "label": "return", "type": "return", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "vector": [13, 1, 0.9836, 0.0164, 1, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _loader.load_template_source(template_name, template_dirs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L61_C0", "label": "load_template_source.is_usable =", "type": "assigned_variable", "loc": [61, 61], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0164, 0, 0.66, 1.0, 464, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "load_template_source.is_usable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "load_template_source.is_usable = True"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L19_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L22_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L23_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:For_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L37_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Return_L39_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L38_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L41_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:Try_L36_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Import_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Expr_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98988:FunctionDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98988:Return_L60_C4"}] |
from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template import Library, Node, TextNode
from django.template.loader import get_template
from django.conf import settings
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class ExtendsError(Exception):
pass
class BlockContext(object):
def __init__(self):
# Dictionary of FIFO queues.
self.blocks = {}
def add_blocks(self, blocks):
for name, block in blocks.iteritems():
if name in self.blocks:
self.blocks[name].insert(0, block)
else:
self.blocks[name] = [block]
def pop(self, name):
try:
return self.blocks[name].pop()
except (IndexError, KeyError):
return None
def push(self, name, block):
self.blocks[name].append(block)
def get_block(self, name):
try:
return self.blocks[name][-1]
except (IndexError, KeyError):
return None
class BlockNode(Node):
def __init__(self, name, nodelist, parent=None):
self.name, self.nodelist, self.parent = name, nodelist, parent
def __repr__(self):
return "<Block Node: %s. Contents: %r>" % (self.name, self.nodelist)
def render(self, context):
block_context = context.render_context.get(BLOCK_CONTEXT_KEY)
context.push()
if block_context is None:
context['block'] = self
result = self.nodelist.render(context)
else:
push = block = block_context.pop(self.name)
if block is None:
block = self
# Create new block so we can store context without thread-safety issues.
block = BlockNode(block.name, block.nodelist)
block.context = context
context['block'] = block
result = block.nodelist.render(context)
if push is not None:
block_context.push(self.name, push)
context.pop()
return result
def super(self):
render_context = self.context.render_context
if (BLOCK_CONTEXT_KEY in render_context and
render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None):
return mark_safe(self.render(self.context))
return ''
class ExtendsNode(Node):
must_be_first = True
def __init__(self, nodelist, parent_name, parent_name_expr, template_dirs=None):
self.nodelist = nodelist
self.parent_name, self.parent_name_expr = parent_name, parent_name_expr
self.template_dirs = template_dirs
self.blocks = dict([(n.name, n) for n in nodelist.get_nodes_by_type(BlockNode)])
def __repr__(self):
if self.parent_name_expr:
return "<ExtendsNode: extends %s>" % self.parent_name_expr.token
return '<ExtendsNode: extends "%s">' % self.parent_name
def get_parent(self, context):
if self.parent_name_expr:
self.parent_name = self.parent_name_expr.resolve(context)
parent = self.parent_name
if not parent:
error_msg = "Invalid template name in 'extends' tag: %r." % parent
if self.parent_name_expr:
error_msg += " Got this from the '%s' variable." % self.parent_name_expr.token
raise TemplateSyntaxError(error_msg)
if hasattr(parent, 'render'):
return parent # parent is a Template object
return get_template(parent)
def render(self, context):
compiled_parent = self.get_parent(context)
if BLOCK_CONTEXT_KEY not in context.render_context:
context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()
block_context = context.render_context[BLOCK_CONTEXT_KEY]
# Add the block nodes from this node to the block context
block_context.add_blocks(self.blocks)
# If this block's parent doesn't have an extends node it is the root,
# and its block nodes also need to be added to the block context.
for node in compiled_parent.nodelist:
# The ExtendsNode has to be the first non-text node.
if not isinstance(node, TextNode):
if not isinstance(node, ExtendsNode):
blocks = dict([(n.name, n) for n in
compiled_parent.nodelist.get_nodes_by_type(BlockNode)])
block_context.add_blocks(blocks)
break
# Call Template._render explicitly so the parser context stays
# the same.
return compiled_parent._render(context)
class ConstantIncludeNode(Node):
def __init__(self, template_path):
try:
t = get_template(template_path)
self.template = t
except:
if settings.TEMPLATE_DEBUG:
raise
self.template = None
def render(self, context):
if self.template:
return self.template.render(context)
else:
return ''
class IncludeNode(Node):
def __init__(self, template_name):
self.template_name = Variable(template_name)
def render(self, context):
try:
template_name = self.template_name.resolve(context)
t = get_template(template_name)
return t.render(context)
except TemplateSyntaxError, e:
if settings.TEMPLATE_DEBUG:
raise
return ''
except:
return '' # Fail silently for invalid included templates.
def do_block(parser, token):
"""
Define a block that can be overridden by child templates.
"""
bits = token.contents.split()
if len(bits) != 2:
raise TemplateSyntaxError("'%s' tag takes only one argument" % bits[0])
block_name = bits[1]
# Keep track of the names of BlockNodes found in this template, so we can
# check for duplication.
try:
if block_name in parser.__loaded_blocks:
raise TemplateSyntaxError("'%s' tag with name '%s' appears more than once" % (bits[0], block_name))
parser.__loaded_blocks.append(block_name)
except AttributeError: # parser.__loaded_blocks isn't a list yet
parser.__loaded_blocks = [block_name]
nodelist = parser.parse(('endblock', 'endblock %s' % block_name))
parser.delete_first_token()
return BlockNode(block_name, nodelist)
def do_extends(parser, token):
"""
Signal that this template extends a parent template.
This tag may be used in two ways: ``{% extends "base" %}`` (with quotes)
uses the literal value "base" as the name of the parent template to extend,
or ``{% extends variable %}`` uses the value of ``variable`` as either the
name of the parent template to extend (if it evaluates to a string) or as
the parent tempate itelf (if it evaluates to a Template object).
"""
bits = token.split_contents()
if len(bits) != 2:
raise TemplateSyntaxError("'%s' takes one argument" % bits[0])
parent_name, parent_name_expr = None, None
if bits[1][0] in ('"', "'") and bits[1][-1] == bits[1][0]:
parent_name = bits[1][1:-1]
else:
parent_name_expr = parser.compile_filter(bits[1])
nodelist = parser.parse()
if nodelist.get_nodes_by_type(ExtendsNode):
raise TemplateSyntaxError("'%s' cannot appear more than once in the same template" % bits[0])
return ExtendsNode(nodelist, parent_name, parent_name_expr)
def do_include(parser, token):
"""
Loads a template and renders it with the current context.
Example::
{% include "foo/some_include" %}
"""
bits = token.split_contents()
if len(bits) != 2:
raise TemplateSyntaxError("%r tag takes one argument: the name of the template to be included" % bits[0])
path = bits[1]
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1])
return IncludeNode(bits[1])
register.tag('block', do_block)
register.tag('extends', do_extends)
register.tag('include', do_include)
| ajibawa-2023/Python-Code-Large/train/row_98995 | 142 | 219 | 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_98995:ImportFrom_L1_C0", "label": "from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0046, 0, 0.66, 0.0, 213, 0, 3, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["TemplateSyntaxError", "TemplateDoesNotExist", "Variable"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ImportFrom_L2_C0", "label": "from django.template import Library, Node, TextNode", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0091, 0.0046, 0, 0.66, 0.0556, 213, 0, 3, 0, 0, 213, 0, 0], "semantic": {"name": "django.template", "arg_names": [], "import_names": ["Library", "Node", "TextNode"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template import Library, Node, TextNode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ImportFrom_L3_C0", "label": "from django.template.loader import get_template", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0046, 0, 0.66, 0.1111, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "django.template.loader", "arg_names": [], "import_names": ["get_template"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.template.loader import get_template"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ImportFrom_L4_C0", "label": "from django.conf import settings", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.0046, 0, 0.66, 0.1667, 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_98995:ImportFrom_L5_C0", "label": "from django.utils.safestring import mark_safe", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0228, 0.0046, 0, 0.66, 0.2222, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.safestring", "arg_names": [], "import_names": ["mark_safe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.safestring import mark_safe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L7_C0", "label": "register = Library()", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.032, 0.0046, 0, 0.66, 0.2778, 276, 3, 0, 0, 0, 77, 10, 1], "semantic": {"name": "register", "arg_names": [], "import_names": [], "rhs_call_name": "Library", "annotation": ""}, "snippet": "register = Library()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L9_C0", "label": "BLOCK_CONTEXT_KEY =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0411, 0.0046, 0, 0.66, 0.3333, 311, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "BLOCK_CONTEXT_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BLOCK_CONTEXT_KEY = 'block_context'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L11_C0", "label": "ExtendsError", "type": "class", "loc": [11, 12], "level": 0, "parent": null, "vector": [3, 0, 0.0525, 0.0091, 0, 0.66, 0.3889, 365, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ExtendsError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendsError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "label": "BlockContext", "type": "class", "loc": [14, 39], "level": 0, "parent": null, "vector": [3, 0, 0.121, 0.1187, 0, 0.66, 0.4444, 815, 0, 5, 0, 0, 186, 0, 4], "semantic": {"name": "BlockContext", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BlockContext(object):\n def __init__(self):\n # Dictionary of FIFO queues.\n self.blocks = {}\n\n def add_blocks(self, blocks):\n for name, block in blocks.iteritems():\n if name in self.blocks:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "vector": [2, 1, 0.0731, 0.0137, 1, 0.03, 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 # Dictionary of FIFO queues.\n self.blocks = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L17_C8", "label": "self.blocks =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L15_C4", "vector": [14, 2, 0.0776, 0.0046, 2, 0.78, 0.0, 356, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.blocks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.blocks = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L19_C4", "label": "add_blocks", "type": "function", "loc": [19, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "vector": [2, 1, 0.0982, 0.0274, 1, 0.03, 0.25, 798, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_blocks", "arg_names": ["self", "blocks"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_blocks(self, blocks):\n for name, block in blocks.iteritems():\n if name in self.blocks:\n self.blocks[name].insert(0, block)\n else:\n self.blocks[name] = [block]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L20_C8", "label": "for name, block", "type": "for", "loc": [20, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L19_C4", "vector": [6, 2, 0.1005, 0.0228, 2, 0.39, 0.0, 424, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name, block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, block in blocks.iteritems():\n if name in self.blocks:\n self.blocks[name].insert(0, block)\n else:\n self.blocks[name] = [block]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12", "label": "if", "type": "if", "loc": [21, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L20_C8", "vector": [4, 3, 0.1027, 0.0183, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in self.blocks:\n self.blocks[name].insert(0, block)\n else:\n self.blocks[name] = [block]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L22_C16", "label": "insert()", "type": "expression", "loc": [22, 22], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12", "vector": [8, 4, 0.1005, 0.0046, 4, 0.9, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " self.blocks[name].insert(0, block)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L24_C16", "label": "assign", "type": "assigned_variable", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12", "vector": [14, 4, 0.1096, 0.0046, 4, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.blocks[name] = [block]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L26_C4", "label": "pop", "type": "function", "loc": [26, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "vector": [2, 1, 0.1279, 0.0228, 1, 0.03, 0.5, 969, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pop(self, name):\n try:\n return self.blocks[name].pop()\n except (IndexError, KeyError):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8", "label": "try", "type": "try", "loc": [27, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L26_C4", "vector": [7, 2, 0.1301, 0.0183, 2, 0.05, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.blocks[name].pop()\n except (IndexError, KeyError):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8", "vector": [13, 3, 0.1279, 0.0046, 3, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.blocks[name].pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L30_C12", "label": "return", "type": "return", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8", "vector": [13, 3, 0.137, 0.0046, 3, 0.95, 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_98995:FunctionDef_L32_C4", "label": "push", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "vector": [2, 1, 0.1484, 0.0091, 1, 0.03, 0.75, 176, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "push", "arg_names": ["self", "name", "block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def push(self, name, block):\n self.blocks[name].append(block)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L33_C8", "label": "append()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L32_C4", "vector": [8, 2, 0.1507, 0.0046, 2, 0.71, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.blocks[name].append(block)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L35_C4", "label": "get_block", "type": "function", "loc": [35, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "vector": [2, 1, 0.1689, 0.0228, 1, 0.03, 1.0, 656, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_block", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_block(self, name):\n try:\n return self.blocks[name][-1]\n except (IndexError, KeyError):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8", "label": "try", "type": "try", "loc": [36, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L35_C4", "vector": [7, 2, 0.1712, 0.0183, 2, 0.72, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.blocks[name][-1]\n except (IndexError, KeyError):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L37_C12", "label": "return", "type": "return", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8", "vector": [13, 3, 0.1689, 0.0046, 3, 0.38, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.blocks[name][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L39_C12", "label": "return", "type": "return", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8", "vector": [13, 3, 0.1781, 0.0046, 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_98995:ClassDef_L41_C0", "label": "BlockNode", "type": "class", "loc": [41, 73], "level": 0, "parent": null, "vector": [3, 0, 0.2603, 0.1507, 0, 0.66, 0.5, 680, 0, 4, 0, 0, 345, 0, 11], "semantic": {"name": "BlockNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BlockNode(Node):\n def __init__(self, name, nodelist, parent=None):\n self.name, self.nodelist, self.parent = name, nodelist, parent\n\n def __repr__(self):\n return \"<Block Node: %s. Contents: %r>\" % (self.name, self.nodelist)\n\n def render(self, context):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L42_C4", "label": "__init__", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "vector": [2, 1, 0.1941, 0.0091, 1, 0.24, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "nodelist", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, nodelist, parent=None):\n self.name, self.nodelist, self.parent = name, nodelist, parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L43_C8", "label": "assign", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L42_C4", "vector": [14, 2, 0.1963, 0.0046, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name, self.nodelist, self.parent = name, nodelist, parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L45_C4", "label": "__repr__", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "vector": [2, 1, 0.2078, 0.0091, 1, 0.24, 0.3333, 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 \"<Block Node: %s. Contents: %r>\" % (self.name, self.nodelist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L45_C4", "vector": [13, 2, 0.21, 0.0046, 2, 0.78, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"<Block Node: %s. Contents: %r>\" % (self.name, self.nodelist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "label": "render", "type": "function", "loc": [48, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "vector": [2, 1, 0.2603, 0.0868, 1, 0.24, 0.6667, 24, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "render", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, context):\n block_context = context.render_context.get(BLOCK_CONTEXT_KEY)\n context.push()\n if block_context is None:\n context['block'] = self\n result = self.nodelist.render(context)\n else:\n push = block = block_context.pop(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L49_C8", "label": "block_context = get()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "vector": [14, 2, 0.2237, 0.0046, 2, 0.83, 0.0, 333, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "block_context", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " block_context = context.render_context.get(BLOCK_CONTEXT_KEY)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L50_C8", "label": "push()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "vector": [8, 2, 0.2283, 0.0046, 2, 0.83, 0.25, 176, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "push", "arg_names": [], "import_names": [], "rhs_call_name": "push", "annotation": ""}, "snippet": " context.push()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "label": "if", "type": "if", "loc": [51, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "vector": [4, 2, 0.2626, 0.0639, 2, 0.83, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if block_context is None:\n context['block'] = self\n result = self.nodelist.render(context)\n else:\n push = block = block_context.pop(self.name)\n if block is None:\n block = self\n # Create new block so we can store context without thread-safety issues."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L52_C12", "label": "assign", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.2374, 0.0046, 3, 0.21, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " context['block'] = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L53_C12", "label": "result = render()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.242, 0.0046, 3, 0.21, 0.125, 51, 3, 1, 0, 0, 24, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " result = self.nodelist.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L55_C12", "label": "push = pop()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.2511, 0.0046, 3, 0.21, 0.25, 176, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "push", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " push = block = block_context.pop(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L56_C12", "label": "if", "type": "if", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [4, 3, 0.258, 0.0091, 3, 0.21, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if block is None:\n block = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L57_C16", "label": "block =", "type": "assigned_variable", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L56_C12", "vector": [14, 4, 0.2603, 0.0046, 4, 0.41, 0.0, 506, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L59_C12", "label": "block = BlockNode()", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.2694, 0.0046, 3, 0.21, 0.5, 506, 3, 2, 0, 0, 680, 10, 1], "semantic": {"name": "block", "arg_names": [], "import_names": [], "rhs_call_name": "BlockNode", "annotation": ""}, "snippet": " block = BlockNode(block.name, block.nodelist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L60_C12", "label": "block.context =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.274, 0.0046, 3, 0.21, 0.625, 643, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block.context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block.context = context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L61_C12", "label": "assign", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.2785, 0.0046, 3, 0.21, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " context['block'] = block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L62_C12", "label": "result = render()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [14, 3, 0.2831, 0.0046, 3, 0.21, 0.875, 51, 3, 1, 0, 0, 24, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " result = block.nodelist.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L63_C12", "label": "if", "type": "if", "loc": [63, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "vector": [4, 3, 0.29, 0.0091, 3, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if push is not None:\n block_context.push(self.name, push)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L64_C16", "label": "push()", "type": "expression", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L63_C12", "vector": [8, 4, 0.2922, 0.0046, 4, 0.12, 0.0, 176, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "push", "arg_names": [], "import_names": [], "rhs_call_name": "push", "annotation": ""}, "snippet": " block_context.push(self.name, push)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L65_C8", "label": "pop()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "vector": [8, 2, 0.2968, 0.0046, 2, 0.83, 0.75, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " context.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "vector": [13, 2, 0.3014, 0.0046, 2, 0.83, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "label": "super", "type": "function", "loc": [68, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "vector": [2, 1, 0.3219, 0.0274, 1, 0.24, 1.0, 395, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "super", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def super(self):\n render_context = self.context.render_context\n if (BLOCK_CONTEXT_KEY in render_context and\n render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None):\n return mark_safe(self.render(self.context))\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L69_C8", "label": "render_context =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "vector": [14, 2, 0.3151, 0.0046, 2, 0.52, 0.0, 960, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "render_context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " render_context = self.context.render_context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L70_C8", "label": "if", "type": "if", "loc": [70, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "vector": [4, 2, 0.3242, 0.0137, 2, 0.52, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (BLOCK_CONTEXT_KEY in render_context and\n render_context[BLOCK_CONTEXT_KEY].get_block(self.name) is not None):\n return mark_safe(self.render(self.context))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L72_C12", "label": "return", "type": "return", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L70_C8", "vector": [13, 3, 0.3288, 0.0046, 3, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(self.render(self.context))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L73_C8", "label": "return", "type": "return", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "vector": [13, 2, 0.3333, 0.0046, 2, 0.52, 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_98995:ClassDef_L75_C0", "label": "ExtendsNode", "type": "class", "loc": [75, 125], "level": 0, "parent": null, "vector": [3, 0, 0.4566, 0.2329, 0, 0.66, 0.5556, 817, 0, 4, 0, 0, 345, 0, 15], "semantic": {"name": "ExtendsNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtendsNode(Node):\n must_be_first = True\n\n def __init__(self, nodelist, parent_name, parent_name_expr, template_dirs=None):\n self.nodelist = nodelist\n self.parent_name, self.parent_name_expr = parent_name, parent_name_expr\n self.template_dirs = template_dirs\n self.blocks = dict([(n.name, n) for n in nodelist.get_nodes_by_type(BlockNode)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L76_C4", "label": "must_be_first =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "vector": [14, 1, 0.347, 0.0046, 1, 0.28, 0.0, 927, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "must_be_first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " must_be_first = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "label": "__init__", "type": "function", "loc": [78, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "vector": [2, 1, 0.3653, 0.0228, 1, 0.28, 0.25, 555, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "nodelist", "parent_name", "parent_name_expr", "template_dirs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, nodelist, parent_name, parent_name_expr, template_dirs=None):\n self.nodelist = nodelist\n self.parent_name, self.parent_name_expr = parent_name, parent_name_expr\n self.template_dirs = template_dirs\n self.blocks = dict([(n.name, n) for n in nodelist.get_nodes_by_type(BlockNode)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L79_C8", "label": "self.nodelist =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "vector": [14, 2, 0.3607, 0.0046, 2, 0.65, 0.0, 870, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.nodelist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.nodelist = nodelist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L80_C8", "label": "assign", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "vector": [14, 2, 0.3653, 0.0046, 2, 0.65, 0.3333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent_name, self.parent_name_expr = parent_name, parent_name_expr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L81_C8", "label": "self.template_dirs =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "vector": [14, 2, 0.3699, 0.0046, 2, 0.65, 0.6667, 423, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.template_dirs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.template_dirs = template_dirs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L82_C8", "label": "self.blocks = dict()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "vector": [14, 2, 0.3744, 0.0046, 2, 0.65, 1.0, 356, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "self.blocks", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self.blocks = dict([(n.name, n) for n in nodelist.get_nodes_by_type(BlockNode)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4", "label": "__repr__", "type": "function", "loc": [84, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "vector": [2, 1, 0.3904, 0.0183, 1, 0.28, 0.5, 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 if self.parent_name_expr:\n return \"<ExtendsNode: extends %s>\" % self.parent_name_expr.token\n return '<ExtendsNode: extends \"%s\">' % self.parent_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L85_C8", "label": "if", "type": "if", "loc": [85, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4", "vector": [4, 2, 0.3904, 0.0091, 2, 0.29, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent_name_expr:\n return \"<ExtendsNode: extends %s>\" % self.parent_name_expr.token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L86_C12", "label": "return", "type": "return", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L85_C8", "vector": [13, 3, 0.3927, 0.0046, 3, 0.64, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"<ExtendsNode: extends %s>\" % self.parent_name_expr.token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4", "vector": [13, 2, 0.3973, 0.0046, 2, 0.29, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<ExtendsNode: extends \"%s\">' % self.parent_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "label": "get_parent", "type": "function", "loc": [89, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "vector": [2, 1, 0.4315, 0.0548, 1, 0.28, 0.75, 684, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_parent", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_parent(self, context):\n if self.parent_name_expr:\n self.parent_name = self.parent_name_expr.resolve(context)\n parent = self.parent_name\n if not parent:\n error_msg = \"Invalid template name in 'extends' tag: %r.\" % parent\n if self.parent_name_expr:\n error_msg += \" Got this from the '%s' variable.\" % self.parent_name_expr.token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L90_C8", "label": "if", "type": "if", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "vector": [4, 2, 0.4132, 0.0091, 2, 0.62, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent_name_expr:\n self.parent_name = self.parent_name_expr.resolve(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L91_C12", "label": "self.parent_name = resolve()", "type": "assigned_variable", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L90_C8", "vector": [14, 3, 0.4155, 0.0046, 3, 0.74, 0.0, 129, 3, 1, 0, 0, 675, 10, 1], "semantic": {"name": "self.parent_name", "arg_names": [], "import_names": [], "rhs_call_name": "resolve", "annotation": ""}, "snippet": " self.parent_name = self.parent_name_expr.resolve(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L92_C8", "label": "parent =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "vector": [14, 2, 0.4201, 0.0046, 2, 0.62, 0.25, 80, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parent = self.parent_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8", "label": "if", "type": "if", "loc": [93, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "vector": [4, 2, 0.4338, 0.0228, 2, 0.62, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not parent:\n error_msg = \"Invalid template name in 'extends' tag: %r.\" % parent\n if self.parent_name_expr:\n error_msg += \" Got this from the '%s' variable.\" % self.parent_name_expr.token\n raise TemplateSyntaxError(error_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L94_C12", "label": "error_msg =", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8", "vector": [14, 3, 0.4292, 0.0046, 3, 0.74, 0.0, 503, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "error_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " error_msg = \"Invalid template name in 'extends' tag: %r.\" % parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L95_C12", "label": "if", "type": "if", "loc": [95, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8", "vector": [4, 3, 0.4361, 0.0091, 3, 0.74, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent_name_expr:\n error_msg += \" Got this from the '%s' variable.\" % self.parent_name_expr.token"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "vector": [4, 2, 0.4498, 0.0091, 2, 0.62, 0.75, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(parent, 'render'):\n return parent # parent is a Template object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L98_C8", "vector": [13, 3, 0.4521, 0.0046, 3, 0.28, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parent # parent is a Template object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "vector": [13, 2, 0.4566, 0.0046, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_template(parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "label": "render", "type": "function", "loc": [102, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "vector": [2, 1, 0.5183, 0.1096, 1, 0.28, 1.0, 24, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "render", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, context):\n compiled_parent = self.get_parent(context)\n\n if BLOCK_CONTEXT_KEY not in context.render_context:\n context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()\n block_context = context.render_context[BLOCK_CONTEXT_KEY]\n\n # Add the block nodes from this node to the block context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L103_C8", "label": "compiled_parent = get_parent()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [14, 2, 0.4703, 0.0046, 2, 0.37, 0.0, 908, 3, 1, 0, 0, 684, 10, 1], "semantic": {"name": "compiled_parent", "arg_names": [], "import_names": [], "rhs_call_name": "get_parent", "annotation": ""}, "snippet": " compiled_parent = self.get_parent(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L105_C8", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [4, 2, 0.4817, 0.0091, 2, 0.37, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if BLOCK_CONTEXT_KEY not in context.render_context:\n context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L106_C12", "label": " = BlockContext()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L105_C8", "vector": [14, 3, 0.484, 0.0046, 3, 0.2, 0.0, 0, 3, 0, 0, 0, 815, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "BlockContext", "annotation": ""}, "snippet": " context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L107_C8", "label": "block_context =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [14, 2, 0.4886, 0.0046, 2, 0.37, 0.4, 333, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block_context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block_context = context.render_context[BLOCK_CONTEXT_KEY]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L110_C8", "label": "add_blocks()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [8, 2, 0.5023, 0.0046, 2, 0.37, 0.6, 798, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_blocks", "arg_names": [], "import_names": [], "rhs_call_name": "add_blocks", "annotation": ""}, "snippet": " block_context.add_blocks(self.blocks)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L114_C8", "label": "for node", "type": "for", "loc": [114, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [6, 2, 0.5365, 0.0365, 2, 0.37, 0.8, 772, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for node in compiled_parent.nodelist:\n # The ExtendsNode has to be the first non-text node.\n if not isinstance(node, TextNode):\n if not isinstance(node, ExtendsNode):\n blocks = dict([(n.name, n) for n in\n compiled_parent.nodelist.get_nodes_by_type(BlockNode)])\n block_context.add_blocks(blocks)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L116_C12", "label": "if", "type": "if", "loc": [116, 121], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L114_C8", "vector": [4, 3, 0.5411, 0.0274, 3, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(node, TextNode):\n if not isinstance(node, ExtendsNode):\n blocks = dict([(n.name, n) for n in\n compiled_parent.nodelist.get_nodes_by_type(BlockNode)])\n block_context.add_blocks(blocks)\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16", "label": "if", "type": "if", "loc": [117, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L116_C12", "vector": [4, 4, 0.5411, 0.0183, 4, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(node, ExtendsNode):\n blocks = dict([(n.name, n) for n in\n compiled_parent.nodelist.get_nodes_by_type(BlockNode)])\n block_context.add_blocks(blocks)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L118_C20", "label": "blocks = dict()", "type": "assigned_variable", "loc": [118, 119], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16", "vector": [14, 5, 0.5411, 0.0091, 5, 0.98, 0.0, 384, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "blocks", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " blocks = dict([(n.name, n) for n in\n compiled_parent.nodelist.get_nodes_by_type(BlockNode)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L120_C20", "label": "add_blocks()", "type": "expression", "loc": [120, 120], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16", "vector": [8, 5, 0.5479, 0.0046, 5, 0.98, 1.0, 798, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_blocks", "arg_names": [], "import_names": [], "rhs_call_name": "add_blocks", "annotation": ""}, "snippet": " block_context.add_blocks(blocks)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "vector": [13, 2, 0.5708, 0.0046, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return compiled_parent._render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L127_C0", "label": "ConstantIncludeNode", "type": "class", "loc": [127, 141], "level": 0, "parent": null, "vector": [3, 0, 0.6119, 0.0685, 0, 0.66, 0.6111, 313, 0, 2, 0, 0, 345, 0, 2], "semantic": {"name": "ConstantIncludeNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ConstantIncludeNode(Node):\n def __init__(self, template_path):\n try:\n t = get_template(template_path)\n self.template = t\n except:\n if settings.TEMPLATE_DEBUG:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L128_C4", "label": "__init__", "type": "function", "loc": [128, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L127_C0", "vector": [2, 1, 0.6005, 0.0365, 1, 0.49, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "template_path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, template_path):\n try:\n t = get_template(template_path)\n self.template = t\n except:\n if settings.TEMPLATE_DEBUG:\n raise\n self.template = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "label": "try", "type": "try", "loc": [129, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L128_C4", "vector": [7, 2, 0.6027, 0.032, 2, 0.54, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n t = get_template(template_path)\n self.template = t\n except:\n if settings.TEMPLATE_DEBUG:\n raise\n self.template = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L130_C12", "label": "t = get_template()", "type": "assigned_variable", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "vector": [14, 3, 0.5936, 0.0046, 3, 0.98, 0.0, 15, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "get_template", "annotation": ""}, "snippet": " t = get_template(template_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L131_C12", "label": "self.template =", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "vector": [14, 3, 0.5982, 0.0046, 3, 0.98, 1.0, 479, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.template = t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L133_C12", "label": "if", "type": "if", "loc": [133, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "vector": [4, 3, 0.6096, 0.0091, 3, 0.98, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings.TEMPLATE_DEBUG:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L135_C12", "label": "self.template =", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "vector": [14, 3, 0.6164, 0.0046, 3, 0.98, 1.0, 479, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.template = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L137_C4", "label": "render", "type": "function", "loc": [137, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L127_C0", "vector": [2, 1, 0.6347, 0.0228, 1, 0.49, 1.0, 24, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "render", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, context):\n if self.template:\n return self.template.render(context)\n else:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8", "label": "if", "type": "if", "loc": [138, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L137_C4", "vector": [4, 2, 0.637, 0.0183, 2, 0.82, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.template:\n return self.template.render(context)\n else:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L139_C12", "label": "return", "type": "return", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8", "vector": [13, 3, 0.6347, 0.0046, 3, 0.44, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.template.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L141_C12", "label": "return", "type": "return", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8", "vector": [13, 3, 0.6438, 0.0046, 3, 0.44, 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_98995:ClassDef_L143_C0", "label": "IncludeNode", "type": "class", "loc": [143, 156], "level": 0, "parent": null, "vector": [3, 0, 0.6826, 0.0639, 0, 0.66, 0.6667, 356, 0, 2, 0, 0, 345, 0, 4], "semantic": {"name": "IncludeNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IncludeNode(Node):\n def __init__(self, template_name):\n self.template_name = Variable(template_name)\n\n def render(self, context):\n try:\n template_name = self.template_name.resolve(context)\n t = get_template(template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L144_C4", "label": "__init__", "type": "function", "loc": [144, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L143_C0", "vector": [2, 1, 0.6598, 0.0091, 1, 0.81, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "template_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, template_name):\n self.template_name = Variable(template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L145_C8", "label": "self.template_name = Variable()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L144_C4", "vector": [14, 2, 0.6621, 0.0046, 2, 0.79, 0.0, 990, 3, 1, 0, 0, 807, 10, 1], "semantic": {"name": "self.template_name", "arg_names": [], "import_names": [], "rhs_call_name": "Variable", "annotation": ""}, "snippet": " self.template_name = Variable(template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L147_C4", "label": "render", "type": "function", "loc": [147, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L143_C0", "vector": [2, 1, 0.6918, 0.0457, 1, 0.81, 1.0, 24, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "render", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, context):\n try:\n template_name = self.template_name.resolve(context)\n t = get_template(template_name)\n return t.render(context)\n if settings.TEMPLATE_DEBUG:\n raise\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "label": "try", "type": "try", "loc": [148, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L147_C4", "vector": [7, 2, 0.6941, 0.0411, 2, 0.37, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n template_name = self.template_name.resolve(context)\n t = get_template(template_name)\n return t.render(context)\n if settings.TEMPLATE_DEBUG:\n raise\n return ''\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L149_C12", "label": "template_name = resolve()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [14, 3, 0.6804, 0.0046, 3, 0.7, 0.0, 522, 3, 1, 0, 0, 675, 10, 1], "semantic": {"name": "template_name", "arg_names": [], "import_names": [], "rhs_call_name": "resolve", "annotation": ""}, "snippet": " template_name = self.template_name.resolve(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L150_C12", "label": "t = get_template()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [14, 3, 0.6849, 0.0046, 3, 0.7, 0.25, 15, 3, 1, 0, 0, 27, 10, 1], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "get_template", "annotation": ""}, "snippet": " t = get_template(template_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L151_C12", "label": "return", "type": "return", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [13, 3, 0.6895, 0.0046, 3, 0.7, 0.5, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return t.render(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L152_C12", "label": "if", "type": "if", "loc": [152, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [4, 3, 0.6963, 0.0091, 3, 0.7, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings.TEMPLATE_DEBUG:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L154_C12", "label": "return", "type": "return", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [13, 3, 0.7032, 0.0046, 3, 0.7, 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_98995:Return_L156_C12", "label": "return", "type": "return", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "vector": [13, 3, 0.7123, 0.0046, 3, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '' # Fail silently for invalid included templates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "label": "do_block", "type": "function", "loc": [158, 176], "level": 0, "parent": null, "vector": [2, 0, 0.7626, 0.0868, 0, 0.66, 0.7222, 128, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "do_block", "arg_names": ["parser", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def do_block(parser, token):\n \"\"\"\n Define a block that can be overridden by child templates.\n \"\"\"\n bits = token.contents.split()\n if len(bits) != 2:\n raise TemplateSyntaxError(\"'%s' tag takes only one argument\" % bits[0])\n block_name = bits[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L159_C4", "label": "expression", "type": "expression", "loc": [159, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [8, 1, 0.7306, 0.0137, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Define a block that can be overridden by child templates.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L162_C4", "label": "bits = split()", "type": "assigned_variable", "loc": [162, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [14, 1, 0.7397, 0.0046, 1, 0.32, 0.1429, 593, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "bits", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " bits = token.contents.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L163_C4", "label": "if", "type": "if", "loc": [163, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [4, 1, 0.7466, 0.0091, 1, 0.32, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(bits) != 2:\n raise TemplateSyntaxError(\"'%s' tag takes only one argument\" % bits[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L165_C4", "label": "block_name =", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [14, 1, 0.7534, 0.0046, 1, 0.32, 0.4286, 526, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "block_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " block_name = bits[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "label": "try", "type": "try", "loc": [168, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [7, 1, 0.7785, 0.0274, 1, 0.32, 0.5714, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if block_name in parser.__loaded_blocks:\n raise TemplateSyntaxError(\"'%s' tag with name '%s' appears more than once\" % (bits[0], block_name))\n parser.__loaded_blocks.append(block_name)\n except AttributeError: # parser.__loaded_blocks isn't a list yet\n parser.__loaded_blocks = [block_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L169_C8", "label": "if", "type": "if", "loc": [169, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "vector": [4, 2, 0.774, 0.0091, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if block_name in parser.__loaded_blocks:\n raise TemplateSyntaxError(\"'%s' tag with name '%s' appears more than once\" % (bits[0], block_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L171_C8", "label": "append()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "vector": [8, 2, 0.7808, 0.0046, 2, 0.51, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parser.__loaded_blocks.append(block_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L173_C8", "label": "parser.__loaded_blocks =", "type": "assigned_variable", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "vector": [14, 2, 0.79, 0.0046, 2, 0.51, 0.0, 11, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "parser.__loaded_blocks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parser.__loaded_blocks = [block_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L174_C4", "label": "nodelist = parse()", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [14, 1, 0.7945, 0.0046, 1, 0.32, 0.7143, 507, 3, 1, 0, 0, 678, 10, 1], "semantic": {"name": "nodelist", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " nodelist = parser.parse(('endblock', 'endblock %s' % block_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L175_C4", "label": "delete_first_token()", "type": "expression", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [8, 1, 0.7991, 0.0046, 1, 0.32, 0.8571, 405, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "delete_first_token", "arg_names": [], "import_names": [], "rhs_call_name": "delete_first_token", "annotation": ""}, "snippet": " parser.delete_first_token()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L176_C4", "label": "return", "type": "return", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "vector": [13, 1, 0.8037, 0.0046, 1, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return BlockNode(block_name, nodelist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "label": "do_extends", "type": "function", "loc": [178, 199], "level": 0, "parent": null, "vector": [2, 0, 0.8607, 0.1005, 0, 0.66, 0.7778, 869, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "do_extends", "arg_names": ["parser", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def do_extends(parser, token):\n \"\"\"\n Signal that this template extends a parent template.\n\n This tag may be used in two ways: ``{% extends \"base\" %}`` (with quotes)\n uses the literal value \"base\" as the name of the parent template to extend,\n or ``{% extends variable %}`` uses the value of ``variable`` as either the\n name of the parent template to extend (if it evaluates to a string) or as"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L179_C4", "label": "expression", "type": "expression", "loc": [179, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [8, 1, 0.8356, 0.0411, 1, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Signal that this template extends a parent template.\n\n This tag may be used in two ways: ``{% extends \"base\" %}`` (with quotes)\n uses the literal value \"base\" as the name of the parent template to extend,\n or ``{% extends variable %}`` uses the value of ``variable`` as either the\n name of the parent template to extend (if it evaluates to a string) or as\n the parent tempate itelf (if it evaluates to a Template object)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L188_C4", "label": "bits = split_contents()", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [14, 1, 0.8584, 0.0046, 1, 0.26, 0.1429, 593, 3, 0, 0, 0, 28, 10, 1], "semantic": {"name": "bits", "arg_names": [], "import_names": [], "rhs_call_name": "split_contents", "annotation": ""}, "snippet": " bits = token.split_contents()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L189_C4", "label": "if", "type": "if", "loc": [189, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [4, 1, 0.8653, 0.0091, 1, 0.26, 0.2857, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(bits) != 2:\n raise TemplateSyntaxError(\"'%s' takes one argument\" % bits[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L191_C4", "label": "parent_name, parent_name_expr =", "type": "assigned_variable", "loc": [191, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [14, 1, 0.8721, 0.0046, 1, 0.26, 0.4286, 622, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "parent_name, parent_name_expr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parent_name, parent_name_expr = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4", "label": "if", "type": "if", "loc": [192, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [4, 1, 0.8836, 0.0183, 1, 0.26, 0.5714, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bits[1][0] in ('\"', \"'\") and bits[1][-1] == bits[1][0]:\n parent_name = bits[1][1:-1]\n else:\n parent_name_expr = parser.compile_filter(bits[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L193_C8", "label": "parent_name =", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4", "vector": [14, 2, 0.8813, 0.0046, 2, 0.43, 0.0, 159, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parent_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parent_name = bits[1][1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L195_C8", "label": "parent_name_expr = compile_filter()", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4", "vector": [14, 2, 0.8904, 0.0046, 2, 0.43, 1.0, 580, 3, 1, 0, 0, 511, 10, 1], "semantic": {"name": "parent_name_expr", "arg_names": [], "import_names": [], "rhs_call_name": "compile_filter", "annotation": ""}, "snippet": " parent_name_expr = parser.compile_filter(bits[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L196_C4", "label": "nodelist = parse()", "type": "assigned_variable", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [14, 1, 0.895, 0.0046, 1, 0.26, 0.7143, 507, 3, 0, 0, 0, 678, 10, 1], "semantic": {"name": "nodelist", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " nodelist = parser.parse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L197_C4", "label": "if", "type": "if", "loc": [197, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [4, 1, 0.9018, 0.0091, 1, 0.26, 0.8571, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if nodelist.get_nodes_by_type(ExtendsNode):\n raise TemplateSyntaxError(\"'%s' cannot appear more than once in the same template\" % bits[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L199_C4", "label": "return", "type": "return", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "vector": [13, 1, 0.9087, 0.0046, 1, 0.26, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ExtendsNode(nodelist, parent_name, parent_name_expr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "label": "do_include", "type": "function", "loc": [201, 215], "level": 0, "parent": null, "vector": [2, 0, 0.9498, 0.0685, 0, 0.66, 0.8333, 355, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "do_include", "arg_names": ["parser", "token"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def do_include(parser, token):\n \"\"\"\n Loads a template and renders it with the current context.\n\n Example::\n\n {% include \"foo/some_include\" %}\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L202_C4", "label": "expression", "type": "expression", "loc": [202, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [8, 1, 0.9361, 0.032, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Loads a template and renders it with the current context.\n\n Example::\n\n {% include \"foo/some_include\" %}\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L209_C4", "label": "bits = split_contents()", "type": "assigned_variable", "loc": [209, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [14, 1, 0.9543, 0.0046, 1, 0.24, 0.2, 593, 3, 0, 0, 0, 28, 10, 1], "semantic": {"name": "bits", "arg_names": [], "import_names": [], "rhs_call_name": "split_contents", "annotation": ""}, "snippet": " bits = token.split_contents()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L210_C4", "label": "if", "type": "if", "loc": [210, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [4, 1, 0.9612, 0.0091, 1, 0.24, 0.4, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(bits) != 2:\n raise TemplateSyntaxError(\"%r tag takes one argument: the name of the template to be included\" % bits[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L212_C4", "label": "path =", "type": "assigned_variable", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [14, 1, 0.968, 0.0046, 1, 0.24, 0.6, 358, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = bits[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L213_C4", "label": "if", "type": "if", "loc": [213, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [4, 1, 0.9749, 0.0091, 1, 0.24, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path[0] in ('\"', \"'\") and path[-1] == path[0]:\n return ConstantIncludeNode(path[1:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L214_C8", "label": "return", "type": "return", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L213_C4", "vector": [13, 2, 0.9772, 0.0046, 2, 0.46, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ConstantIncludeNode(path[1:-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L215_C4", "label": "return", "type": "return", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "vector": [13, 1, 0.9817, 0.0046, 1, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return IncludeNode(bits[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L217_C0", "label": "tag()", "type": "expression", "loc": [217, 217], "level": 0, "parent": null, "vector": [8, 0, 0.9909, 0.0046, 0, 0.66, 0.8889, 732, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "tag", "annotation": ""}, "snippet": "register.tag('block', do_block)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L218_C0", "label": "tag()", "type": "expression", "loc": [218, 218], "level": 0, "parent": null, "vector": [8, 0, 0.9954, 0.0046, 0, 0.66, 0.9444, 732, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "tag", "annotation": ""}, "snippet": "register.tag('extends', do_extends)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L219_C0", "label": "tag()", "type": "expression", "loc": [219, 219], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0046, 0, 0.66, 1.0, 732, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "tag", "annotation": ""}, "snippet": "register.tag('include', do_include)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L22_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L21_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L24_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:For_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L118_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L117_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L120_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:ClassDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:Try_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L158_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Assign_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:If_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98995:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98995:Return_L215_C4"}] |
"""
Extra HTML Widget classes
"""
import time
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
from django.conf import settings
__all__ = ('SelectDateWidget',)
RE_DATE = re.compile(r'(\d{4})-(\d\d?)-(\d\d?)$')
class SelectDateWidget(Widget):
"""
A Widget that splits date input into three <select> boxes.
This also serves as an example of a Widget that has more than one HTML
element and hence implements value_from_datadict.
"""
none_value = (0, '---')
month_field = '%s_month'
day_field = '%s_day'
year_field = '%s_year'
def __init__(self, attrs=None, years=None, required=True):
# years is an optional list/tuple of years to use in the "year" select box.
self.attrs = attrs or {}
self.required = required
if years:
self.years = years
else:
this_year = datetime.date.today().year
self.years = range(this_year, this_year+10)
def render(self, name, value, attrs=None):
try:
year_val, month_val, day_val = value.year, value.month, value.day
except AttributeError:
year_val = month_val = day_val = None
if isinstance(value, basestring):
if settings.USE_L10N:
try:
input_format = get_format('DATE_INPUT_FORMATS')[0]
# Python 2.4 compatibility:
# v = datetime.datetime.strptime(value, input_format)
# would be clearer, but datetime.strptime was added in
# Python 2.5
v = datetime.datetime(*(time.strptime(value, input_format)[0:6]))
year_val, month_val, day_val = v.year, v.month, v.day
except ValueError:
pass
else:
match = RE_DATE.match(value)
if match:
year_val, month_val, day_val = [int(v) for v in match.groups()]
choices = [(i, i) for i in self.years]
year_html = self.create_select(name, self.year_field, value, year_val, choices)
choices = MONTHS.items()
month_html = self.create_select(name, self.month_field, value, month_val, choices)
choices = [(i, i) for i in range(1, 32)]
day_html = self.create_select(name, self.day_field, value, day_val, choices)
format = get_format('DATE_FORMAT')
escaped = False
output = []
for char in format:
if escaped:
escaped = False
elif char == '\\':
escaped = True
elif char in 'Yy':
output.append(year_html)
elif char in 'bFMmNn':
output.append(month_html)
elif char in 'dj':
output.append(day_html)
return mark_safe(u'\n'.join(output))
def id_for_label(self, id_):
return '%s_month' % id_
id_for_label = classmethod(id_for_label)
def value_from_datadict(self, data, files, name):
y = data.get(self.year_field % name)
m = data.get(self.month_field % name)
d = data.get(self.day_field % name)
if y == m == d == "0":
return None
if y and m and d:
if settings.USE_L10N:
input_format = get_format('DATE_INPUT_FORMATS')[0]
try:
date_value = datetime.date(int(y), int(m), int(d))
except ValueError:
pass
else:
date_value = datetime_safe.new_date(date_value)
return date_value.strftime(input_format)
else:
return '%s-%s-%s' % (y, m, d)
return data.get(name, None)
def create_select(self, name, field, value, val, choices):
if 'id' in self.attrs:
id_ = self.attrs['id']
else:
id_ = 'id_%s' % name
if not (self.required and val):
choices.insert(0, self.none_value)
local_attrs = self.build_attrs(id=field % id_)
s = Select(choices=choices)
select_html = s.render(field % name, val, local_attrs)
return select_html
| ajibawa-2023/Python-Code-Large/train/row_98997 | 87 | 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_98997:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0165, 0.0248, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nExtra HTML Widget classes\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Import_L5_C0", "label": "time import time", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0413, 0.0083, 0, 0.66, 0.0833, 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_98997:Import_L6_C0", "label": "datetime import datetime", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0496, 0.0083, 0, 0.66, 0.1667, 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_98997:Import_L7_C0", "label": "re import re", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0579, 0.0083, 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_98997:ImportFrom_L9_C0", "label": "from django.forms.widgets import Widget, Select", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0744, 0.0083, 0, 0.66, 0.3333, 260, 0, 2, 0, 0, 260, 0, 0], "semantic": {"name": "django.forms.widgets", "arg_names": [], "import_names": ["Widget", "Select"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.forms.widgets import Widget, Select"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:ImportFrom_L10_C0", "label": "from django.utils import datetime_safe", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0826, 0.0083, 0, 0.66, 0.4167, 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_98997:ImportFrom_L11_C0", "label": "from django.utils.dates import MONTHS", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0083, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "django.utils.dates", "arg_names": [], "import_names": ["MONTHS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.dates import MONTHS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:ImportFrom_L12_C0", "label": "from django.utils.safestring import mark_safe", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0992, 0.0083, 0, 0.66, 0.5833, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.safestring", "arg_names": [], "import_names": ["mark_safe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.safestring import mark_safe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:ImportFrom_L13_C0", "label": "from django.utils.formats import get_format", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.1074, 0.0083, 0, 0.66, 0.6667, 246, 0, 1, 0, 0, 246, 0, 0], "semantic": {"name": "django.utils.formats", "arg_names": [], "import_names": ["get_format"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.formats import get_format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:ImportFrom_L14_C0", "label": "from django.conf import settings", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1157, 0.0083, 0, 0.66, 0.75, 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_98997:Assign_L16_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.1322, 0.0083, 0, 0.66, 0.8333, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ('SelectDateWidget',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L18_C0", "label": "RE_DATE = compile()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1488, 0.0083, 0, 0.66, 0.9167, 659, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "RE_DATE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "RE_DATE = re.compile(r'(\\d{4})-(\\d\\d?)-(\\d\\d?)$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "label": "SelectDateWidget", "type": "class", "loc": [20, 120], "level": 0, "parent": null, "vector": [3, 0, 0.5785, 0.8347, 0, 0.66, 1.0, 663, 0, 5, 0, 0, 969, 0, 36], "semantic": {"name": "SelectDateWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SelectDateWidget(Widget):\n \"\"\"\n A Widget that splits date input into three <select> boxes.\n\n This also serves as an example of a Widget that has more than one HTML\n element and hence implements value_from_datadict.\n \"\"\"\n none_value = (0, '---')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L21_C4", "label": "expression", "type": "expression", "loc": [21, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [8, 1, 0.1942, 0.0496, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A Widget that splits date input into three <select> boxes.\n\n This also serves as an example of a Widget that has more than one HTML\n element and hence implements value_from_datadict.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L27_C4", "label": "none_value =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [14, 1, 0.2231, 0.0083, 1, 0.55, 0.1, 655, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "none_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " none_value = (0, '---')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L28_C4", "label": "month_field =", "type": "assigned_variable", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [14, 1, 0.2314, 0.0083, 1, 0.55, 0.2, 461, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "month_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " month_field = '%s_month'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L29_C4", "label": "day_field =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [14, 1, 0.2397, 0.0083, 1, 0.55, 0.3, 990, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "day_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " day_field = '%s_day'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L30_C4", "label": "year_field =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [14, 1, 0.2479, 0.0083, 1, 0.55, 0.4, 971, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "year_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " year_field = '%s_year'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [2, 1, 0.2975, 0.0744, 1, 0.55, 0.5, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "years", "required"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, years=None, required=True):\n # years is an optional list/tuple of years to use in the \"year\" select box.\n self.attrs = attrs or {}\n self.required = required\n if years:\n self.years = years\n else:\n this_year = datetime.date.today().year"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L34_C8", "label": "self.attrs =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "vector": [14, 2, 0.281, 0.0083, 2, 0.74, 0.0, 793, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.attrs = attrs or {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L35_C8", "label": "self.required =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "vector": [14, 2, 0.2893, 0.0083, 2, 0.74, 0.5, 770, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.required = required"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "label": "if", "type": "if", "loc": [36, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "vector": [4, 2, 0.314, 0.0413, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if years:\n self.years = years\n else:\n this_year = datetime.date.today().year\n self.years = range(this_year, this_year+10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L37_C12", "label": "self.years =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "vector": [14, 3, 0.3058, 0.0083, 3, 0.16, 0.0, 695, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.years", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.years = years"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L39_C12", "label": "this_year =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "vector": [14, 3, 0.3223, 0.0083, 3, 0.16, 0.5, 187, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "this_year", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " this_year = datetime.date.today().year"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L40_C12", "label": "self.years = range()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "vector": [14, 3, 0.3306, 0.0083, 3, 0.16, 1.0, 695, 3, 2, 0, 0, 816, 10, 1], "semantic": {"name": "self.years", "arg_names": [], "import_names": [], "rhs_call_name": "range", "annotation": ""}, "snippet": " self.years = range(this_year, this_year+10)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "label": "render", "type": "function", "loc": [42, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [2, 1, 0.5207, 0.3554, 1, 0.55, 0.6, 24, 0, 4, 1, 0, 0, 0, 18], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n try:\n year_val, month_val, day_val = value.year, value.month, value.day\n except AttributeError:\n year_val = month_val = day_val = None\n if isinstance(value, basestring):\n if settings.USE_L10N:\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "label": "try", "type": "try", "loc": [43, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [7, 2, 0.4339, 0.1653, 2, 0.09, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n year_val, month_val, day_val = value.year, value.month, value.day\n except AttributeError:\n year_val = month_val = day_val = None\n if isinstance(value, basestring):\n if settings.USE_L10N:\n try:\n input_format = get_format('DATE_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L44_C12", "label": "year_val, month_val, day_val =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "vector": [14, 3, 0.3636, 0.0083, 3, 0.21, 0.0, 800, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "year_val, month_val, day_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " year_val, month_val, day_val = value.year, value.month, value.day"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L46_C12", "label": "year_val =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "vector": [14, 3, 0.3802, 0.0083, 3, 0.21, 0.0, 37, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "year_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " year_val = month_val = day_val = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L47_C12", "label": "if", "type": "if", "loc": [47, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "vector": [4, 3, 0.4504, 0.1322, 3, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, basestring):\n if settings.USE_L10N:\n try:\n input_format = get_format('DATE_INPUT_FORMATS')[0]\n # Python 2.4 compatibility:\n # v = datetime.datetime.strptime(value, input_format)\n # would be clearer, but datetime.strptime was added in \n # Python 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "label": "if", "type": "if", "loc": [48, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L47_C12", "vector": [4, 4, 0.4545, 0.124, 4, 0.47, 0.0, 0, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings.USE_L10N:\n try:\n input_format = get_format('DATE_INPUT_FORMATS')[0]\n # Python 2.4 compatibility:\n # v = datetime.datetime.strptime(value, input_format)\n # would be clearer, but datetime.strptime was added in \n # Python 2.5\n v = datetime.datetime(*(time.strptime(value, input_format)[0:6]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "label": "try", "type": "try", "loc": [49, 58], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "vector": [7, 5, 0.4421, 0.0826, 5, 0.3, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n input_format = get_format('DATE_INPUT_FORMATS')[0]\n # Python 2.4 compatibility:\n # v = datetime.datetime.strptime(value, input_format)\n # would be clearer, but datetime.strptime was added in \n # Python 2.5\n v = datetime.datetime(*(time.strptime(value, input_format)[0:6]))\n year_val, month_val, day_val = v.year, v.month, v.day"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L50_C24", "label": "input_format =", "type": "assigned_variable", "loc": [50, 50], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "vector": [14, 6, 0.4132, 0.0083, 6, 0.59, 0.0, 626, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_format = get_format('DATE_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L55_C24", "label": "v = datetime()", "type": "assigned_variable", "loc": [55, 55], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "vector": [14, 6, 0.4545, 0.0083, 6, 0.59, 0.5, 553, 3, 1, 0, 0, 426, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "datetime", "annotation": ""}, "snippet": " v = datetime.datetime(*(time.strptime(value, input_format)[0:6]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L56_C24", "label": "year_val, month_val, day_val =", "type": "assigned_variable", "loc": [56, 56], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "vector": [14, 6, 0.4628, 0.0083, 6, 0.59, 1.0, 800, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "year_val, month_val, day_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " year_val, month_val, day_val = v.year, v.month, v.day"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L60_C20", "label": "match = match()", "type": "assigned_variable", "loc": [60, 60], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "vector": [14, 5, 0.4959, 0.0083, 5, 0.3, 0.5, 36, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = RE_DATE.match(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L61_C20", "label": "if", "type": "if", "loc": [61, 62], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "vector": [4, 5, 0.5083, 0.0165, 5, 0.3, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match:\n year_val, month_val, day_val = [int(v) for v in match.groups()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L62_C24", "label": "year_val, month_val, day_val =", "type": "assigned_variable", "loc": [62, 62], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L61_C20", "vector": [14, 6, 0.5124, 0.0083, 6, 0.34, 0.0, 800, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "year_val, month_val, day_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " year_val, month_val, day_val = [int(v) for v in match.groups()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L63_C8", "label": "choices =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5207, 0.0083, 2, 0.09, 0.0909, 405, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "choices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " choices = [(i, i) for i in self.years]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L64_C8", "label": "year_html = create_select()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5289, 0.0083, 2, 0.09, 0.1818, 505, 3, 5, 0, 0, 954, 10, 1], "semantic": {"name": "year_html", "arg_names": [], "import_names": [], "rhs_call_name": "create_select", "annotation": ""}, "snippet": " year_html = self.create_select(name, self.year_field, value, year_val, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L65_C8", "label": "choices = items()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5372, 0.0083, 2, 0.09, 0.2727, 405, 3, 0, 0, 0, 339, 10, 1], "semantic": {"name": "choices", "arg_names": [], "import_names": [], "rhs_call_name": "items", "annotation": ""}, "snippet": " choices = MONTHS.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L66_C8", "label": "month_html = create_select()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5455, 0.0083, 2, 0.09, 0.3636, 801, 3, 5, 0, 0, 954, 10, 1], "semantic": {"name": "month_html", "arg_names": [], "import_names": [], "rhs_call_name": "create_select", "annotation": ""}, "snippet": " month_html = self.create_select(name, self.month_field, value, month_val, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L67_C8", "label": "choices =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5537, 0.0083, 2, 0.09, 0.4545, 405, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "choices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " choices = [(i, i) for i in range(1, 32)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L68_C8", "label": "day_html = create_select()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.562, 0.0083, 2, 0.09, 0.5455, 534, 3, 5, 0, 0, 954, 10, 1], "semantic": {"name": "day_html", "arg_names": [], "import_names": [], "rhs_call_name": "create_select", "annotation": ""}, "snippet": " day_html = self.create_select(name, self.day_field, value, day_val, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L70_C8", "label": "format = get_format()", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5785, 0.0083, 2, 0.09, 0.6364, 293, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "get_format", "annotation": ""}, "snippet": " format = get_format('DATE_FORMAT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L71_C8", "label": "escaped =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.5868, 0.0083, 2, 0.09, 0.7273, 658, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "escaped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escaped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L72_C8", "label": "output =", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [14, 2, 0.595, 0.0083, 2, 0.09, 0.8182, 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_98997:For_L73_C8", "label": "for char", "type": "for", "loc": [73, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [6, 2, 0.6446, 0.0909, 2, 0.09, 0.9091, 272, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "char", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for char in format:\n if escaped:\n escaped = False\n elif char == '\\\\':\n escaped = True\n elif char in 'Yy':\n output.append(year_html)\n elif char in 'bFMmNn':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12", "label": "if", "type": "if", "loc": [74, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:For_L73_C8", "vector": [4, 3, 0.6488, 0.0826, 3, 0.59, 0.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if escaped:\n escaped = False\n elif char == '\\\\':\n escaped = True\n elif char in 'Yy':\n output.append(year_html)\n elif char in 'bFMmNn':\n output.append(month_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L75_C16", "label": "escaped =", "type": "assigned_variable", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12", "vector": [14, 4, 0.6198, 0.0083, 4, 0.44, 0.0, 658, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "escaped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escaped = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12", "label": "if", "type": "if", "loc": [76, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12", "vector": [4, 4, 0.657, 0.0661, 4, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif char == '\\\\':\n escaped = True\n elif char in 'Yy':\n output.append(year_html)\n elif char in 'bFMmNn':\n output.append(month_html)\n elif char in 'dj':\n output.append(day_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L77_C16", "label": "escaped =", "type": "assigned_variable", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12", "vector": [14, 5, 0.6364, 0.0083, 5, 0.32, 0.0, 658, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "escaped", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " escaped = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12", "label": "if", "type": "if", "loc": [78, 83], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12", "vector": [4, 5, 0.6653, 0.0496, 5, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif char in 'Yy':\n output.append(year_html)\n elif char in 'bFMmNn':\n output.append(month_html)\n elif char in 'dj':\n output.append(day_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L79_C16", "label": "append()", "type": "expression", "loc": [79, 79], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12", "vector": [8, 6, 0.6529, 0.0083, 6, 0.78, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(year_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12", "label": "if", "type": "if", "loc": [80, 83], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12", "vector": [4, 6, 0.6736, 0.0331, 6, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif char in 'bFMmNn':\n output.append(month_html)\n elif char in 'dj':\n output.append(day_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L81_C16", "label": "append()", "type": "expression", "loc": [81, 81], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12", "vector": [8, 7, 0.6694, 0.0083, 7, 0.11, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(month_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L82_C12", "label": "if", "type": "if", "loc": [82, 83], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12", "vector": [4, 7, 0.6818, 0.0165, 7, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif char in 'dj':\n output.append(day_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L83_C16", "label": "append()", "type": "expression", "loc": [83, 83], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L82_C12", "vector": [8, 8, 0.686, 0.0083, 8, 0.08, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(day_html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "vector": [13, 2, 0.6942, 0.0083, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'\\n'.join(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L86_C4", "label": "id_for_label", "type": "function", "loc": [86, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [2, 1, 0.7149, 0.0165, 1, 0.55, 0.7, 952, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "id_for_label", "arg_names": ["self", "id_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def id_for_label(self, id_):\n return '%s_month' % id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L87_C8", "label": "return", "type": "return", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L86_C4", "vector": [13, 2, 0.719, 0.0083, 2, 0.24, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s_month' % id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L88_C4", "label": "id_for_label = classmethod()", "type": "assigned_variable", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [14, 1, 0.7273, 0.0083, 1, 0.55, 0.8, 952, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "id_for_label", "arg_names": [], "import_names": [], "rhs_call_name": "classmethod", "annotation": ""}, "snippet": " id_for_label = classmethod(id_for_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "label": "value_from_datadict", "type": "function", "loc": [90, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [2, 1, 0.8182, 0.157, 1, 0.55, 0.9, 272, 0, 4, 1, 0, 0, 0, 11], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n y = data.get(self.year_field % name)\n m = data.get(self.month_field % name)\n d = data.get(self.day_field % name)\n if y == m == d == \"0\":\n return None\n if y and m and d:\n if settings.USE_L10N:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L91_C8", "label": "y = get()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [14, 2, 0.7521, 0.0083, 2, 0.8, 0.0, 304, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "y", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " y = data.get(self.year_field % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L92_C8", "label": "m = get()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [14, 2, 0.7603, 0.0083, 2, 0.8, 0.2, 711, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " m = data.get(self.month_field % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L93_C8", "label": "d = get()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [14, 2, 0.7686, 0.0083, 2, 0.8, 0.4, 355, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " d = data.get(self.day_field % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [4, 2, 0.781, 0.0165, 2, 0.8, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if y == m == d == \"0\":\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L94_C8", "vector": [13, 3, 0.7851, 0.0083, 3, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L96_C8", "label": "if", "type": "if", "loc": [96, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [4, 2, 0.8388, 0.0992, 2, 0.8, 0.8, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if y and m and d:\n if settings.USE_L10N:\n input_format = get_format('DATE_INPUT_FORMATS')[0]\n try:\n date_value = datetime.date(int(y), int(m), int(d))\n except ValueError:\n pass\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "label": "if", "type": "if", "loc": [97, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L96_C8", "vector": [4, 3, 0.843, 0.0909, 3, 0.62, 0.0, 0, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings.USE_L10N:\n input_format = get_format('DATE_INPUT_FORMATS')[0]\n try:\n date_value = datetime.date(int(y), int(m), int(d))\n except ValueError:\n pass\n else:\n date_value = datetime_safe.new_date(date_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L98_C16", "label": "input_format =", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "vector": [14, 4, 0.8099, 0.0083, 4, 0.11, 0.0, 626, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_format = get_format('DATE_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "label": "try", "type": "try", "loc": [99, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "vector": [7, 4, 0.843, 0.0579, 4, 0.11, 0.5, 0, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n date_value = datetime.date(int(y), int(m), int(d))\n except ValueError:\n pass\n else:\n date_value = datetime_safe.new_date(date_value)\n return date_value.strftime(input_format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L100_C20", "label": "date_value = date()", "type": "assigned_variable", "loc": [100, 100], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "vector": [14, 5, 0.8264, 0.0083, 5, 0.86, 0.0, 573, 3, 3, 0, 0, 56, 10, 4], "semantic": {"name": "date_value", "arg_names": [], "import_names": [], "rhs_call_name": "date", "annotation": ""}, "snippet": " date_value = datetime.date(int(y), int(m), int(d))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L104_C20", "label": "date_value = new_date()", "type": "assigned_variable", "loc": [104, 104], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "vector": [14, 5, 0.8595, 0.0083, 5, 0.86, 0.5, 573, 3, 1, 0, 0, 584, 10, 1], "semantic": {"name": "date_value", "arg_names": [], "import_names": [], "rhs_call_name": "new_date", "annotation": ""}, "snippet": " date_value = datetime_safe.new_date(date_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L105_C20", "label": "return", "type": "return", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "vector": [13, 5, 0.8678, 0.0083, 5, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return date_value.strftime(input_format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L107_C16", "label": "return", "type": "return", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "vector": [13, 4, 0.8843, 0.0083, 4, 0.11, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s-%s-%s' % (y, m, d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "vector": [13, 2, 0.8926, 0.0083, 2, 0.8, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "label": "create_select", "type": "function", "loc": [110, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "vector": [2, 1, 0.9504, 0.0909, 1, 0.55, 1.0, 954, 0, 6, 1, 0, 0, 0, 4], "semantic": {"name": "create_select", "arg_names": ["self", "name", "field", "value", "val", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_select(self, name, field, value, val, choices):\n if 'id' in self.attrs:\n id_ = self.attrs['id']\n else:\n id_ = 'id_%s' % name\n if not (self.required and val):\n choices.insert(0, self.none_value)\n local_attrs = self.build_attrs(id=field % id_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8", "label": "if", "type": "if", "loc": [111, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [4, 2, 0.9298, 0.0331, 2, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'id' in self.attrs:\n id_ = self.attrs['id']\n else:\n id_ = 'id_%s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L112_C12", "label": "id_ =", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8", "vector": [14, 3, 0.9256, 0.0083, 3, 0.45, 0.0, 345, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id_ = self.attrs['id']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L114_C12", "label": "id_ =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8", "vector": [14, 3, 0.9421, 0.0083, 3, 0.45, 1.0, 345, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "id_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " id_ = 'id_%s' % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L115_C8", "label": "if", "type": "if", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [4, 2, 0.9545, 0.0165, 2, 0.94, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (self.required and val):\n choices.insert(0, self.none_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L116_C12", "label": "insert()", "type": "expression", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L115_C8", "vector": [8, 3, 0.9587, 0.0083, 3, 0.94, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " choices.insert(0, self.none_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L117_C8", "label": "local_attrs = build_attrs()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [14, 2, 0.9669, 0.0083, 2, 0.94, 0.4, 212, 3, 1, 0, 0, 588, 10, 1], "semantic": {"name": "local_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " local_attrs = self.build_attrs(id=field % id_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L118_C8", "label": "s = Select()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [14, 2, 0.9752, 0.0083, 2, 0.94, 0.6, 553, 3, 1, 0, 0, 366, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "Select", "annotation": ""}, "snippet": " s = Select(choices=choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L119_C8", "label": "select_html = render()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [14, 2, 0.9835, 0.0083, 2, 0.94, 0.8, 947, 3, 3, 0, 0, 24, 10, 1], "semantic": {"name": "select_html", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " select_html = s.render(field % name, val, local_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "vector": [13, 2, 0.9917, 0.0083, 2, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return select_html"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L50_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L55_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L49_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L56_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L60_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L48_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L61_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L61_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L62_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:For_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:For_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L74_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L77_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L76_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L82_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L83_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L100_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L104_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:Try_L99_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L105_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Expr_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_98997:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_98997:Return_L120_C8"}] |
from widgets import *
| ajibawa-2023/Python-Code-Large/train/row_98998 | 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_98998:ImportFrom_L1_C0", "label": "from widgets import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "widgets", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from widgets import *"}] | [] |
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
# Import ValidationError so that it can be imported from this
# module to maintain backwards compatibility.
from django.core.exceptions import ValidationError
def flatatt(attrs):
"""
Convert a dictionary of attributes to a single string.
The returned string will contain a leading space followed by key="value",
XML-style pairs. It is assumed that the keys do not need to be XML-escaped.
If the passed dictionary is empty, then return an empty string.
"""
return u''.join([u' %s="%s"' % (k, conditional_escape(v)) for k, v in attrs.items()])
class ErrorDict(dict, StrAndUnicode):
"""
A collection of errors that knows how to display itself in various formats.
The dictionary keys are the field names, and the values are the errors.
"""
def __unicode__(self):
return self.as_ul()
def as_ul(self):
if not self: return u''
return mark_safe(u'<ul class="errorlist">%s</ul>'
% ''.join([u'<li>%s%s</li>' % (k, force_unicode(v))
for k, v in self.items()]))
def as_text(self):
return u'\n'.join([u'* %s\n%s' % (k, u'\n'.join([u' * %s' % force_unicode(i) for i in v])) for k, v in self.items()])
class ErrorList(list, StrAndUnicode):
"""
A collection of errors that knows how to display itself in various formats.
"""
def __unicode__(self):
return self.as_ul()
def as_ul(self):
if not self: return u''
return mark_safe(u'<ul class="errorlist">%s</ul>'
% ''.join([u'<li>%s</li>' % conditional_escape(force_unicode(e)) for e in self]))
def as_text(self):
if not self: return u''
return u'\n'.join([u'* %s' % force_unicode(e) for e in self])
def __repr__(self):
return repr([force_unicode(e) for e in self])
| ajibawa-2023/Python-Code-Large/train/row_99001 | 31 | 54 | 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_99001:ImportFrom_L1_C0", "label": "from django.utils.html import conditional_escape", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0185, 0, 0.66, 0.0, 535, 0, 1, 0, 0, 535, 0, 0], "semantic": {"name": "django.utils.html", "arg_names": [], "import_names": ["conditional_escape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.html import conditional_escape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:ImportFrom_L2_C0", "label": "from django.utils.encoding import StrAndUnicode, force_unicode", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0185, 0, 0.66, 0.1667, 96, 0, 2, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["StrAndUnicode", "force_unicode"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.encoding import StrAndUnicode, force_unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:ImportFrom_L3_C0", "label": "from django.utils.safestring import mark_safe", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0556, 0.0185, 0, 0.66, 0.3333, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.safestring", "arg_names": [], "import_names": ["mark_safe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.safestring import mark_safe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:ImportFrom_L7_C0", "label": "from django.core.exceptions import ValidationError", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1296, 0.0185, 0, 0.66, 0.5, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["ValidationError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import ValidationError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L9_C0", "label": "flatatt", "type": "function", "loc": [9, 16], "level": 0, "parent": null, "vector": [2, 0, 0.2315, 0.1481, 0, 0.66, 0.6667, 701, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "flatatt", "arg_names": ["attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def flatatt(attrs):\n \"\"\"\n Convert a dictionary of attributes to a single string.\n The returned string will contain a leading space followed by key=\"value\",\n XML-style pairs. It is assumed that the keys do not need to be XML-escaped.\n If the passed dictionary is empty, then return an empty string.\n \"\"\"\n return u''.join([u' %s=\"%s\"' % (k, conditional_escape(v)) for k, v in attrs.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L10_C4", "label": "expression", "type": "expression", "loc": [10, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L9_C0", "vector": [8, 1, 0.2315, 0.1111, 1, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Convert a dictionary of attributes to a single string.\n The returned string will contain a leading space followed by key=\"value\",\n XML-style pairs. It is assumed that the keys do not need to be XML-escaped.\n If the passed dictionary is empty, then return an empty string.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L9_C0", "vector": [13, 1, 0.2963, 0.0185, 1, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u''.join([u' %s=\"%s\"' % (k, conditional_escape(v)) for k, v in attrs.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "label": "ErrorDict", "type": "class", "loc": [18, 34], "level": 0, "parent": null, "vector": [3, 0, 0.4815, 0.3148, 0, 0.66, 0.8333, 801, 0, 3, 0, 0, 827, 0, 9], "semantic": {"name": "ErrorDict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ErrorDict(dict, StrAndUnicode):\n \"\"\"\n A collection of errors that knows how to display itself in various formats.\n\n The dictionary keys are the field names, and the values are the errors.\n \"\"\"\n def __unicode__(self):\n return self.as_ul()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L19_C4", "label": "expression", "type": "expression", "loc": [19, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "vector": [8, 1, 0.3889, 0.0926, 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 A collection of errors that knows how to display itself in various formats.\n\n The dictionary keys are the field names, and the values are the errors.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L24_C4", "label": "__unicode__", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "vector": [2, 1, 0.4537, 0.037, 1, 0.64, 0.3333, 318, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n return self.as_ul()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L24_C4", "vector": [13, 2, 0.463, 0.0185, 2, 0.75, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.as_ul()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4", "label": "as_ul", "type": "function", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "vector": [2, 1, 0.537, 0.0926, 1, 0.64, 0.6667, 330, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "as_ul", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_ul(self):\n if not self: return u''\n return mark_safe(u'<ul class=\"errorlist\">%s</ul>'\n % ''.join([u'<li>%s%s</li>' % (k, force_unicode(v))\n for k, v in self.items()]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L28_C8", "label": "if", "type": "if", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4", "vector": [4, 2, 0.5185, 0.0185, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L28_C21", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L28_C8", "vector": [13, 3, 0.5185, 0.0185, 3, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4", "vector": [13, 2, 0.5556, 0.0556, 2, 0.68, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<ul class=\"errorlist\">%s</ul>'\n % ''.join([u'<li>%s%s</li>' % (k, force_unicode(v))\n for k, v in self.items()]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L33_C4", "label": "as_text", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "vector": [2, 1, 0.6204, 0.037, 1, 0.64, 1.0, 277, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "as_text", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_text(self):\n return u'\\n'.join([u'* %s\\n%s' % (k, u'\\n'.join([u' * %s' % force_unicode(i) for i in v])) for k, v in self.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L33_C4", "vector": [13, 2, 0.6296, 0.0185, 2, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'\\n'.join([u'* %s\\n%s' % (k, u'\\n'.join([u' * %s' % force_unicode(i) for i in v])) for k, v in self.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "label": "ErrorList", "type": "class", "loc": [36, 53], "level": 0, "parent": null, "vector": [3, 0, 0.8241, 0.3333, 0, 0.66, 1.0, 69, 0, 4, 0, 0, 430, 0, 9], "semantic": {"name": "ErrorList", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ErrorList(list, StrAndUnicode):\n \"\"\"\n A collection of errors that knows how to display itself in various formats.\n \"\"\"\n def __unicode__(self):\n return self.as_ul()\n\n def as_ul(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L37_C4", "label": "expression", "type": "expression", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "vector": [8, 1, 0.7037, 0.0556, 1, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A collection of errors that knows how to display itself in various formats.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L40_C4", "label": "__unicode__", "type": "function", "loc": [40, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "vector": [2, 1, 0.75, 0.037, 1, 0.22, 0.25, 318, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n return self.as_ul()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L41_C8", "label": "return", "type": "return", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L40_C4", "vector": [13, 2, 0.7593, 0.0185, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.as_ul()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4", "label": "as_ul", "type": "function", "loc": [43, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "vector": [2, 1, 0.8241, 0.0741, 1, 0.22, 0.5, 330, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "as_ul", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_ul(self):\n if not self: return u''\n return mark_safe(u'<ul class=\"errorlist\">%s</ul>'\n % ''.join([u'<li>%s</li>' % conditional_escape(force_unicode(e)) for e in self]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L44_C8", "label": "if", "type": "if", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4", "vector": [4, 2, 0.8148, 0.0185, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L44_C21", "label": "return", "type": "return", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L44_C8", "vector": [13, 3, 0.8148, 0.0185, 3, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4", "vector": [13, 2, 0.8426, 0.037, 2, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<ul class=\"errorlist\">%s</ul>'\n % ''.join([u'<li>%s</li>' % conditional_escape(force_unicode(e)) for e in self]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4", "label": "as_text", "type": "function", "loc": [48, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "vector": [2, 1, 0.9074, 0.0556, 1, 0.22, 0.75, 277, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "as_text", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_text(self):\n if not self: return u''\n return u'\\n'.join([u'* %s' % force_unicode(e) for e in self])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L49_C8", "label": "if", "type": "if", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4", "vector": [4, 2, 0.9074, 0.0185, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L49_C21", "label": "return", "type": "return", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L49_C8", "vector": [13, 3, 0.9074, 0.0185, 3, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self: return u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4", "vector": [13, 2, 0.9259, 0.0185, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'\\n'.join([u'* %s' % force_unicode(e) for e in self])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L52_C4", "label": "__repr__", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "vector": [2, 1, 0.9722, 0.037, 1, 0.22, 1.0, 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 return repr([force_unicode(e) for e in self])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L52_C4", "vector": [13, 2, 0.9815, 0.0185, 2, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr([force_unicode(e) for e in self])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L28_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L44_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L49_C21"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:ClassDef_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99001:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99001:Return_L53_C8"}] |
"""
HTML Widget classes
"""
import django.utils.copycompat as copy
from itertools import chain
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, conditional_escape
from django.utils.translation import ugettext, ugettext_lazy
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
from django.utils import datetime_safe, formats
import time
import datetime
from util import flatatt
from urlparse import urljoin
__all__ = (
'Media', 'MediaDefiningClass', 'Widget', 'TextInput', 'PasswordInput',
'HiddenInput', 'MultipleHiddenInput', 'ClearableFileInput',
'FileInput', 'DateInput', 'DateTimeInput', 'TimeInput', 'Textarea', 'CheckboxInput',
'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect',
'CheckboxSelectMultiple', 'MultiWidget',
'SplitDateTimeWidget',
)
MEDIA_TYPES = ('css','js')
class Media(StrAndUnicode):
def __init__(self, media=None, **kwargs):
if media:
media_attrs = media.__dict__
else:
media_attrs = kwargs
self._css = {}
self._js = []
for name in MEDIA_TYPES:
getattr(self, 'add_' + name)(media_attrs.get(name, None))
# Any leftover attributes must be invalid.
# if media_attrs != {}:
# raise TypeError("'class Media' has invalid attribute(s): %s" % ','.join(media_attrs.keys()))
def __unicode__(self):
return self.render()
def render(self):
return mark_safe(u'\n'.join(chain(*[getattr(self, 'render_' + name)() for name in MEDIA_TYPES])))
def render_js(self):
return [u'<script type="text/javascript" src="%s"></script>' % self.absolute_path(path) for path in self._js]
def render_css(self):
# To keep rendering order consistent, we can't just iterate over items().
# We need to sort the keys, and iterate over the sorted list.
media = self._css.keys()
media.sort()
return chain(*[
[u'<link href="%s" type="text/css" media="%s" rel="stylesheet" />' % (self.absolute_path(path), medium)
for path in self._css[medium]]
for medium in media])
def absolute_path(self, path):
if path.startswith(u'http://') or path.startswith(u'https://') or path.startswith(u'/'):
return path
return urljoin(settings.MEDIA_URL,path)
def __getitem__(self, name):
"Returns a Media object that only contains media of the given type"
if name in MEDIA_TYPES:
return Media(**{str(name): getattr(self, '_' + name)})
raise KeyError('Unknown media type "%s"' % name)
def add_js(self, data):
if data:
for path in data:
if path not in self._js:
self._js.append(path)
def add_css(self, data):
if data:
for medium, paths in data.items():
for path in paths:
if not self._css.get(medium) or path not in self._css[medium]:
self._css.setdefault(medium, []).append(path)
def __add__(self, other):
combined = Media()
for name in MEDIA_TYPES:
getattr(combined, 'add_' + name)(getattr(self, '_' + name, None))
getattr(combined, 'add_' + name)(getattr(other, '_' + name, None))
return combined
def media_property(cls):
def _media(self):
# Get the media property of the superclass, if it exists
if hasattr(super(cls, self), 'media'):
base = super(cls, self).media
else:
base = Media()
# Get the media definition for this class
definition = getattr(cls, 'Media', None)
if definition:
extend = getattr(definition, 'extend', True)
if extend:
if extend == True:
m = base
else:
m = Media()
for medium in extend:
m = m + base[medium]
return m + Media(definition)
else:
return Media(definition)
else:
return base
return property(_media)
class MediaDefiningClass(type):
"Metaclass for classes that can have media definitions"
def __new__(cls, name, bases, attrs):
new_class = super(MediaDefiningClass, cls).__new__(cls, name, bases,
attrs)
if 'media' not in attrs:
new_class.media = media_property(new_class)
return new_class
class Widget(object):
__metaclass__ = MediaDefiningClass
is_hidden = False # Determines whether this corresponds to an <input type="hidden">.
needs_multipart_form = False # Determines does this widget need multipart-encrypted form
is_localized = False
is_required = False
def __init__(self, attrs=None):
if attrs is not None:
self.attrs = attrs.copy()
else:
self.attrs = {}
def __deepcopy__(self, memo):
obj = copy.copy(self)
obj.attrs = self.attrs.copy()
memo[id(self)] = obj
return obj
def render(self, name, value, attrs=None):
"""
Returns this Widget rendered as HTML, as a Unicode string.
The 'value' given is not guaranteed to be valid input, so subclass
implementations should program defensively.
"""
raise NotImplementedError
def build_attrs(self, extra_attrs=None, **kwargs):
"Helper function for building an attribute dictionary."
attrs = dict(self.attrs, **kwargs)
if extra_attrs:
attrs.update(extra_attrs)
return attrs
def value_from_datadict(self, data, files, name):
"""
Given a dictionary of data and this widget's name, returns the value
of this widget. Returns None if it's not provided.
"""
return data.get(name, None)
def _has_changed(self, initial, data):
"""
Return True if data differs from initial.
"""
# For purposes of seeing whether something has changed, None is
# the same as an empty string, if the data or inital value we get
# is None, replace it w/ u''.
if data is None:
data_value = u''
else:
data_value = data
if initial is None:
initial_value = u''
else:
initial_value = initial
if force_unicode(initial_value) != force_unicode(data_value):
return True
return False
def id_for_label(self, id_):
"""
Returns the HTML ID attribute of this Widget for use by a <label>,
given the ID of the field. Returns None if no ID is available.
This hook is necessary because some widgets have multiple HTML
elements and, thus, multiple IDs. In that case, this method should
return an ID value that corresponds to the first ID in the widget's
tags.
"""
return id_
id_for_label = classmethod(id_for_label)
class Input(Widget):
"""
Base class for all <input> widgets (except type='checkbox' and
type='radio', which are special).
"""
input_type = None # Subclasses must define this.
def _format_value(self, value):
if self.is_localized:
return formats.localize_input(value)
return value
def render(self, name, value, attrs=None):
if value is None:
value = ''
final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
if value != '':
# Only add the 'value' attribute if a value is non-empty.
final_attrs['value'] = force_unicode(self._format_value(value))
return mark_safe(u'<input%s />' % flatatt(final_attrs))
class TextInput(Input):
input_type = 'text'
class PasswordInput(Input):
input_type = 'password'
def __init__(self, attrs=None, render_value=False):
super(PasswordInput, self).__init__(attrs)
self.render_value = render_value
def render(self, name, value, attrs=None):
if not self.render_value: value=None
return super(PasswordInput, self).render(name, value, attrs)
class HiddenInput(Input):
input_type = 'hidden'
is_hidden = True
class MultipleHiddenInput(HiddenInput):
"""
A widget that handles <input type="hidden"> for fields that have a list
of values.
"""
def __init__(self, attrs=None, choices=()):
super(MultipleHiddenInput, self).__init__(attrs)
# choices can be any iterable
self.choices = choices
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
id_ = final_attrs.get('id', None)
inputs = []
for i, v in enumerate(value):
input_attrs = dict(value=force_unicode(v), **final_attrs)
if id_:
# An ID attribute was given. Add a numeric index as a suffix
# so that the inputs don't all have the same ID attribute.
input_attrs['id'] = '%s_%s' % (id_, i)
inputs.append(u'<input%s />' % flatatt(input_attrs))
return mark_safe(u'\n'.join(inputs))
def value_from_datadict(self, data, files, name):
if isinstance(data, (MultiValueDict, MergeDict)):
return data.getlist(name)
return data.get(name, None)
class FileInput(Input):
input_type = 'file'
needs_multipart_form = True
def render(self, name, value, attrs=None):
return super(FileInput, self).render(name, None, attrs=attrs)
def value_from_datadict(self, data, files, name):
"File widgets take data from FILES, not POST"
return files.get(name, None)
def _has_changed(self, initial, data):
if data is None:
return False
return True
FILE_INPUT_CONTRADICTION = object()
class ClearableFileInput(FileInput):
initial_text = ugettext_lazy('Currently')
input_text = ugettext_lazy('Change')
clear_checkbox_label = ugettext_lazy('Clear')
template_with_initial = u'%(initial_text)s: %(initial)s %(clear_template)s<br />%(input_text)s: %(input)s'
template_with_clear = u'%(clear)s <label for="%(clear_checkbox_id)s">%(clear_checkbox_label)s</label>'
def clear_checkbox_name(self, name):
"""
Given the name of the file input, return the name of the clear checkbox
input.
"""
return name + '-clear'
def clear_checkbox_id(self, name):
"""
Given the name of the clear checkbox input, return the HTML id for it.
"""
return name + '_id'
def render(self, name, value, attrs=None):
substitutions = {
'initial_text': self.initial_text,
'input_text': self.input_text,
'clear_template': '',
'clear_checkbox_label': self.clear_checkbox_label,
}
template = u'%(input)s'
substitutions['input'] = super(ClearableFileInput, self).render(name, value, attrs)
if value and hasattr(value, "url"):
template = self.template_with_initial
substitutions['initial'] = (u'<a target="_blank" href="%s">%s</a>'
% (value.url, value))
if not self.is_required:
checkbox_name = self.clear_checkbox_name(name)
checkbox_id = self.clear_checkbox_id(checkbox_name)
substitutions['clear_checkbox_name'] = checkbox_name
substitutions['clear_checkbox_id'] = checkbox_id
substitutions['clear'] = CheckboxInput().render(checkbox_name, False, attrs={'id': checkbox_id})
substitutions['clear_template'] = self.template_with_clear % substitutions
return mark_safe(template % substitutions)
def value_from_datadict(self, data, files, name):
upload = super(ClearableFileInput, self).value_from_datadict(data, files, name)
if not self.is_required and CheckboxInput().value_from_datadict(
data, files, self.clear_checkbox_name(name)):
if upload:
# If the user contradicts themselves (uploads a new file AND
# checks the "clear" checkbox), we return a unique marker
# object that FileField will turn into a ValidationError.
return FILE_INPUT_CONTRADICTION
# False signals to clear any existing value, as opposed to just None
return False
return upload
class Textarea(Widget):
def __init__(self, attrs=None):
# The 'rows' and 'cols' attributes are required for HTML correctness.
default_attrs = {'cols': '40', 'rows': '10'}
if attrs:
default_attrs.update(attrs)
super(Textarea, self).__init__(default_attrs)
def render(self, name, value, attrs=None):
if value is None: value = ''
final_attrs = self.build_attrs(attrs, name=name)
return mark_safe(u'<textarea%s>%s</textarea>' % (flatatt(final_attrs),
conditional_escape(force_unicode(value))))
class DateInput(Input):
input_type = 'text'
format = '%Y-%m-%d' # '2006-10-25'
def __init__(self, attrs=None, format=None):
super(DateInput, self).__init__(attrs)
if format:
self.format = format
self.manual_format = True
else:
self.format = formats.get_format('DATE_INPUT_FORMATS')[0]
self.manual_format = False
def _format_value(self, value):
if self.is_localized and not self.manual_format:
return formats.localize_input(value)
elif hasattr(value, 'strftime'):
value = datetime_safe.new_date(value)
return value.strftime(self.format)
return value
def _has_changed(self, initial, data):
# If our field has show_hidden_initial=True, initial will be a string
# formatted by HiddenInput using formats.localize_input, which is not
# necessarily the format used for this widget. Attempt to convert it.
try:
input_format = formats.get_format('DATE_INPUT_FORMATS')[0]
initial = datetime.date(*time.strptime(initial, input_format)[:3])
except (TypeError, ValueError):
pass
return super(DateInput, self)._has_changed(self._format_value(initial), data)
class DateTimeInput(Input):
input_type = 'text'
format = '%Y-%m-%d %H:%M:%S' # '2006-10-25 14:30:59'
def __init__(self, attrs=None, format=None):
super(DateTimeInput, self).__init__(attrs)
if format:
self.format = format
self.manual_format = True
else:
self.format = formats.get_format('DATETIME_INPUT_FORMATS')[0]
self.manual_format = False
def _format_value(self, value):
if self.is_localized and not self.manual_format:
return formats.localize_input(value)
elif hasattr(value, 'strftime'):
value = datetime_safe.new_datetime(value)
return value.strftime(self.format)
return value
def _has_changed(self, initial, data):
# If our field has show_hidden_initial=True, initial will be a string
# formatted by HiddenInput using formats.localize_input, which is not
# necessarily the format used for this widget. Attempt to convert it.
try:
input_format = formats.get_format('DATETIME_INPUT_FORMATS')[0]
initial = datetime.datetime(*time.strptime(initial, input_format)[:6])
except (TypeError, ValueError):
pass
return super(DateTimeInput, self)._has_changed(self._format_value(initial), data)
class TimeInput(Input):
input_type = 'text'
format = '%H:%M:%S' # '14:30:59'
def __init__(self, attrs=None, format=None):
super(TimeInput, self).__init__(attrs)
if format:
self.format = format
self.manual_format = True
else:
self.format = formats.get_format('TIME_INPUT_FORMATS')[0]
self.manual_format = False
def _format_value(self, value):
if self.is_localized and not self.manual_format:
return formats.localize_input(value)
elif hasattr(value, 'strftime'):
return value.strftime(self.format)
return value
def _has_changed(self, initial, data):
# If our field has show_hidden_initial=True, initial will be a string
# formatted by HiddenInput using formats.localize_input, which is not
# necessarily the format used for this widget. Attempt to convert it.
try:
input_format = formats.get_format('TIME_INPUT_FORMATS')[0]
initial = datetime.time(*time.strptime(initial, input_format)[3:6])
except (TypeError, ValueError):
pass
return super(TimeInput, self)._has_changed(self._format_value(initial), data)
class CheckboxInput(Widget):
def __init__(self, attrs=None, check_test=bool):
super(CheckboxInput, self).__init__(attrs)
# check_test is a callable that takes a value and returns True
# if the checkbox should be checked for that value.
self.check_test = check_test
def render(self, name, value, attrs=None):
final_attrs = self.build_attrs(attrs, type='checkbox', name=name)
try:
result = self.check_test(value)
except: # Silently catch exceptions
result = False
if result:
final_attrs['checked'] = 'checked'
if value not in ('', True, False, None):
# Only add the 'value' attribute if a value is non-empty.
final_attrs['value'] = force_unicode(value)
return mark_safe(u'<input%s />' % flatatt(final_attrs))
def value_from_datadict(self, data, files, name):
if name not in data:
# A missing value means False because HTML form submission does not
# send results for unselected checkboxes.
return False
value = data.get(name)
# Translate true and false strings to boolean values.
values = {'true': True, 'false': False}
if isinstance(value, basestring):
value = values.get(value.lower(), value)
return value
def _has_changed(self, initial, data):
# Sometimes data or initial could be None or u'' which should be the
# same thing as False.
return bool(initial) != bool(data)
class Select(Widget):
def __init__(self, attrs=None, choices=()):
super(Select, self).__init__(attrs)
# choices can be any iterable, but we may need to render this widget
# multiple times. Thus, collapse it into a list so it can be consumed
# more than once.
self.choices = list(choices)
def render(self, name, value, attrs=None, choices=()):
if value is None: value = ''
final_attrs = self.build_attrs(attrs, name=name)
output = [u'<select%s>' % flatatt(final_attrs)]
options = self.render_options(choices, [value])
if options:
output.append(options)
output.append(u'</select>')
return mark_safe(u'\n'.join(output))
def render_option(self, selected_choices, option_value, option_label):
option_value = force_unicode(option_value)
selected_html = (option_value in selected_choices) and u' selected="selected"' or ''
return u'<option value="%s"%s>%s</option>' % (
escape(option_value), selected_html,
conditional_escape(force_unicode(option_label)))
def render_options(self, choices, selected_choices):
# Normalize to strings.
selected_choices = set([force_unicode(v) for v in selected_choices])
output = []
for option_value, option_label in chain(self.choices, choices):
if isinstance(option_label, (list, tuple)):
output.append(u'<optgroup label="%s">' % escape(force_unicode(option_value)))
for option in option_label:
output.append(self.render_option(selected_choices, *option))
output.append(u'</optgroup>')
else:
output.append(self.render_option(selected_choices, option_value, option_label))
return u'\n'.join(output)
class NullBooleanSelect(Select):
"""
A Select Widget intended to be used with NullBooleanField.
"""
def __init__(self, attrs=None):
choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No')))
super(NullBooleanSelect, self).__init__(attrs, choices)
def render(self, name, value, attrs=None, choices=()):
try:
value = {True: u'2', False: u'3', u'2': u'2', u'3': u'3'}[value]
except KeyError:
value = u'1'
return super(NullBooleanSelect, self).render(name, value, attrs, choices)
def value_from_datadict(self, data, files, name):
value = data.get(name, None)
return {u'2': True,
True: True,
'True': True,
u'3': False,
'False': False,
False: False}.get(value, None)
def _has_changed(self, initial, data):
# For a NullBooleanSelect, None (unknown) and False (No)
# are not the same
if initial is not None:
initial = bool(initial)
if data is not None:
data = bool(data)
return initial != data
class SelectMultiple(Select):
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
final_attrs = self.build_attrs(attrs, name=name)
output = [u'<select multiple="multiple"%s>' % flatatt(final_attrs)]
options = self.render_options(choices, value)
if options:
output.append(options)
output.append('</select>')
return mark_safe(u'\n'.join(output))
def value_from_datadict(self, data, files, name):
if isinstance(data, (MultiValueDict, MergeDict)):
return data.getlist(name)
return data.get(name, None)
def _has_changed(self, initial, data):
if initial is None:
initial = []
if data is None:
data = []
if len(initial) != len(data):
return True
for value1, value2 in zip(initial, data):
if force_unicode(value1) != force_unicode(value2):
return True
return False
class RadioInput(StrAndUnicode):
"""
An object used by RadioFieldRenderer that represents a single
<input type='radio'>.
"""
def __init__(self, name, value, attrs, choice, index):
self.name, self.value = name, value
self.attrs = attrs
self.choice_value = force_unicode(choice[0])
self.choice_label = force_unicode(choice[1])
self.index = index
def __unicode__(self):
if 'id' in self.attrs:
label_for = ' for="%s_%s"' % (self.attrs['id'], self.index)
else:
label_for = ''
choice_label = conditional_escape(force_unicode(self.choice_label))
return mark_safe(u'<label%s>%s %s</label>' % (label_for, self.tag(), choice_label))
def is_checked(self):
return self.value == self.choice_value
def tag(self):
if 'id' in self.attrs:
self.attrs['id'] = '%s_%s' % (self.attrs['id'], self.index)
final_attrs = dict(self.attrs, type='radio', name=self.name, value=self.choice_value)
if self.is_checked():
final_attrs['checked'] = 'checked'
return mark_safe(u'<input%s />' % flatatt(final_attrs))
class RadioFieldRenderer(StrAndUnicode):
"""
An object used by RadioSelect to enable customization of radio widgets.
"""
def __init__(self, name, value, attrs, choices):
self.name, self.value, self.attrs = name, value, attrs
self.choices = choices
def __iter__(self):
for i, choice in enumerate(self.choices):
yield RadioInput(self.name, self.value, self.attrs.copy(), choice, i)
def __getitem__(self, idx):
choice = self.choices[idx] # Let the IndexError propogate
return RadioInput(self.name, self.value, self.attrs.copy(), choice, idx)
def __unicode__(self):
return self.render()
def render(self):
"""Outputs a <ul> for this set of radio fields."""
return mark_safe(u'<ul>\n%s\n</ul>' % u'\n'.join([u'<li>%s</li>'
% force_unicode(w) for w in self]))
class RadioSelect(Select):
renderer = RadioFieldRenderer
def __init__(self, *args, **kwargs):
# Override the default renderer if we were passed one.
renderer = kwargs.pop('renderer', None)
if renderer:
self.renderer = renderer
super(RadioSelect, self).__init__(*args, **kwargs)
def get_renderer(self, name, value, attrs=None, choices=()):
"""Returns an instance of the renderer."""
if value is None: value = ''
str_value = force_unicode(value) # Normalize to string.
final_attrs = self.build_attrs(attrs)
choices = list(chain(self.choices, choices))
return self.renderer(name, str_value, final_attrs, choices)
def render(self, name, value, attrs=None, choices=()):
return self.get_renderer(name, value, attrs, choices).render()
def id_for_label(self, id_):
# RadioSelect is represented by multiple <input type="radio"> fields,
# each of which has a distinct ID. The IDs are made distinct by a "_X"
# suffix, where X is the zero-based index of the radio field. Thus,
# the label for a RadioSelect should reference the first one ('_0').
if id_:
id_ += '_0'
return id_
id_for_label = classmethod(id_for_label)
class CheckboxSelectMultiple(SelectMultiple):
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
output = [u'<ul>']
# Normalize to strings
str_values = set([force_unicode(v) for v in value])
for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):
# If an ID attribute was given, add a numeric index as a suffix,
# so that the checkboxes don't all have the same ID attribute.
if has_id:
final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))
label_for = u' for="%s"' % final_attrs['id']
else:
label_for = ''
cb = CheckboxInput(final_attrs, check_test=lambda value: value in str_values)
option_value = force_unicode(option_value)
rendered_cb = cb.render(name, option_value)
option_label = conditional_escape(force_unicode(option_label))
output.append(u'<li><label%s>%s %s</label></li>' % (label_for, rendered_cb, option_label))
output.append(u'</ul>')
return mark_safe(u'\n'.join(output))
def id_for_label(self, id_):
# See the comment for RadioSelect.id_for_label()
if id_:
id_ += '_0'
return id_
id_for_label = classmethod(id_for_label)
class MultiWidget(Widget):
"""
A widget that is composed of multiple widgets.
Its render() method is different than other widgets', because it has to
figure out how to split a single value for display in multiple widgets.
The ``value`` argument can be one of two things:
* A list.
* A normal value (e.g., a string) that has been "compressed" from
a list of values.
In the second case -- i.e., if the value is NOT a list -- render() will
first "decompress" the value into a list before rendering it. It does so by
calling the decompress() method, which MultiWidget subclasses must
implement. This method takes a single "compressed" value and returns a
list.
When render() does its HTML rendering, each value in the list is rendered
with the corresponding widget -- the first value is rendered in the first
widget, the second value is rendered in the second widget, etc.
Subclasses may implement format_output(), which takes the list of rendered
widgets and returns a string of HTML that formats them any way you'd like.
You'll probably want to use this class with MultiValueField.
"""
def __init__(self, widgets, attrs=None):
self.widgets = [isinstance(w, type) and w() or w for w in widgets]
super(MultiWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):
if self.is_localized:
for widget in self.widgets:
widget.is_localized = self.is_localized
# value is a list of values, each corresponding to a widget
# in self.widgets.
if not isinstance(value, list):
value = self.decompress(value)
output = []
final_attrs = self.build_attrs(attrs)
id_ = final_attrs.get('id', None)
for i, widget in enumerate(self.widgets):
try:
widget_value = value[i]
except IndexError:
widget_value = None
if id_:
final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))
output.append(widget.render(name + '_%s' % i, widget_value, final_attrs))
return mark_safe(self.format_output(output))
def id_for_label(self, id_):
# See the comment for RadioSelect.id_for_label()
if id_:
id_ += '_0'
return id_
id_for_label = classmethod(id_for_label)
def value_from_datadict(self, data, files, name):
return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]
def _has_changed(self, initial, data):
if initial is None:
initial = [u'' for x in range(0, len(data))]
else:
if not isinstance(initial, list):
initial = self.decompress(initial)
for widget, initial, data in zip(self.widgets, initial, data):
if widget._has_changed(initial, data):
return True
return False
def format_output(self, rendered_widgets):
"""
Given a list of rendered widgets (as strings), returns a Unicode string
representing the HTML for the whole lot.
This hook allows you to format the HTML design of the widgets, if
needed.
"""
return u''.join(rendered_widgets)
def decompress(self, value):
"""
Returns a list of decompressed values for the given compressed value.
The given value can be assumed to be valid, but not necessarily
non-empty.
"""
raise NotImplementedError('Subclasses must implement this method.')
def _get_media(self):
"Media for a multiwidget is the combination of all media of the subwidgets"
media = Media()
for w in self.widgets:
media = media + w.media
return media
media = property(_get_media)
def __deepcopy__(self, memo):
obj = super(MultiWidget, self).__deepcopy__(memo)
obj.widgets = copy.deepcopy(self.widgets)
return obj
class SplitDateTimeWidget(MultiWidget):
"""
A Widget that splits datetime input into two <input type="text"> boxes.
"""
date_format = DateInput.format
time_format = TimeInput.format
def __init__(self, attrs=None, date_format=None, time_format=None):
widgets = (DateInput(attrs=attrs, format=date_format),
TimeInput(attrs=attrs, format=time_format))
super(SplitDateTimeWidget, self).__init__(widgets, attrs)
def decompress(self, value):
if value:
return [value.date(), value.time().replace(microsecond=0)]
return [None, None]
class SplitHiddenDateTimeWidget(SplitDateTimeWidget):
"""
A Widget that splits datetime input into two <input type="hidden"> inputs.
"""
is_hidden = True
def __init__(self, attrs=None, date_format=None, time_format=None):
super(SplitHiddenDateTimeWidget, self).__init__(attrs, date_format, time_format)
for widget in self.widgets:
widget.input_type = 'hidden'
widget.is_hidden = True
| ajibawa-2023/Python-Code-Large/train/row_99002 | 552 | 848 | 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_99002:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0024, 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": "\"\"\"\nHTML Widget classes\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Import_L5_C0", "label": "django.utils.copycompat import copy", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0059, 0.0012, 0, 0.66, 0.0238, 125, 0, 1, 0, 0, 125, 0, 0], "semantic": {"name": "django.utils.copycompat", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import django.utils.copycompat as copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L6_C0", "label": "from itertools import chain", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0071, 0.0012, 0, 0.66, 0.0476, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["chain"], "rhs_call_name": "", "annotation": ""}, "snippet": "from itertools import chain"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L7_C0", "label": "from django.conf import settings", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0083, 0.0012, 0, 0.66, 0.0714, 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_99002:ImportFrom_L8_C0", "label": "from django.utils.datastructures import MultiValueDict, MergeDict", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0094, 0.0012, 0, 0.66, 0.0952, 757, 0, 2, 0, 0, 757, 0, 0], "semantic": {"name": "django.utils.datastructures", "arg_names": [], "import_names": ["MultiValueDict", "MergeDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.datastructures import MultiValueDict, MergeDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L9_C0", "label": "from django.utils.html import escape, conditional_escape", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0106, 0.0012, 0, 0.66, 0.119, 535, 0, 2, 0, 0, 535, 0, 0], "semantic": {"name": "django.utils.html", "arg_names": [], "import_names": ["escape", "conditional_escape"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.html import escape, conditional_escape"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L10_C0", "label": "from django.utils.translation import ugettext, ugettext_lazy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0118, 0.0012, 0, 0.66, 0.1429, 389, 0, 2, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names": [], "import_names": ["ugettext", "ugettext_lazy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.translation import ugettext, ugettext_lazy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L11_C0", "label": "from django.utils.encoding import StrAndUnicode, force_unicode", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.013, 0.0012, 0, 0.66, 0.1667, 96, 0, 2, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["StrAndUnicode", "force_unicode"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.encoding import StrAndUnicode, force_unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L12_C0", "label": "from django.utils.safestring import mark_safe", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0142, 0.0012, 0, 0.66, 0.1905, 375, 0, 1, 0, 0, 375, 0, 0], "semantic": {"name": "django.utils.safestring", "arg_names": [], "import_names": ["mark_safe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.safestring import mark_safe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L13_C0", "label": "from django.utils import datetime_safe, formats", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0153, 0.0012, 0, 0.66, 0.2143, 944, 0, 2, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["datetime_safe", "formats"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import datetime_safe, formats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Import_L14_C0", "label": "time import time", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0165, 0.0012, 0, 0.66, 0.2381, 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_99002:Import_L15_C0", "label": "datetime import datetime", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0177, 0.0012, 0, 0.66, 0.2619, 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_99002:ImportFrom_L16_C0", "label": "from util import flatatt", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0189, 0.0012, 0, 0.66, 0.2857, 811, 0, 1, 0, 0, 811, 0, 0], "semantic": {"name": "util", "arg_names": [], "import_names": ["flatatt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from util import flatatt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ImportFrom_L17_C0", "label": "from urlparse import urljoin", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.02, 0.0012, 0, 0.66, 0.3095, 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_99002:Assign_L19_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [19, 26], "level": 0, "parent": null, "vector": [14, 0, 0.0265, 0.0094, 0, 0.66, 0.3333, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = (\n 'Media', 'MediaDefiningClass', 'Widget', 'TextInput', 'PasswordInput',\n 'HiddenInput', 'MultipleHiddenInput', 'ClearableFileInput',\n 'FileInput', 'DateInput', 'DateTimeInput', 'TimeInput', 'Textarea', 'CheckboxInput',\n 'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect',\n 'CheckboxSelectMultiple', 'MultiWidget',\n 'SplitDateTimeWidget',\n)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L28_C0", "label": "MEDIA_TYPES =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.033, 0.0012, 0, 0.66, 0.3571, 674, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "MEDIA_TYPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MEDIA_TYPES = ('css','js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "label": "Media", "type": "class", "loc": [30, 95], "level": 0, "parent": null, "vector": [3, 0, 0.0737, 0.0778, 0, 0.66, 0.381, 185, 0, 10, 0, 0, 599, 0, 34], "semantic": {"name": "Media", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Media(StrAndUnicode):\n def __init__(self, media=None, **kwargs):\n if media:\n media_attrs = media.__dict__\n else:\n media_attrs = kwargs\n\n self._css = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "label": "__init__", "type": "function", "loc": [31, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0425, 0.013, 1, 0.18, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "media", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, media=None, **kwargs):\n if media:\n media_attrs = media.__dict__\n else:\n media_attrs = kwargs\n\n self._css = {}\n self._js = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8", "label": "if", "type": "if", "loc": [32, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "vector": [4, 2, 0.0395, 0.0047, 2, 0.79, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if media:\n media_attrs = media.__dict__\n else:\n media_attrs = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L33_C12", "label": "media_attrs =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8", "vector": [14, 3, 0.0389, 0.0012, 3, 0.44, 0.0, 608, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "media_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " media_attrs = media.__dict__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L35_C12", "label": "media_attrs =", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8", "vector": [14, 3, 0.0413, 0.0012, 3, 0.44, 1.0, 608, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "media_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " media_attrs = kwargs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L37_C8", "label": "self._css =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "vector": [14, 2, 0.0436, 0.0012, 2, 0.79, 0.3333, 616, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._css", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._css = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L38_C8", "label": "self._js =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "vector": [14, 2, 0.0448, 0.0012, 2, 0.79, 0.6667, 117, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._js", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._js = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L40_C8", "label": "for name", "type": "for", "loc": [40, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "vector": [6, 2, 0.0478, 0.0024, 2, 0.79, 1.0, 57, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in MEDIA_TYPES:\n getattr(self, 'add_' + name)(media_attrs.get(name, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L41_C12", "label": "expression", "type": "expression", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L40_C8", "vector": [8, 3, 0.0483, 0.0012, 3, 0.09, 0.0, 0, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " getattr(self, 'add_' + name)(media_attrs.get(name, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L47_C4", "label": "__unicode__", "type": "function", "loc": [47, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.056, 0.0024, 1, 0.18, 0.1111, 318, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n return self.render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L48_C8", "label": "return", "type": "return", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L47_C4", "vector": [13, 2, 0.0566, 0.0012, 2, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L50_C4", "label": "render", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0596, 0.0024, 1, 0.18, 0.2222, 24, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "render", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self):\n return mark_safe(u'\\n'.join(chain(*[getattr(self, 'render_' + name)() for name in MEDIA_TYPES])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L50_C4", "vector": [13, 2, 0.0601, 0.0012, 2, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'\\n'.join(chain(*[getattr(self, 'render_' + name)() for name in MEDIA_TYPES])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L53_C4", "label": "render_js", "type": "function", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0631, 0.0024, 1, 0.18, 0.3333, 425, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "render_js", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render_js(self):\n return [u'<script type=\"text/javascript\" src=\"%s\"></script>' % self.absolute_path(path) for path in self._js]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L53_C4", "vector": [13, 2, 0.0637, 0.0012, 2, 0.79, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [u'<script type=\"text/javascript\" src=\"%s\"></script>' % self.absolute_path(path) for path in self._js]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "label": "render_css", "type": "function", "loc": [56, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0708, 0.0106, 1, 0.18, 0.4444, 100, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "render_css", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render_css(self):\n # To keep rendering order consistent, we can't just iterate over items().\n # We need to sort the keys, and iterate over the sorted list.\n media = self._css.keys()\n media.sort()\n return chain(*[\n [u'<link href=\"%s\" type=\"text/css\" media=\"%s\" rel=\"stylesheet\" />' % (self.absolute_path(path), medium)\n for path in self._css[medium]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L59_C8", "label": "media = keys()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "vector": [14, 2, 0.0696, 0.0012, 2, 0.55, 0.0, 317, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "media", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " media = self._css.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L60_C8", "label": "sort()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "vector": [8, 2, 0.0708, 0.0012, 2, 0.55, 0.5, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " media.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "vector": [13, 2, 0.0737, 0.0047, 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 chain(*[\n [u'<link href=\"%s\" type=\"text/css\" media=\"%s\" rel=\"stylesheet\" />' % (self.absolute_path(path), medium)\n for path in self._css[medium]]\n for medium in media])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4", "label": "absolute_path", "type": "function", "loc": [66, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0796, 0.0047, 1, 0.18, 0.5556, 854, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "absolute_path", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def absolute_path(self, path):\n if path.startswith(u'http://') or path.startswith(u'https://') or path.startswith(u'/'):\n return path\n return urljoin(settings.MEDIA_URL,path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L67_C8", "label": "if", "type": "if", "loc": [67, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4", "vector": [4, 2, 0.0796, 0.0024, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path.startswith(u'http://') or path.startswith(u'https://') or path.startswith(u'/'):\n return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L68_C12", "label": "return", "type": "return", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L67_C8", "vector": [13, 3, 0.0802, 0.0012, 3, 0.27, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4", "vector": [13, 2, 0.0814, 0.0012, 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 urljoin(settings.MEDIA_URL,path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4", "label": "__getitem__", "type": "function", "loc": [71, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0861, 0.0059, 1, 0.18, 0.6667, 698, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "__getitem__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, name):\n \"Returns a Media object that only contains media of the given type\"\n if name in MEDIA_TYPES:\n return Media(**{str(name): getattr(self, '_' + name)})\n raise KeyError('Unknown media type \"%s\"' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L72_C8", "label": "expression", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4", "vector": [8, 2, 0.0849, 0.0012, 2, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a Media object that only contains media of the given type\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L73_C8", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4", "vector": [4, 2, 0.0867, 0.0024, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in MEDIA_TYPES:\n return Media(**{str(name): getattr(self, '_' + name)})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L74_C12", "label": "return", "type": "return", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L73_C8", "vector": [13, 3, 0.0873, 0.0012, 3, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Media(**{str(name): getattr(self, '_' + name)})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L77_C4", "label": "add_js", "type": "function", "loc": [77, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.0932, 0.0059, 1, 0.18, 0.7778, 681, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_js", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_js(self, data):\n if data:\n for path in data:\n if path not in self._js:\n self._js.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L78_C8", "label": "if", "type": "if", "loc": [78, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L77_C4", "vector": [4, 2, 0.0938, 0.0047, 2, 0.42, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data:\n for path in data:\n if path not in self._js:\n self._js.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L79_C12", "label": "for path", "type": "for", "loc": [79, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L78_C8", "vector": [6, 3, 0.0943, 0.0035, 3, 0.97, 0.0, 358, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in data:\n if path not in self._js:\n self._js.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L80_C16", "label": "if", "type": "if", "loc": [80, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L79_C12", "vector": [4, 4, 0.0949, 0.0024, 4, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path not in self._js:\n self._js.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L81_C20", "label": "append()", "type": "expression", "loc": [81, 81], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L80_C16", "vector": [8, 5, 0.0955, 0.0012, 5, 0.9, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._js.append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L83_C4", "label": "add_css", "type": "function", "loc": [83, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.1008, 0.0071, 1, 0.18, 0.8889, 686, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "add_css", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_css(self, data):\n if data:\n for medium, paths in data.items():\n for path in paths:\n if not self._css.get(medium) or path not in self._css[medium]:\n self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L84_C8", "label": "if", "type": "if", "loc": [84, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L83_C4", "vector": [4, 2, 0.1014, 0.0059, 2, 0.99, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data:\n for medium, paths in data.items():\n for path in paths:\n if not self._css.get(medium) or path not in self._css[medium]:\n self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L85_C12", "label": "for medium, paths", "type": "for", "loc": [85, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L84_C8", "vector": [6, 3, 0.102, 0.0047, 3, 0.27, 0.0, 479, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "medium, paths", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for medium, paths in data.items():\n for path in paths:\n if not self._css.get(medium) or path not in self._css[medium]:\n self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L86_C16", "label": "for path", "type": "for", "loc": [86, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L85_C12", "vector": [6, 4, 0.1026, 0.0035, 4, 0.73, 0.0, 358, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in paths:\n if not self._css.get(medium) or path not in self._css[medium]:\n self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L87_C20", "label": "if", "type": "if", "loc": [87, 88], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L86_C16", "vector": [4, 5, 0.1032, 0.0024, 5, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._css.get(medium) or path not in self._css[medium]:\n self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L88_C24", "label": "append()", "type": "expression", "loc": [88, 88], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L87_C20", "vector": [8, 6, 0.1038, 0.0012, 6, 0.77, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._css.setdefault(medium, []).append(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "label": "__add__", "type": "function", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "vector": [2, 1, 0.1091, 0.0071, 1, 0.18, 1.0, 899, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "__add__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __add__(self, other):\n combined = Media()\n for name in MEDIA_TYPES:\n getattr(combined, 'add_' + name)(getattr(self, '_' + name, None))\n getattr(combined, 'add_' + name)(getattr(other, '_' + name, None))\n return combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L91_C8", "label": "combined = Media()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "vector": [14, 2, 0.1073, 0.0012, 2, 0.69, 0.0, 339, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "combined", "arg_names": [], "import_names": [], "rhs_call_name": "Media", "annotation": ""}, "snippet": " combined = Media()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8", "label": "for name", "type": "for", "loc": [92, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "vector": [6, 2, 0.1097, 0.0035, 2, 0.69, 0.5, 57, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in MEDIA_TYPES:\n getattr(combined, 'add_' + name)(getattr(self, '_' + name, None))\n getattr(combined, 'add_' + name)(getattr(other, '_' + name, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L93_C12", "label": "expression", "type": "expression", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8", "vector": [8, 3, 0.1097, 0.0012, 3, 0.59, 0.0, 0, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " getattr(combined, 'add_' + name)(getattr(self, '_' + name, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L94_C12", "label": "expression", "type": "expression", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8", "vector": [8, 3, 0.1108, 0.0012, 3, 0.59, 1.0, 0, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " getattr(combined, 'add_' + name)(getattr(other, '_' + name, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "vector": [13, 2, 0.112, 0.0012, 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 combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L97_C0", "label": "media_property", "type": "function", "loc": [97, 121], "level": 0, "parent": null, "vector": [2, 0, 0.1285, 0.0295, 0, 0.66, 0.4048, 101, 0, 1, 1, 0, 0, 0, 10], "semantic": {"name": "media_property", "arg_names": ["cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def media_property(cls):\n def _media(self):\n # Get the media property of the superclass, if it exists\n if hasattr(super(cls, self), 'media'):\n base = super(cls, self).media\n else:\n base = Media()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "label": "_media", "type": "function", "loc": [98, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L97_C0", "vector": [2, 1, 0.1285, 0.0271, 1, 0.03, 0.0, 650, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "_media", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _media(self):\n # Get the media property of the superclass, if it exists\n if hasattr(super(cls, self), 'media'):\n base = super(cls, self).media\n else:\n base = Media()\n\n # Get the media definition for this class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8", "label": "if", "type": "if", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "vector": [4, 2, 0.1197, 0.0047, 2, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(super(cls, self), 'media'):\n base = super(cls, self).media\n else:\n base = Media()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L101_C12", "label": "base =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8", "vector": [14, 3, 0.1191, 0.0012, 3, 0.84, 0.0, 47, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base = super(cls, self).media"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L103_C12", "label": "base = Media()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8", "vector": [14, 3, 0.1215, 0.0012, 3, 0.84, 1.0, 47, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "base", "arg_names": [], "import_names": [], "rhs_call_name": "Media", "annotation": ""}, "snippet": " base = Media()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L106_C8", "label": "definition = getattr()", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "vector": [14, 2, 0.125, 0.0012, 2, 0.42, 0.5, 225, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "definition", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " definition = getattr(cls, 'Media', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "label": "if", "type": "if", "loc": [107, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "vector": [4, 2, 0.1338, 0.0165, 2, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if definition:\n extend = getattr(definition, 'extend', True)\n if extend:\n if extend == True:\n m = base\n else:\n m = Media()\n for medium in extend:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L108_C12", "label": "extend = getattr()", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "vector": [14, 3, 0.1274, 0.0012, 3, 0.03, 0.0, 660, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " extend = getattr(definition, 'extend', True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "label": "if", "type": "if", "loc": [109, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "vector": [4, 3, 0.1338, 0.0118, 3, 0.03, 0.5, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extend:\n if extend == True:\n m = base\n else:\n m = Media()\n for medium in extend:\n m = m + base[medium]\n return m + Media(definition)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "label": "if", "type": "if", "loc": [110, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "vector": [4, 4, 0.1327, 0.0071, 4, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extend == True:\n m = base\n else:\n m = Media()\n for medium in extend:\n m = m + base[medium]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L111_C20", "label": "m =", "type": "assigned_variable", "loc": [111, 111], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "vector": [14, 5, 0.1309, 0.0012, 5, 0.69, 0.0, 711, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L113_C20", "label": "m = Media()", "type": "assigned_variable", "loc": [113, 113], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "vector": [14, 5, 0.1333, 0.0012, 5, 0.69, 0.5, 711, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "Media", "annotation": ""}, "snippet": " m = Media()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L114_C20", "label": "for medium", "type": "for", "loc": [114, 115], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "vector": [6, 5, 0.135, 0.0024, 5, 0.69, 1.0, 362, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "medium", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for medium in extend:\n m = m + base[medium]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L115_C24", "label": "m =", "type": "assigned_variable", "loc": [115, 115], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L114_C20", "vector": [14, 6, 0.1356, 0.0012, 6, 0.57, 0.0, 711, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " m = m + base[medium]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L116_C16", "label": "return", "type": "return", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "vector": [13, 4, 0.1368, 0.0012, 4, 0.93, 0.5, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return m + Media(definition)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L118_C16", "label": "return", "type": "return", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "vector": [13, 4, 0.1392, 0.0012, 4, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Media(definition)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L120_C12", "label": "return", "type": "return", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "vector": [13, 3, 0.1415, 0.0012, 3, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L121_C4", "label": "return", "type": "return", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L97_C0", "vector": [13, 1, 0.1427, 0.0012, 1, 0.03, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return property(_media)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L123_C0", "label": "MediaDefiningClass", "type": "class", "loc": [123, 130], "level": 0, "parent": null, "vector": [3, 0, 0.1492, 0.0094, 0, 0.66, 0.4286, 120, 0, 1, 0, 0, 801, 0, 3], "semantic": {"name": "MediaDefiningClass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MediaDefiningClass(type):\n \"Metaclass for classes that can have media definitions\"\n def __new__(cls, name, bases, attrs):\n new_class = super(MediaDefiningClass, cls).__new__(cls, name, bases,\n attrs)\n if 'media' not in attrs:\n new_class.media = media_property(new_class)\n return new_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L124_C4", "label": "expression", "type": "expression", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L123_C0", "vector": [8, 1, 0.1462, 0.0012, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Metaclass for classes that can have media definitions\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "label": "__new__", "type": "function", "loc": [125, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L123_C0", "vector": [2, 1, 0.1504, 0.0071, 1, 0.86, 1.0, 42, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "__new__", "arg_names": ["cls", "name", "bases", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __new__(cls, name, bases, attrs):\n new_class = super(MediaDefiningClass, cls).__new__(cls, name, bases,\n attrs)\n if 'media' not in attrs:\n new_class.media = media_property(new_class)\n return new_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L126_C8", "label": "new_class = __new__()", "type": "assigned_variable", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "vector": [14, 2, 0.1492, 0.0024, 2, 0.66, 0.0, 746, 3, 4, 0, 0, 42, 10, 2], "semantic": {"name": "new_class", "arg_names": [], "import_names": [], "rhs_call_name": "__new__", "annotation": ""}, "snippet": " new_class = super(MediaDefiningClass, cls).__new__(cls, name, bases,\n attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L128_C8", "label": "if", "type": "if", "loc": [128, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "vector": [4, 2, 0.1515, 0.0024, 2, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'media' not in attrs:\n new_class.media = media_property(new_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L129_C12", "label": "new_class.media = media_property()", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L128_C8", "vector": [14, 3, 0.1521, 0.0012, 3, 0.89, 0.0, 755, 3, 1, 0, 0, 101, 10, 1], "semantic": {"name": "new_class.media", "arg_names": [], "import_names": [], "rhs_call_name": "media_property", "annotation": ""}, "snippet": " new_class.media = media_property(new_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "vector": [13, 2, 0.1533, 0.0012, 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 new_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "label": "Widget", "type": "class", "loc": [132, 204], "level": 0, "parent": null, "vector": [3, 0, 0.1981, 0.0861, 0, 0.66, 0.4524, 969, 0, 7, 0, 0, 186, 0, 10], "semantic": {"name": "Widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Widget(object):\n __metaclass__ = MediaDefiningClass\n is_hidden = False # Determines whether this corresponds to an <input type=\"hidden\">.\n needs_multipart_form = False # Determines does this widget need multipart-encrypted form\n is_localized = False\n is_required = False\n\n def __init__(self, attrs=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L133_C4", "label": "__metaclass__ =", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.1568, 0.0012, 1, 0.74, 0.0, 203, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "__metaclass__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __metaclass__ = MediaDefiningClass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L134_C4", "label": "is_hidden =", "type": "assigned_variable", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.158, 0.0012, 1, 0.74, 0.0833, 524, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_hidden", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_hidden = False # Determines whether this corresponds to an <input type=\"hidden\">."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L135_C4", "label": "needs_multipart_form =", "type": "assigned_variable", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.1592, 0.0012, 1, 0.74, 0.1667, 727, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "needs_multipart_form", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " needs_multipart_form = False # Determines does this widget need multipart-encrypted form"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L136_C4", "label": "is_localized =", "type": "assigned_variable", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.1604, 0.0012, 1, 0.74, 0.25, 135, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_localized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_localized = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L137_C4", "label": "is_required =", "type": "assigned_variable", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.1616, 0.0012, 1, 0.74, 0.3333, 788, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_required = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L139_C4", "label": "__init__", "type": "function", "loc": [139, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.1663, 0.0059, 1, 0.74, 0.4167, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None):\n if attrs is not None:\n self.attrs = attrs.copy()\n else:\n self.attrs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8", "label": "if", "type": "if", "loc": [140, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L139_C4", "vector": [4, 2, 0.1669, 0.0047, 2, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs is not None:\n self.attrs = attrs.copy()\n else:\n self.attrs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L141_C12", "label": "self.attrs = copy()", "type": "assigned_variable", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8", "vector": [14, 3, 0.1663, 0.0012, 3, 0.64, 0.0, 793, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "self.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " self.attrs = attrs.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L143_C12", "label": "self.attrs =", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8", "vector": [14, 3, 0.1686, 0.0012, 3, 0.64, 1.0, 793, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.attrs = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "label": "__deepcopy__", "type": "function", "loc": [145, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.1733, 0.0059, 1, 0.74, 0.5, 652, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__deepcopy__", "arg_names": ["self", "memo"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __deepcopy__(self, memo):\n obj = copy.copy(self)\n obj.attrs = self.attrs.copy()\n memo[id(self)] = obj\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L146_C8", "label": "obj = copy()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "vector": [14, 2, 0.1722, 0.0012, 2, 0.64, 0.0, 505, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " obj = copy.copy(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L147_C8", "label": "obj.attrs = copy()", "type": "assigned_variable", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "vector": [14, 2, 0.1733, 0.0012, 2, 0.64, 0.3333, 968, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "obj.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " obj.attrs = self.attrs.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L148_C8", "label": "assign", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "vector": [14, 2, 0.1745, 0.0012, 2, 0.64, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " memo[id(self)] = obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L149_C8", "label": "return", "type": "return", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "vector": [13, 2, 0.1757, 0.0012, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L151_C4", "label": "render", "type": "function", "loc": [151, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.1822, 0.0094, 1, 0.74, 0.5833, 24, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n \"\"\"\n Returns this Widget rendered as HTML, as a Unicode string.\n\n The 'value' given is not guaranteed to be valid input, so subclass\n implementations should program defensively.\n \"\"\"\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L152_C8", "label": "expression", "type": "expression", "loc": [152, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L151_C4", "vector": [8, 2, 0.1822, 0.0071, 2, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns this Widget rendered as HTML, as a Unicode string.\n\n The 'value' given is not guaranteed to be valid input, so subclass\n implementations should program defensively.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "label": "build_attrs", "type": "function", "loc": [160, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.1916, 0.0071, 1, 0.74, 0.6667, 588, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "build_attrs", "arg_names": ["self", "extra_attrs", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def build_attrs(self, extra_attrs=None, **kwargs):\n \"Helper function for building an attribute dictionary.\"\n attrs = dict(self.attrs, **kwargs)\n if extra_attrs:\n attrs.update(extra_attrs)\n return attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L161_C8", "label": "expression", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "vector": [8, 2, 0.1899, 0.0012, 2, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Helper function for building an attribute dictionary.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L162_C8", "label": "attrs = dict()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "vector": [14, 2, 0.191, 0.0012, 2, 0.12, 0.3333, 251, 3, 2, 0, 0, 827, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " attrs = dict(self.attrs, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L163_C8", "label": "if", "type": "if", "loc": [163, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "vector": [4, 2, 0.1928, 0.0024, 2, 0.12, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extra_attrs:\n attrs.update(extra_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L164_C12", "label": "update()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L163_C8", "vector": [8, 3, 0.1934, 0.0012, 3, 0.81, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " attrs.update(extra_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "vector": [13, 2, 0.1946, 0.0012, 2, 0.12, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4", "label": "value_from_datadict", "type": "function", "loc": [167, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.1999, 0.0071, 1, 0.74, 0.75, 272, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n \"\"\"\n Given a dictionary of data and this widget's name, returns the value\n of this widget. Returns None if it's not provided.\n \"\"\"\n return data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L168_C8", "label": "expression", "type": "expression", "loc": [168, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4", "vector": [8, 2, 0.1999, 0.0047, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a dictionary of data and this widget's name, returns the value\n of this widget. Returns None if it's not provided.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L172_C8", "label": "return", "type": "return", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4", "vector": [13, 2, 0.2028, 0.0012, 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 data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "label": "_has_changed", "type": "function", "loc": [174, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.2152, 0.0212, 1, 0.74, 0.8333, 719, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n \"\"\"\n Return True if data differs from initial.\n \"\"\"\n # For purposes of seeing whether something has changed, None is\n # the same as an empty string, if the data or inital value we get\n # is None, replace it w/ u''.\n if data is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L175_C8", "label": "expression", "type": "expression", "loc": [175, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "vector": [8, 2, 0.2075, 0.0035, 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 Return True if data differs from initial.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8", "label": "if", "type": "if", "loc": [181, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "vector": [4, 2, 0.2152, 0.0047, 2, 0.1, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is None:\n data_value = u''\n else:\n data_value = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L182_C12", "label": "data_value =", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8", "vector": [14, 3, 0.2146, 0.0012, 3, 0.57, 0.0, 794, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "data_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_value = u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L184_C12", "label": "data_value =", "type": "assigned_variable", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8", "vector": [14, 3, 0.217, 0.0012, 3, 0.57, 1.0, 794, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_value = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8", "label": "if", "type": "if", "loc": [185, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "vector": [4, 2, 0.2199, 0.0047, 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 initial is None:\n initial_value = u''\n else:\n initial_value = initial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L186_C12", "label": "initial_value =", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8", "vector": [14, 3, 0.2193, 0.0012, 3, 0.98, 0.0, 378, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "initial_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_value = u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L188_C12", "label": "initial_value =", "type": "assigned_variable", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8", "vector": [14, 3, 0.2217, 0.0012, 3, 0.98, 1.0, 378, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "initial_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial_value = initial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L189_C8", "label": "if", "type": "if", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "vector": [4, 2, 0.2235, 0.0024, 2, 0.1, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_unicode(initial_value) != force_unicode(data_value):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L190_C12", "label": "return", "type": "return", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L189_C8", "vector": [13, 3, 0.2241, 0.0012, 3, 0.72, 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_99002:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "vector": [13, 2, 0.2252, 0.0012, 2, 0.1, 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_99002:FunctionDef_L193_C4", "label": "id_for_label", "type": "function", "loc": [193, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [2, 1, 0.2335, 0.013, 1, 0.74, 0.9167, 952, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "id_for_label", "arg_names": ["self", "id_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def id_for_label(self, id_):\n \"\"\"\n Returns the HTML ID attribute of this Widget for use by a <label>,\n given the ID of the field. Returns None if no ID is available.\n\n This hook is necessary because some widgets have multiple HTML\n elements and, thus, multiple IDs. In that case, this method should\n return an ID value that corresponds to the first ID in the widget's"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L194_C8", "label": "expression", "type": "expression", "loc": [194, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L193_C4", "vector": [8, 2, 0.2335, 0.0106, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the HTML ID attribute of this Widget for use by a <label>,\n given the ID of the field. Returns None if no ID is available.\n\n This hook is necessary because some widgets have multiple HTML\n elements and, thus, multiple IDs. In that case, this method should\n return an ID value that corresponds to the first ID in the widget's\n tags."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L203_C8", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L193_C4", "vector": [13, 2, 0.2394, 0.0012, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L204_C4", "label": "id_for_label = classmethod()", "type": "assigned_variable", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "vector": [14, 1, 0.2406, 0.0012, 1, 0.74, 1.0, 952, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "id_for_label", "arg_names": [], "import_names": [], "rhs_call_name": "classmethod", "annotation": ""}, "snippet": " id_for_label = classmethod(id_for_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "label": "Input", "type": "class", "loc": [206, 225], "level": 0, "parent": null, "vector": [3, 0, 0.2541, 0.0236, 0, 0.66, 0.4762, 35, 0, 2, 0, 0, 969, 0, 6], "semantic": {"name": "Input", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Input(Widget):\n \"\"\"\n Base class for all <input> widgets (except type='checkbox' and\n type='radio', which are special).\n \"\"\"\n input_type = None # Subclasses must define this.\n\n def _format_value(self, value):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L207_C4", "label": "expression", "type": "expression", "loc": [207, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "vector": [8, 1, 0.2459, 0.0047, 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 Base class for all <input> widgets (except type='checkbox' and\n type='radio', which are special).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L211_C4", "label": "input_type =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "vector": [14, 1, 0.2488, 0.0012, 1, 0.59, 0.3333, 16, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = None # Subclasses must define this."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4", "label": "_format_value", "type": "function", "loc": [213, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "vector": [2, 1, 0.2529, 0.0047, 1, 0.59, 0.6667, 785, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_format_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_value(self, value):\n if self.is_localized:\n return formats.localize_input(value)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L214_C8", "label": "if", "type": "if", "loc": [214, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4", "vector": [4, 2, 0.2529, 0.0024, 2, 0.64, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_localized:\n return formats.localize_input(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L215_C12", "label": "return", "type": "return", "loc": [215, 215], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L214_C8", "vector": [13, 3, 0.2535, 0.0012, 3, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return formats.localize_input(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L216_C8", "label": "return", "type": "return", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4", "vector": [13, 2, 0.2547, 0.0012, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "label": "render", "type": "function", "loc": [218, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "vector": [2, 1, 0.2612, 0.0094, 1, 0.59, 1.0, 24, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n if value is None:\n value = ''\n final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)\n if value != '':\n # Only add the 'value' attribute if a value is non-empty.\n final_attrs['value'] = force_unicode(self._format_value(value))\n return mark_safe(u'<input%s />' % flatatt(final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L219_C8", "label": "if", "type": "if", "loc": [219, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "vector": [4, 2, 0.2588, 0.0024, 2, 0.56, 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 value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L220_C12", "label": "value =", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L219_C8", "vector": [14, 3, 0.2594, 0.0012, 3, 0.0, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L221_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "vector": [14, 2, 0.2606, 0.0012, 2, 0.56, 0.3333, 750, 3, 3, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L222_C8", "label": "if", "type": "if", "loc": [222, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "vector": [4, 2, 0.263, 0.0035, 2, 0.56, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value != '':\n # Only add the 'value' attribute if a value is non-empty.\n final_attrs['value'] = force_unicode(self._format_value(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L224_C12", "label": " = force_unicode()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L222_C8", "vector": [14, 3, 0.2642, 0.0012, 3, 0.4, 0.0, 0, 3, 1, 0, 0, 870, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " final_attrs['value'] = force_unicode(self._format_value(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L225_C8", "label": "return", "type": "return", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "vector": [13, 2, 0.2653, 0.0012, 2, 0.56, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<input%s />' % flatatt(final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L227_C0", "label": "TextInput", "type": "class", "loc": [227, 228], "level": 0, "parent": null, "vector": [3, 0, 0.2683, 0.0024, 0, 0.66, 0.5, 438, 0, 0, 0, 0, 35, 0, 0], "semantic": {"name": "TextInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TextInput(Input):\n input_type = 'text'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L228_C4", "label": "input_type =", "type": "assigned_variable", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L227_C0", "vector": [14, 1, 0.2689, 0.0012, 1, 0.55, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'text'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "label": "PasswordInput", "type": "class", "loc": [230, 239], "level": 0, "parent": null, "vector": [3, 0, 0.2765, 0.0118, 0, 0.66, 0.5238, 374, 0, 2, 0, 0, 35, 0, 4], "semantic": {"name": "PasswordInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class PasswordInput(Input):\n input_type = 'password'\n\n def __init__(self, attrs=None, render_value=False):\n super(PasswordInput, self).__init__(attrs)\n self.render_value = render_value\n\n def render(self, name, value, attrs=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L231_C4", "label": "input_type =", "type": "assigned_variable", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "vector": [14, 1, 0.2724, 0.0012, 1, 0.28, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'password'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4", "label": "__init__", "type": "function", "loc": [233, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "vector": [2, 1, 0.2759, 0.0035, 1, 0.28, 0.5, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "render_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, render_value=False):\n super(PasswordInput, self).__init__(attrs)\n self.render_value = render_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L234_C8", "label": "__init__()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4", "vector": [8, 2, 0.2759, 0.0012, 2, 0.43, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(PasswordInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L235_C8", "label": "self.render_value =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4", "vector": [14, 2, 0.2771, 0.0012, 2, 0.43, 1.0, 164, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.render_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.render_value = render_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4", "label": "render", "type": "function", "loc": [237, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "vector": [2, 1, 0.2807, 0.0035, 1, 0.28, 1.0, 24, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n if not self.render_value: value=None\n return super(PasswordInput, self).render(name, value, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L238_C8", "label": "if", "type": "if", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4", "vector": [4, 2, 0.2807, 0.0012, 2, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.render_value: value=None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L238_C34", "label": "value =", "type": "assigned_variable", "loc": [238, 238], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L238_C8", "vector": [14, 3, 0.2807, 0.0012, 3, 0.35, 0.0, 441, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.render_value: value=None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L239_C8", "label": "return", "type": "return", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4", "vector": [13, 2, 0.2818, 0.0012, 2, 0.15, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(PasswordInput, self).render(name, value, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L241_C0", "label": "HiddenInput", "type": "class", "loc": [241, 243], "level": 0, "parent": null, "vector": [3, 0, 0.2854, 0.0035, 0, 0.66, 0.5476, 961, 0, 0, 0, 0, 35, 0, 0], "semantic": {"name": "HiddenInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HiddenInput(Input):\n input_type = 'hidden'\n is_hidden = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L242_C4", "label": "input_type =", "type": "assigned_variable", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L241_C0", "vector": [14, 1, 0.2854, 0.0012, 1, 0.84, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'hidden'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L243_C4", "label": "is_hidden =", "type": "assigned_variable", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L241_C0", "vector": [14, 1, 0.2866, 0.0012, 1, 0.84, 1.0, 524, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_hidden", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_hidden = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "label": "MultipleHiddenInput", "type": "class", "loc": [245, 272], "level": 0, "parent": null, "vector": [3, 0, 0.3048, 0.033, 0, 0.66, 0.5714, 278, 0, 3, 0, 0, 961, 0, 14], "semantic": {"name": "MultipleHiddenInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MultipleHiddenInput(HiddenInput):\n \"\"\"\n A widget that handles <input type=\"hidden\"> for fields that have a list\n of values.\n \"\"\"\n def __init__(self, attrs=None, choices=()):\n super(MultipleHiddenInput, self).__init__(attrs)\n # choices can be any iterable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L246_C4", "label": "expression", "type": "expression", "loc": [246, 249], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "vector": [8, 1, 0.2919, 0.0047, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A widget that handles <input type=\"hidden\"> for fields that have a list\n of values.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4", "label": "__init__", "type": "function", "loc": [250, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "vector": [2, 1, 0.2966, 0.0047, 1, 0.45, 0.3333, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, choices=()):\n super(MultipleHiddenInput, self).__init__(attrs)\n # choices can be any iterable\n self.choices = choices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L251_C8", "label": "__init__()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4", "vector": [8, 2, 0.296, 0.0012, 2, 0.7, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(MultipleHiddenInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L253_C8", "label": "self.choices =", "type": "assigned_variable", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4", "vector": [14, 2, 0.2983, 0.0012, 2, 0.7, 1.0, 259, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.choices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.choices = choices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "label": "render", "type": "function", "loc": [255, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "vector": [2, 1, 0.3078, 0.0153, 1, 0.45, 0.6667, 24, 0, 5, 1, 0, 0, 0, 9], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n if value is None: value = []\n final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)\n id_ = final_attrs.get('id', None)\n inputs = []\n for i, v in enumerate(value):\n input_attrs = dict(value=force_unicode(v), **final_attrs)\n if id_:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L256_C8", "label": "if", "type": "if", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [4, 2, 0.3019, 0.0012, 2, 0.11, 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: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L256_C26", "label": "value =", "type": "assigned_variable", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L256_C8", "vector": [14, 3, 0.3019, 0.0012, 3, 0.56, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L257_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [14, 2, 0.3031, 0.0012, 2, 0.11, 0.2, 750, 3, 3, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L258_C8", "label": "id_ = get()", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [14, 2, 0.3042, 0.0012, 2, 0.11, 0.4, 345, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "id_", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " id_ = final_attrs.get('id', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L259_C8", "label": "inputs =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [14, 2, 0.3054, 0.0012, 2, 0.11, 0.6, 226, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "inputs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inputs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "label": "for i, v", "type": "for", "loc": [260, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [6, 2, 0.3101, 0.0083, 2, 0.11, 0.8, 843, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, v in enumerate(value):\n input_attrs = dict(value=force_unicode(v), **final_attrs)\n if id_:\n # An ID attribute was given. Add a numeric index as a suffix\n # so that the inputs don't all have the same ID attribute.\n input_attrs['id'] = '%s_%s' % (id_, i)\n inputs.append(u'<input%s />' % flatatt(input_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L261_C12", "label": "input_attrs = dict()", "type": "assigned_variable", "loc": [261, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "vector": [14, 3, 0.3078, 0.0012, 3, 0.0, 0.0, 847, 3, 2, 0, 0, 827, 10, 2], "semantic": {"name": "input_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " input_attrs = dict(value=force_unicode(v), **final_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L262_C12", "label": "if", "type": "if", "loc": [262, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "vector": [4, 3, 0.3107, 0.0047, 3, 0.0, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id_:\n # An ID attribute was given. Add a numeric index as a suffix\n # so that the inputs don't all have the same ID attribute.\n input_attrs['id'] = '%s_%s' % (id_, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L265_C16", "label": "assign", "type": "assigned_variable", "loc": [265, 265], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L262_C12", "vector": [14, 4, 0.3125, 0.0012, 4, 0.78, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_attrs['id'] = '%s_%s' % (id_, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L266_C12", "label": "append()", "type": "expression", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "vector": [8, 3, 0.3137, 0.0012, 3, 0.0, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " inputs.append(u'<input%s />' % flatatt(input_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L267_C8", "label": "return", "type": "return", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "vector": [13, 2, 0.3149, 0.0012, 2, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'\\n'.join(inputs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4", "label": "value_from_datadict", "type": "function", "loc": [269, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "vector": [2, 1, 0.319, 0.0047, 1, 0.45, 1.0, 272, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n if isinstance(data, (MultiValueDict, MergeDict)):\n return data.getlist(name)\n return data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L270_C8", "label": "if", "type": "if", "loc": [270, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4", "vector": [4, 2, 0.319, 0.0024, 2, 0.78, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(data, (MultiValueDict, MergeDict)):\n return data.getlist(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L271_C12", "label": "return", "type": "return", "loc": [271, 271], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L270_C8", "vector": [13, 3, 0.3196, 0.0012, 3, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data.getlist(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4", "vector": [13, 2, 0.3208, 0.0012, 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 data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "label": "FileInput", "type": "class", "loc": [274, 288], "level": 0, "parent": null, "vector": [3, 0, 0.3314, 0.0177, 0, 0.66, 0.5952, 50, 0, 3, 0, 0, 35, 0, 3], "semantic": {"name": "FileInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileInput(Input):\n input_type = 'file'\n needs_multipart_form = True\n\n def render(self, name, value, attrs=None):\n return super(FileInput, self).render(name, None, attrs=attrs)\n\n def value_from_datadict(self, data, files, name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L275_C4", "label": "input_type =", "type": "assigned_variable", "loc": [275, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "vector": [14, 1, 0.3243, 0.0012, 1, 0.47, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'file'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L276_C4", "label": "needs_multipart_form =", "type": "assigned_variable", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "vector": [14, 1, 0.3255, 0.0012, 1, 0.47, 0.25, 727, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "needs_multipart_form", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " needs_multipart_form = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L278_C4", "label": "render", "type": "function", "loc": [278, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "vector": [2, 1, 0.3284, 0.0024, 1, 0.47, 0.5, 24, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n return super(FileInput, self).render(name, None, attrs=attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L279_C8", "label": "return", "type": "return", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L278_C4", "vector": [13, 2, 0.329, 0.0012, 2, 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(FileInput, self).render(name, None, attrs=attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4", "label": "value_from_datadict", "type": "function", "loc": [281, 283], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "vector": [2, 1, 0.3325, 0.0035, 1, 0.47, 0.75, 272, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n \"File widgets take data from FILES, not POST\"\n return files.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L282_C8", "label": "expression", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4", "vector": [8, 2, 0.3325, 0.0012, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"File widgets take data from FILES, not POST\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L283_C8", "label": "return", "type": "return", "loc": [283, 283], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4", "vector": [13, 2, 0.3337, 0.0012, 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 files.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4", "label": "_has_changed", "type": "function", "loc": [285, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "vector": [2, 1, 0.3379, 0.0047, 1, 0.47, 1.0, 719, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n if data is None:\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L286_C8", "label": "if", "type": "if", "loc": [286, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4", "vector": [4, 2, 0.3379, 0.0024, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is None:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L287_C12", "label": "return", "type": "return", "loc": [287, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L286_C8", "vector": [13, 3, 0.3384, 0.0012, 3, 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_99002:Return_L288_C8", "label": "return", "type": "return", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4", "vector": [13, 2, 0.3396, 0.0012, 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 True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L290_C0", "label": "FILE_INPUT_CONTRADICTION = object()", "type": "assigned_variable", "loc": [290, 290], "level": 0, "parent": null, "vector": [14, 0, 0.342, 0.0012, 0, 0.66, 0.619, 35, 3, 0, 0, 0, 186, 10, 1], "semantic": {"name": "FILE_INPUT_CONTRADICTION", "arg_names": [], "import_names": [], "rhs_call_name": "object", "annotation": ""}, "snippet": "FILE_INPUT_CONTRADICTION = object()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "label": "ClearableFileInput", "type": "class", "loc": [292, 349], "level": 0, "parent": null, "vector": [3, 0, 0.3779, 0.0684, 0, 0.66, 0.6429, 69, 0, 4, 0, 0, 50, 0, 16], "semantic": {"name": "ClearableFileInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClearableFileInput(FileInput):\n initial_text = ugettext_lazy('Currently')\n input_text = ugettext_lazy('Change')\n clear_checkbox_label = ugettext_lazy('Clear')\n\n template_with_initial = u'%(initial_text)s: %(initial)s %(clear_template)s<br />%(input_text)s: %(input)s'\n\n template_with_clear = u'%(clear)s <label for=\"%(clear_checkbox_id)s\">%(clear_checkbox_label)s</label>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L293_C4", "label": "initial_text = ugettext_lazy()", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [14, 1, 0.3455, 0.0012, 1, 0.51, 0.0, 774, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "initial_text", "arg_names": [], "import_names": [], "rhs_call_name": "ugettext_lazy", "annotation": ""}, "snippet": " initial_text = ugettext_lazy('Currently')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L294_C4", "label": "input_text = ugettext_lazy()", "type": "assigned_variable", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [14, 1, 0.3467, 0.0012, 1, 0.51, 0.125, 14, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "input_text", "arg_names": [], "import_names": [], "rhs_call_name": "ugettext_lazy", "annotation": ""}, "snippet": " input_text = ugettext_lazy('Change')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L295_C4", "label": "clear_checkbox_label = ugettext_lazy()", "type": "assigned_variable", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [14, 1, 0.3479, 0.0012, 1, 0.51, 0.25, 153, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "clear_checkbox_label", "arg_names": [], "import_names": [], "rhs_call_name": "ugettext_lazy", "annotation": ""}, "snippet": " clear_checkbox_label = ugettext_lazy('Clear')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L297_C4", "label": "template_with_initial =", "type": "assigned_variable", "loc": [297, 297], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [14, 1, 0.3502, 0.0012, 1, 0.51, 0.375, 407, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "template_with_initial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_with_initial = u'%(initial_text)s: %(initial)s %(clear_template)s<br />%(input_text)s: %(input)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L299_C4", "label": "template_with_clear =", "type": "assigned_variable", "loc": [299, 299], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [14, 1, 0.3526, 0.0012, 1, 0.51, 0.5, 704, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "template_with_clear", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template_with_clear = u'%(clear)s <label for=\"%(clear_checkbox_id)s\">%(clear_checkbox_label)s</label>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4", "label": "clear_checkbox_name", "type": "function", "loc": [301, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [2, 1, 0.3579, 0.0071, 1, 0.51, 0.625, 572, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "clear_checkbox_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_checkbox_name(self, name):\n \"\"\"\n Given the name of the file input, return the name of the clear checkbox\n input.\n \"\"\"\n return name + '-clear'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L302_C8", "label": "expression", "type": "expression", "loc": [302, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4", "vector": [8, 2, 0.3579, 0.0047, 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 Given the name of the file input, return the name of the clear checkbox\n input.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L306_C8", "label": "return", "type": "return", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4", "vector": [13, 2, 0.3608, 0.0012, 2, 0.22, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name + '-clear'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4", "label": "clear_checkbox_id", "type": "function", "loc": [308, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [2, 1, 0.3656, 0.0059, 1, 0.51, 0.75, 76, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "clear_checkbox_id", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_checkbox_id(self, name):\n \"\"\"\n Given the name of the clear checkbox input, return the HTML id for it.\n \"\"\"\n return name + '_id'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L309_C8", "label": "expression", "type": "expression", "loc": [309, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4", "vector": [8, 2, 0.3656, 0.0035, 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 Given the name of the clear checkbox input, return the HTML id for it.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L312_C8", "label": "return", "type": "return", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4", "vector": [13, 2, 0.3679, 0.0012, 2, 0.72, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name + '_id'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "label": "render", "type": "function", "loc": [314, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [2, 1, 0.3833, 0.0271, 1, 0.51, 0.875, 24, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n substitutions = {\n 'initial_text': self.initial_text,\n 'input_text': self.input_text,\n 'clear_template': '',\n 'clear_checkbox_label': self.clear_checkbox_label,\n }\n template = u'%(input)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L315_C8", "label": "substitutions =", "type": "assigned_variable", "loc": [315, 320], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "vector": [14, 2, 0.3744, 0.0071, 2, 0.41, 0.0, 205, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "substitutions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " substitutions = {\n 'initial_text': self.initial_text,\n 'input_text': self.input_text,\n 'clear_template': '',\n 'clear_checkbox_label': self.clear_checkbox_label,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L321_C8", "label": "template =", "type": "assigned_variable", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "vector": [14, 2, 0.3785, 0.0012, 2, 0.41, 0.25, 549, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template = u'%(input)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L322_C8", "label": " = render()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "vector": [14, 2, 0.3797, 0.0012, 2, 0.41, 0.5, 0, 3, 3, 0, 0, 24, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " substitutions['input'] = super(ClearableFileInput, self).render(name, value, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "label": "if", "type": "if", "loc": [324, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "vector": [4, 2, 0.388, 0.013, 2, 0.41, 0.75, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value and hasattr(value, \"url\"):\n template = self.template_with_initial\n substitutions['initial'] = (u'<a target=\"_blank\" href=\"%s\">%s</a>'\n % (value.url, value))\n if not self.is_required:\n checkbox_name = self.clear_checkbox_name(name)\n checkbox_id = self.clear_checkbox_id(checkbox_name)\n substitutions['clear_checkbox_name'] = checkbox_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L325_C12", "label": "template =", "type": "assigned_variable", "loc": [325, 325], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "vector": [14, 3, 0.3833, 0.0012, 3, 0.42, 0.0, 549, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " template = self.template_with_initial"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L326_C12", "label": "assign", "type": "assigned_variable", "loc": [326, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "vector": [14, 3, 0.385, 0.0024, 3, 0.42, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " substitutions['initial'] = (u'<a target=\"_blank\" href=\"%s\">%s</a>'\n % (value.url, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "label": "if", "type": "if", "loc": [328, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "vector": [4, 3, 0.3903, 0.0083, 3, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_required:\n checkbox_name = self.clear_checkbox_name(name)\n checkbox_id = self.clear_checkbox_id(checkbox_name)\n substitutions['clear_checkbox_name'] = checkbox_name\n substitutions['clear_checkbox_id'] = checkbox_id\n substitutions['clear'] = CheckboxInput().render(checkbox_name, False, attrs={'id': checkbox_id})\n substitutions['clear_template'] = self.template_with_clear % substitutions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L329_C16", "label": "checkbox_name = clear_checkbox_name()", "type": "assigned_variable", "loc": [329, 329], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.388, 0.0012, 4, 0.78, 0.0, 111, 3, 1, 0, 0, 572, 10, 1], "semantic": {"name": "checkbox_name", "arg_names": [], "import_names": [], "rhs_call_name": "clear_checkbox_name", "annotation": ""}, "snippet": " checkbox_name = self.clear_checkbox_name(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L330_C16", "label": "checkbox_id = clear_checkbox_id()", "type": "assigned_variable", "loc": [330, 330], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.3892, 0.0012, 4, 0.78, 0.2, 111, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "checkbox_id", "arg_names": [], "import_names": [], "rhs_call_name": "clear_checkbox_id", "annotation": ""}, "snippet": " checkbox_id = self.clear_checkbox_id(checkbox_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L331_C16", "label": "assign", "type": "assigned_variable", "loc": [331, 331], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.3903, 0.0012, 4, 0.78, 0.4, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " substitutions['clear_checkbox_name'] = checkbox_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L332_C16", "label": "assign", "type": "assigned_variable", "loc": [332, 332], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.3915, 0.0012, 4, 0.78, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " substitutions['clear_checkbox_id'] = checkbox_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L333_C16", "label": " = render()", "type": "assigned_variable", "loc": [333, 333], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.3927, 0.0012, 4, 0.78, 0.8, 0, 3, 3, 0, 0, 24, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " substitutions['clear'] = CheckboxInput().render(checkbox_name, False, attrs={'id': checkbox_id})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L334_C16", "label": "assign", "type": "assigned_variable", "loc": [334, 334], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "vector": [14, 4, 0.3939, 0.0012, 4, 0.78, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " substitutions['clear_template'] = self.template_with_clear % substitutions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L336_C8", "label": "return", "type": "return", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "vector": [13, 2, 0.3962, 0.0012, 2, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(template % substitutions)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "label": "value_from_datadict", "type": "function", "loc": [338, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "vector": [2, 1, 0.4051, 0.0142, 1, 0.51, 1.0, 272, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n upload = super(ClearableFileInput, self).value_from_datadict(data, files, name)\n if not self.is_required and CheckboxInput().value_from_datadict(\n data, files, self.clear_checkbox_name(name)):\n if upload:\n # If the user contradicts themselves (uploads a new file AND\n # checks the \"clear\" checkbox), we return a unique marker\n # object that FileField will turn into a ValidationError."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L339_C8", "label": "upload = value_from_datadict()", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "vector": [14, 2, 0.3998, 0.0012, 2, 0.03, 0.0, 920, 3, 3, 0, 0, 272, 10, 2], "semantic": {"name": "upload", "arg_names": [], "import_names": [], "rhs_call_name": "value_from_datadict", "annotation": ""}, "snippet": " upload = super(ClearableFileInput, self).value_from_datadict(data, files, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8", "label": "if", "type": "if", "loc": [340, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "vector": [4, 2, 0.4057, 0.0106, 2, 0.03, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.is_required and CheckboxInput().value_from_datadict(\n data, files, self.clear_checkbox_name(name)):\n if upload:\n # If the user contradicts themselves (uploads a new file AND\n # checks the \"clear\" checkbox), we return a unique marker\n # object that FileField will turn into a ValidationError.\n return FILE_INPUT_CONTRADICTION\n # False signals to clear any existing value, as opposed to just None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L342_C12", "label": "if", "type": "if", "loc": [342, 346], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8", "vector": [4, 3, 0.4057, 0.0059, 3, 0.21, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if upload:\n # If the user contradicts themselves (uploads a new file AND\n # checks the \"clear\" checkbox), we return a unique marker\n # object that FileField will turn into a ValidationError.\n return FILE_INPUT_CONTRADICTION"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L346_C16", "label": "return", "type": "return", "loc": [346, 346], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L342_C12", "vector": [13, 4, 0.408, 0.0012, 4, 0.44, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return FILE_INPUT_CONTRADICTION"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L348_C12", "label": "return", "type": "return", "loc": [348, 348], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8", "vector": [13, 3, 0.4104, 0.0012, 3, 0.21, 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_99002:Return_L349_C8", "label": "return", "type": "return", "loc": [349, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "vector": [13, 2, 0.4116, 0.0012, 2, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return upload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L351_C0", "label": "Textarea", "type": "class", "loc": [351, 363], "level": 0, "parent": null, "vector": [3, 0, 0.421, 0.0153, 0, 0.66, 0.6667, 746, 0, 2, 0, 0, 969, 0, 8], "semantic": {"name": "Textarea", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Textarea(Widget):\n def __init__(self, attrs=None):\n # The 'rows' and 'cols' attributes are required for HTML correctness.\n default_attrs = {'cols': '40', 'rows': '10'}\n if attrs:\n default_attrs.update(attrs)\n super(Textarea, self).__init__(default_attrs)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "label": "__init__", "type": "function", "loc": [352, 357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L351_C0", "vector": [2, 1, 0.418, 0.0071, 1, 0.89, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None):\n # The 'rows' and 'cols' attributes are required for HTML correctness.\n default_attrs = {'cols': '40', 'rows': '10'}\n if attrs:\n default_attrs.update(attrs)\n super(Textarea, self).__init__(default_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L354_C8", "label": "default_attrs =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "vector": [14, 2, 0.4175, 0.0012, 2, 0.8, 0.0, 954, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "default_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default_attrs = {'cols': '40', 'rows': '10'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L355_C8", "label": "if", "type": "if", "loc": [355, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "vector": [4, 2, 0.4192, 0.0024, 2, 0.8, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attrs:\n default_attrs.update(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L356_C12", "label": "update()", "type": "expression", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L355_C8", "vector": [8, 3, 0.4198, 0.0012, 3, 0.54, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " default_attrs.update(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L357_C8", "label": "__init__()", "type": "expression", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "vector": [8, 2, 0.421, 0.0012, 2, 0.8, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Textarea, self).__init__(default_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "label": "render", "type": "function", "loc": [359, 363], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L351_C0", "vector": [2, 1, 0.4257, 0.0059, 1, 0.89, 1.0, 24, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n if value is None: value = ''\n final_attrs = self.build_attrs(attrs, name=name)\n return mark_safe(u'<textarea%s>%s</textarea>' % (flatatt(final_attrs),\n conditional_escape(force_unicode(value))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L360_C8", "label": "if", "type": "if", "loc": [360, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "vector": [4, 2, 0.4245, 0.0012, 2, 0.13, 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: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L360_C26", "label": "value =", "type": "assigned_variable", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L360_C8", "vector": [14, 3, 0.4245, 0.0012, 3, 0.35, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L361_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "vector": [14, 2, 0.4257, 0.0012, 2, 0.13, 0.5, 750, 3, 2, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L362_C8", "label": "return", "type": "return", "loc": [362, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "vector": [13, 2, 0.4275, 0.0024, 2, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<textarea%s>%s</textarea>' % (flatatt(final_attrs),\n conditional_escape(force_unicode(value))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "label": "DateInput", "type": "class", "loc": [365, 395], "level": 0, "parent": null, "vector": [3, 0, 0.4481, 0.0366, 0, 0.66, 0.6905, 302, 0, 3, 0, 0, 35, 0, 13], "semantic": {"name": "DateInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DateInput(Input):\n input_type = 'text'\n format = '%Y-%m-%d' # '2006-10-25'\n\n def __init__(self, attrs=None, format=None):\n super(DateInput, self).__init__(attrs)\n if format:\n self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L366_C4", "label": "input_type =", "type": "assigned_variable", "loc": [366, 366], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "vector": [14, 1, 0.4316, 0.0012, 1, 0.13, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'text'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L367_C4", "label": "format =", "type": "assigned_variable", "loc": [367, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "vector": [14, 1, 0.4328, 0.0012, 1, 0.13, 0.25, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = '%Y-%m-%d' # '2006-10-25'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4", "label": "__init__", "type": "function", "loc": [369, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "vector": [2, 1, 0.4393, 0.0094, 1, 0.13, 0.5, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "format"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, format=None):\n super(DateInput, self).__init__(attrs)\n if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('DATE_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L370_C8", "label": "__init__()", "type": "expression", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4", "vector": [8, 2, 0.4363, 0.0012, 2, 0.95, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(DateInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "label": "if", "type": "if", "loc": [371, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4", "vector": [4, 2, 0.4404, 0.0071, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('DATE_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L372_C12", "label": "self.format =", "type": "assigned_variable", "loc": [372, 372], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "vector": [14, 3, 0.4387, 0.0012, 3, 0.88, 0.0, 896, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L373_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [373, 373], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "vector": [14, 3, 0.4399, 0.0012, 3, 0.88, 0.3333, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L375_C12", "label": "self.format =", "type": "assigned_variable", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "vector": [14, 3, 0.4422, 0.0012, 3, 0.88, 0.6667, 896, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = formats.get_format('DATE_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L376_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "vector": [14, 3, 0.4434, 0.0012, 3, 0.88, 1.0, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4", "label": "_format_value", "type": "function", "loc": [378, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "vector": [2, 1, 0.4493, 0.0083, 1, 0.13, 0.75, 785, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_format_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_value(self, value):\n if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n value = datetime_safe.new_date(value)\n return value.strftime(self.format)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8", "label": "if", "type": "if", "loc": [379, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4", "vector": [4, 2, 0.4493, 0.0059, 2, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n value = datetime_safe.new_date(value)\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L380_C12", "label": "return", "type": "return", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8", "vector": [13, 3, 0.4481, 0.0012, 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 formats.localize_input(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8", "label": "if", "type": "if", "loc": [381, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8", "vector": [4, 3, 0.4505, 0.0035, 3, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(value, 'strftime'):\n value = datetime_safe.new_date(value)\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L382_C12", "label": "value = new_date()", "type": "assigned_variable", "loc": [382, 382], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8", "vector": [14, 4, 0.4505, 0.0012, 4, 0.41, 0.0, 441, 3, 1, 0, 0, 584, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "new_date", "annotation": ""}, "snippet": " value = datetime_safe.new_date(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L383_C12", "label": "return", "type": "return", "loc": [383, 383], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8", "vector": [13, 4, 0.4517, 0.0012, 4, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L384_C8", "label": "return", "type": "return", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4", "vector": [13, 2, 0.4528, 0.0012, 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 value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4", "label": "_has_changed", "type": "function", "loc": [386, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "vector": [2, 1, 0.4605, 0.0118, 1, 0.13, 1.0, 719, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n # If our field has show_hidden_initial=True, initial will be a string\n # formatted by HiddenInput using formats.localize_input, which is not\n # necessarily the format used for this widget. Attempt to convert it.\n try:\n input_format = formats.get_format('DATE_INPUT_FORMATS')[0]\n initial = datetime.date(*time.strptime(initial, input_format)[:3])\n except (TypeError, ValueError):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8", "label": "try", "type": "try", "loc": [390, 394], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4", "vector": [7, 2, 0.4623, 0.0059, 2, 0.7, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n input_format = formats.get_format('DATE_INPUT_FORMATS')[0]\n initial = datetime.date(*time.strptime(initial, input_format)[:3])\n except (TypeError, ValueError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L391_C12", "label": "input_format =", "type": "assigned_variable", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8", "vector": [14, 3, 0.4611, 0.0012, 3, 0.07, 0.0, 626, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_format = formats.get_format('DATE_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L392_C12", "label": "initial = date()", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8", "vector": [14, 3, 0.4623, 0.0012, 3, 0.07, 1.0, 838, 3, 1, 0, 0, 56, 10, 2], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "date", "annotation": ""}, "snippet": " initial = datetime.date(*time.strptime(initial, input_format)[:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L395_C8", "label": "return", "type": "return", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4", "vector": [13, 2, 0.4658, 0.0012, 2, 0.7, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(DateInput, self)._has_changed(self._format_value(initial), data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "label": "DateTimeInput", "type": "class", "loc": [397, 427], "level": 0, "parent": null, "vector": [3, 0, 0.4858, 0.0366, 0, 0.66, 0.7143, 258, 0, 3, 0, 0, 35, 0, 13], "semantic": {"name": "DateTimeInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DateTimeInput(Input):\n input_type = 'text'\n format = '%Y-%m-%d %H:%M:%S' # '2006-10-25 14:30:59'\n\n def __init__(self, attrs=None, format=None):\n super(DateTimeInput, self).__init__(attrs)\n if format:\n self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L398_C4", "label": "input_type =", "type": "assigned_variable", "loc": [398, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "vector": [14, 1, 0.4693, 0.0012, 1, 0.55, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'text'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L399_C4", "label": "format =", "type": "assigned_variable", "loc": [399, 399], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "vector": [14, 1, 0.4705, 0.0012, 1, 0.55, 0.25, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = '%Y-%m-%d %H:%M:%S' # '2006-10-25 14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4", "label": "__init__", "type": "function", "loc": [401, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "vector": [2, 1, 0.477, 0.0094, 1, 0.55, 0.5, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "format"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, format=None):\n super(DateTimeInput, self).__init__(attrs)\n if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('DATETIME_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L402_C8", "label": "__init__()", "type": "expression", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4", "vector": [8, 2, 0.4741, 0.0012, 2, 0.06, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(DateTimeInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "label": "if", "type": "if", "loc": [403, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4", "vector": [4, 2, 0.4782, 0.0071, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('DATETIME_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L404_C12", "label": "self.format =", "type": "assigned_variable", "loc": [404, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "vector": [14, 3, 0.4764, 0.0012, 3, 0.18, 0.0, 896, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L405_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "vector": [14, 3, 0.4776, 0.0012, 3, 0.18, 0.3333, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L407_C12", "label": "self.format =", "type": "assigned_variable", "loc": [407, 407], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "vector": [14, 3, 0.48, 0.0012, 3, 0.18, 0.6667, 896, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = formats.get_format('DATETIME_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L408_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [408, 408], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "vector": [14, 3, 0.4811, 0.0012, 3, 0.18, 1.0, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4", "label": "_format_value", "type": "function", "loc": [410, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "vector": [2, 1, 0.487, 0.0083, 1, 0.55, 0.75, 785, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_format_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_value(self, value):\n if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n value = datetime_safe.new_datetime(value)\n return value.strftime(self.format)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8", "label": "if", "type": "if", "loc": [411, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4", "vector": [4, 2, 0.487, 0.0059, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n value = datetime_safe.new_datetime(value)\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L412_C12", "label": "return", "type": "return", "loc": [412, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8", "vector": [13, 3, 0.4858, 0.0012, 3, 0.96, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return formats.localize_input(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8", "label": "if", "type": "if", "loc": [413, 415], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8", "vector": [4, 3, 0.4882, 0.0035, 3, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(value, 'strftime'):\n value = datetime_safe.new_datetime(value)\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L414_C12", "label": "value = new_datetime()", "type": "assigned_variable", "loc": [414, 414], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8", "vector": [14, 4, 0.4882, 0.0012, 4, 0.81, 0.0, 441, 3, 1, 0, 0, 422, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "new_datetime", "annotation": ""}, "snippet": " value = datetime_safe.new_datetime(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L415_C12", "label": "return", "type": "return", "loc": [415, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8", "vector": [13, 4, 0.4894, 0.0012, 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 value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L416_C8", "label": "return", "type": "return", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4", "vector": [13, 2, 0.4906, 0.0012, 2, 0.04, 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_99002:FunctionDef_L418_C4", "label": "_has_changed", "type": "function", "loc": [418, 427], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "vector": [2, 1, 0.4982, 0.0118, 1, 0.55, 1.0, 719, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n # If our field has show_hidden_initial=True, initial will be a string\n # formatted by HiddenInput using formats.localize_input, which is not\n # necessarily the format used for this widget. Attempt to convert it.\n try:\n input_format = formats.get_format('DATETIME_INPUT_FORMATS')[0]\n initial = datetime.datetime(*time.strptime(initial, input_format)[:6])\n except (TypeError, ValueError):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8", "label": "try", "type": "try", "loc": [422, 426], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L418_C4", "vector": [7, 2, 0.5, 0.0059, 2, 0.44, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n input_format = formats.get_format('DATETIME_INPUT_FORMATS')[0]\n initial = datetime.datetime(*time.strptime(initial, input_format)[:6])\n except (TypeError, ValueError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L423_C12", "label": "input_format =", "type": "assigned_variable", "loc": [423, 423], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8", "vector": [14, 3, 0.4988, 0.0012, 3, 0.02, 0.0, 626, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_format = formats.get_format('DATETIME_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L424_C12", "label": "initial = datetime()", "type": "assigned_variable", "loc": [424, 424], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8", "vector": [14, 3, 0.5, 0.0012, 3, 0.02, 1.0, 838, 3, 1, 0, 0, 426, 10, 2], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "datetime", "annotation": ""}, "snippet": " initial = datetime.datetime(*time.strptime(initial, input_format)[:6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L427_C8", "label": "return", "type": "return", "loc": [427, 427], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L418_C4", "vector": [13, 2, 0.5035, 0.0012, 2, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(DateTimeInput, self)._has_changed(self._format_value(initial), data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "label": "TimeInput", "type": "class", "loc": [429, 458], "level": 0, "parent": null, "vector": [3, 0, 0.523, 0.0354, 0, 0.66, 0.7381, 260, 0, 3, 0, 0, 35, 0, 12], "semantic": {"name": "TimeInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TimeInput(Input):\n input_type = 'text'\n format = '%H:%M:%S' # '14:30:59'\n\n def __init__(self, attrs=None, format=None):\n super(TimeInput, self).__init__(attrs)\n if format:\n self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L430_C4", "label": "input_type =", "type": "assigned_variable", "loc": [430, 430], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "vector": [14, 1, 0.5071, 0.0012, 1, 0.43, 0.0, 16, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_type = 'text'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L431_C4", "label": "format =", "type": "assigned_variable", "loc": [431, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "vector": [14, 1, 0.5083, 0.0012, 1, 0.43, 0.25, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = '%H:%M:%S' # '14:30:59'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4", "label": "__init__", "type": "function", "loc": [433, 440], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "vector": [2, 1, 0.5147, 0.0094, 1, 0.43, 0.5, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "format"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, format=None):\n super(TimeInput, self).__init__(attrs)\n if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('TIME_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L434_C8", "label": "__init__()", "type": "expression", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4", "vector": [8, 2, 0.5118, 0.0012, 2, 0.4, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(TimeInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "label": "if", "type": "if", "loc": [435, 440], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4", "vector": [4, 2, 0.5159, 0.0071, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if format:\n self.format = format\n self.manual_format = True\n else:\n self.format = formats.get_format('TIME_INPUT_FORMATS')[0]\n self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L436_C12", "label": "self.format =", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "vector": [14, 3, 0.5142, 0.0012, 3, 0.96, 0.0, 896, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L437_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [437, 437], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "vector": [14, 3, 0.5153, 0.0012, 3, 0.96, 0.3333, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L439_C12", "label": "self.format =", "type": "assigned_variable", "loc": [439, 439], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "vector": [14, 3, 0.5177, 0.0012, 3, 0.96, 0.6667, 896, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.format = formats.get_format('TIME_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L440_C12", "label": "self.manual_format =", "type": "assigned_variable", "loc": [440, 440], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "vector": [14, 3, 0.5189, 0.0012, 3, 0.96, 1.0, 854, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.manual_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manual_format = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4", "label": "_format_value", "type": "function", "loc": [442, 447], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "vector": [2, 1, 0.5242, 0.0071, 1, 0.43, 0.75, 785, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_format_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_value(self, value):\n if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n return value.strftime(self.format)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8", "label": "if", "type": "if", "loc": [443, 446], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4", "vector": [4, 2, 0.5242, 0.0047, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_localized and not self.manual_format:\n return formats.localize_input(value)\n elif hasattr(value, 'strftime'):\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L444_C12", "label": "return", "type": "return", "loc": [444, 444], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8", "vector": [13, 3, 0.5236, 0.0012, 3, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return formats.localize_input(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L445_C8", "label": "if", "type": "if", "loc": [445, 446], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8", "vector": [4, 3, 0.5254, 0.0024, 3, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(value, 'strftime'):\n return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L446_C12", "label": "return", "type": "return", "loc": [446, 446], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L445_C8", "vector": [13, 4, 0.5259, 0.0012, 4, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.strftime(self.format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L447_C8", "label": "return", "type": "return", "loc": [447, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4", "vector": [13, 2, 0.5271, 0.0012, 2, 0.49, 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_99002:FunctionDef_L449_C4", "label": "_has_changed", "type": "function", "loc": [449, 458], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "vector": [2, 1, 0.5348, 0.0118, 1, 0.43, 1.0, 719, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n # If our field has show_hidden_initial=True, initial will be a string\n # formatted by HiddenInput using formats.localize_input, which is not\n # necessarily the format used for this widget. Attempt to convert it.\n try:\n input_format = formats.get_format('TIME_INPUT_FORMATS')[0]\n initial = datetime.time(*time.strptime(initial, input_format)[3:6])\n except (TypeError, ValueError):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8", "label": "try", "type": "try", "loc": [453, 457], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L449_C4", "vector": [7, 2, 0.5366, 0.0059, 2, 0.51, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n input_format = formats.get_format('TIME_INPUT_FORMATS')[0]\n initial = datetime.time(*time.strptime(initial, input_format)[3:6])\n except (TypeError, ValueError):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L454_C12", "label": "input_format =", "type": "assigned_variable", "loc": [454, 454], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8", "vector": [14, 3, 0.5354, 0.0012, 3, 0.29, 0.0, 626, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "input_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " input_format = formats.get_format('TIME_INPUT_FORMATS')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L455_C12", "label": "initial = time()", "type": "assigned_variable", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8", "vector": [14, 3, 0.5366, 0.0012, 3, 0.29, 1.0, 838, 3, 1, 0, 0, 654, 10, 2], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": " initial = datetime.time(*time.strptime(initial, input_format)[3:6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L458_C8", "label": "return", "type": "return", "loc": [458, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L449_C4", "vector": [13, 2, 0.5401, 0.0012, 2, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(TimeInput, self)._has_changed(self._format_value(initial), data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "label": "CheckboxInput", "type": "class", "loc": [460, 495], "level": 0, "parent": null, "vector": [3, 0, 0.5631, 0.0425, 0, 0.66, 0.7619, 609, 0, 4, 0, 0, 969, 0, 13], "semantic": {"name": "CheckboxInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CheckboxInput(Widget):\n def __init__(self, attrs=None, check_test=bool):\n super(CheckboxInput, self).__init__(attrs)\n # check_test is a callable that takes a value and returns True\n # if the checkbox should be checked for that value.\n self.check_test = check_test\n\n def render(self, name, value, attrs=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4", "label": "__init__", "type": "function", "loc": [461, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "vector": [2, 1, 0.546, 0.0059, 1, 0.5, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "check_test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, check_test=bool):\n super(CheckboxInput, self).__init__(attrs)\n # check_test is a callable that takes a value and returns True\n # if the checkbox should be checked for that value.\n self.check_test = check_test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L462_C8", "label": "__init__()", "type": "expression", "loc": [462, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4", "vector": [8, 2, 0.5448, 0.0012, 2, 0.22, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(CheckboxInput, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L465_C8", "label": "self.check_test =", "type": "assigned_variable", "loc": [465, 465], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4", "vector": [14, 2, 0.5483, 0.0012, 2, 0.22, 1.0, 189, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.check_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.check_test = check_test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "label": "render", "type": "function", "loc": [467, 478], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "vector": [2, 1, 0.5572, 0.0142, 1, 0.5, 0.3333, 24, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n final_attrs = self.build_attrs(attrs, type='checkbox', name=name)\n try:\n result = self.check_test(value)\n except: # Silently catch exceptions\n result = False\n if result:\n final_attrs['checked'] = 'checked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L468_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [468, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "vector": [14, 2, 0.5519, 0.0012, 2, 0.67, 0.0, 750, 3, 3, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, type='checkbox', name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8", "label": "try", "type": "try", "loc": [469, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "vector": [7, 2, 0.5548, 0.0047, 2, 0.67, 0.25, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = self.check_test(value)\n except: # Silently catch exceptions\n result = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L470_C12", "label": "result = check_test()", "type": "assigned_variable", "loc": [470, 470], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8", "vector": [14, 3, 0.5542, 0.0012, 3, 0.32, 0.0, 51, 3, 1, 0, 0, 2, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "check_test", "annotation": ""}, "snippet": " result = self.check_test(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L472_C12", "label": "result =", "type": "assigned_variable", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8", "vector": [14, 3, 0.5566, 0.0012, 3, 0.32, 0.0, 51, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L473_C8", "label": "if", "type": "if", "loc": [473, 474], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "vector": [4, 2, 0.5584, 0.0024, 2, 0.67, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result:\n final_attrs['checked'] = 'checked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L474_C12", "label": "assign", "type": "assigned_variable", "loc": [474, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L473_C8", "vector": [14, 3, 0.559, 0.0012, 3, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " final_attrs['checked'] = 'checked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L475_C8", "label": "if", "type": "if", "loc": [475, 477], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "vector": [4, 2, 0.5613, 0.0035, 2, 0.67, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value not in ('', True, False, None):\n # Only add the 'value' attribute if a value is non-empty.\n final_attrs['value'] = force_unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L477_C12", "label": " = force_unicode()", "type": "assigned_variable", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L475_C8", "vector": [14, 3, 0.5625, 0.0012, 3, 0.25, 0.0, 0, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " final_attrs['value'] = force_unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L478_C8", "label": "return", "type": "return", "loc": [478, 478], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "vector": [13, 2, 0.5637, 0.0012, 2, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<input%s />' % flatatt(final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "label": "value_from_datadict", "type": "function", "loc": [480, 490], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "vector": [2, 1, 0.5719, 0.013, 1, 0.5, 0.6667, 272, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n if name not in data:\n # A missing value means False because HTML form submission does not\n # send results for unselected checkboxes.\n return False\n value = data.get(name)\n # Translate true and false strings to boolean values.\n values = {'true': True, 'false': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L481_C8", "label": "if", "type": "if", "loc": [481, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "vector": [4, 2, 0.569, 0.0047, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in data:\n # A missing value means False because HTML form submission does not\n # send results for unselected checkboxes.\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L484_C12", "label": "return", "type": "return", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L481_C8", "vector": [13, 3, 0.5708, 0.0012, 3, 0.77, 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_99002:Assign_L485_C8", "label": "value = get()", "type": "assigned_variable", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "vector": [14, 2, 0.5719, 0.0012, 2, 0.42, 0.25, 441, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = data.get(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L487_C8", "label": "values =", "type": "assigned_variable", "loc": [487, 487], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "vector": [14, 2, 0.5743, 0.0012, 2, 0.42, 0.5, 721, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = {'true': True, 'false': False}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L488_C8", "label": "if", "type": "if", "loc": [488, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "vector": [4, 2, 0.5761, 0.0024, 2, 0.42, 0.75, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, basestring):\n value = values.get(value.lower(), value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L489_C12", "label": "value = get()", "type": "assigned_variable", "loc": [489, 489], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L488_C8", "vector": [14, 3, 0.5767, 0.0012, 3, 0.55, 0.0, 441, 3, 2, 0, 0, 607, 10, 2], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = values.get(value.lower(), value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L490_C8", "label": "return", "type": "return", "loc": [490, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "vector": [13, 2, 0.5778, 0.0012, 2, 0.42, 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_99002:FunctionDef_L492_C4", "label": "_has_changed", "type": "function", "loc": [492, 495], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "vector": [2, 1, 0.582, 0.0047, 1, 0.5, 1.0, 719, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n # Sometimes data or initial could be None or u'' which should be the\n # same thing as False.\n return bool(initial) != bool(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L495_C8", "label": "return", "type": "return", "loc": [495, 495], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L492_C4", "vector": [13, 2, 0.5837, 0.0012, 2, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(initial) != bool(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "label": "Select", "type": "class", "loc": [497, 534], "level": 0, "parent": null, "vector": [3, 0, 0.6079, 0.0448, 0, 0.66, 0.7857, 366, 0, 4, 0, 0, 969, 0, 27], "semantic": {"name": "Select", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Select(Widget):\n def __init__(self, attrs=None, choices=()):\n super(Select, self).__init__(attrs)\n # choices can be any iterable, but we may need to render this widget\n # multiple times. Thus, collapse it into a list so it can be consumed\n # more than once.\n self.choices = list(choices)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4", "label": "__init__", "type": "function", "loc": [498, 503], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "vector": [2, 1, 0.5902, 0.0071, 1, 0.36, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, choices=()):\n super(Select, self).__init__(attrs)\n # choices can be any iterable, but we may need to render this widget\n # multiple times. Thus, collapse it into a list so it can be consumed\n # more than once.\n self.choices = list(choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L499_C8", "label": "__init__()", "type": "expression", "loc": [499, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4", "vector": [8, 2, 0.5884, 0.0012, 2, 0.24, 0.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Select, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L503_C8", "label": "self.choices = list()", "type": "assigned_variable", "loc": [503, 503], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4", "vector": [14, 2, 0.5932, 0.0012, 2, 0.24, 1.0, 259, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "self.choices", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self.choices = list(choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "label": "render", "type": "function", "loc": [505, 513], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "vector": [2, 1, 0.6002, 0.0106, 1, 0.36, 0.3333, 24, 0, 5, 1, 0, 0, 0, 7], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n if value is None: value = ''\n final_attrs = self.build_attrs(attrs, name=name)\n output = [u'<select%s>' % flatatt(final_attrs)]\n options = self.render_options(choices, [value])\n if options:\n output.append(options)\n output.append(u'</select>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L506_C8", "label": "if", "type": "if", "loc": [506, 506], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [4, 2, 0.5967, 0.0012, 2, 0.21, 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: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L506_C26", "label": "value =", "type": "assigned_variable", "loc": [506, 506], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L506_C8", "vector": [14, 3, 0.5967, 0.0012, 3, 0.54, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L507_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [507, 507], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [14, 2, 0.5979, 0.0012, 2, 0.21, 0.1667, 750, 3, 2, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L508_C8", "label": "output =", "type": "assigned_variable", "loc": [508, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [14, 2, 0.5991, 0.0012, 2, 0.21, 0.3333, 886, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = [u'<select%s>' % flatatt(final_attrs)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L509_C8", "label": "options = render_options()", "type": "assigned_variable", "loc": [509, 509], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [14, 2, 0.6002, 0.0012, 2, 0.21, 0.5, 707, 3, 2, 0, 0, 264, 10, 1], "semantic": {"name": "options", "arg_names": [], "import_names": [], "rhs_call_name": "render_options", "annotation": ""}, "snippet": " options = self.render_options(choices, [value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L510_C8", "label": "if", "type": "if", "loc": [510, 511], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [4, 2, 0.602, 0.0024, 2, 0.21, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if options:\n output.append(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L511_C12", "label": "append()", "type": "expression", "loc": [511, 511], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L510_C8", "vector": [8, 3, 0.6026, 0.0012, 3, 0.79, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L512_C8", "label": "append()", "type": "expression", "loc": [512, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [8, 2, 0.6038, 0.0012, 2, 0.21, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(u'</select>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L513_C8", "label": "return", "type": "return", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "vector": [13, 2, 0.605, 0.0012, 2, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'\\n'.join(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "label": "render_option", "type": "function", "loc": [515, 520], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "vector": [2, 1, 0.6103, 0.0071, 1, 0.36, 0.6667, 258, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "render_option", "arg_names": ["self", "selected_choices", "option_value", "option_label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render_option(self, selected_choices, option_value, option_label):\n option_value = force_unicode(option_value)\n selected_html = (option_value in selected_choices) and u' selected=\"selected\"' or ''\n return u'<option value=\"%s\"%s>%s</option>' % (\n escape(option_value), selected_html,\n conditional_escape(force_unicode(option_label)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L516_C8", "label": "option_value = force_unicode()", "type": "assigned_variable", "loc": [516, 516], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "vector": [14, 2, 0.6085, 0.0012, 2, 0.82, 0.0, 495, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "option_value", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " option_value = force_unicode(option_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L517_C8", "label": "selected_html =", "type": "assigned_variable", "loc": [517, 517], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "vector": [14, 2, 0.6097, 0.0012, 2, 0.82, 0.5, 652, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "selected_html", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selected_html = (option_value in selected_choices) and u' selected=\"selected\"' or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L518_C8", "label": "return", "type": "return", "loc": [518, 520], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "vector": [13, 2, 0.612, 0.0035, 2, 0.82, 1.0, 0, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'<option value=\"%s\"%s>%s</option>' % (\n escape(option_value), selected_html,\n conditional_escape(force_unicode(option_label)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "label": "render_options", "type": "function", "loc": [522, 534], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "vector": [2, 1, 0.6226, 0.0153, 1, 0.36, 1.0, 264, 0, 3, 1, 0, 0, 0, 13], "semantic": {"name": "render_options", "arg_names": ["self", "choices", "selected_choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render_options(self, choices, selected_choices):\n # Normalize to strings.\n selected_choices = set([force_unicode(v) for v in selected_choices])\n output = []\n for option_value, option_label in chain(self.choices, choices):\n if isinstance(option_label, (list, tuple)):\n output.append(u'<optgroup label=\"%s\">' % escape(force_unicode(option_value)))\n for option in option_label:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L524_C8", "label": "selected_choices = set()", "type": "assigned_variable", "loc": [524, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "vector": [14, 2, 0.6179, 0.0012, 2, 0.43, 0.0, 341, 3, 1, 0, 0, 21, 10, 2], "semantic": {"name": "selected_choices", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " selected_choices = set([force_unicode(v) for v in selected_choices])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L525_C8", "label": "output =", "type": "assigned_variable", "loc": [525, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "vector": [14, 2, 0.6191, 0.0012, 2, 0.43, 0.3333, 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_99002:For_L526_C8", "label": "for option_value, option_label", "type": "for", "loc": [526, 533], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "vector": [6, 2, 0.6244, 0.0094, 2, 0.43, 0.6667, 60, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "option_value, option_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for option_value, option_label in chain(self.choices, choices):\n if isinstance(option_label, (list, tuple)):\n output.append(u'<optgroup label=\"%s\">' % escape(force_unicode(option_value)))\n for option in option_label:\n output.append(self.render_option(selected_choices, *option))\n output.append(u'</optgroup>')\n else:\n output.append(self.render_option(selected_choices, option_value, option_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "label": "if", "type": "if", "loc": [527, 533], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L526_C8", "vector": [4, 3, 0.625, 0.0083, 3, 0.87, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(option_label, (list, tuple)):\n output.append(u'<optgroup label=\"%s\">' % escape(force_unicode(option_value)))\n for option in option_label:\n output.append(self.render_option(selected_choices, *option))\n output.append(u'</optgroup>')\n else:\n output.append(self.render_option(selected_choices, option_value, option_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L528_C16", "label": "append()", "type": "expression", "loc": [528, 528], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "vector": [8, 4, 0.6226, 0.0012, 4, 0.34, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(u'<optgroup label=\"%s\">' % escape(force_unicode(option_value)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L529_C16", "label": "for option", "type": "for", "loc": [529, 530], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "vector": [6, 4, 0.6244, 0.0024, 4, 0.34, 0.3333, 751, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "option", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for option in option_label:\n output.append(self.render_option(selected_choices, *option))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L530_C20", "label": "append()", "type": "expression", "loc": [530, 530], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L529_C16", "vector": [8, 5, 0.625, 0.0012, 5, 0.61, 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(self.render_option(selected_choices, *option))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L531_C16", "label": "append()", "type": "expression", "loc": [531, 531], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "vector": [8, 4, 0.6262, 0.0012, 4, 0.34, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(u'</optgroup>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L533_C16", "label": "append()", "type": "expression", "loc": [533, 533], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "vector": [8, 4, 0.6285, 0.0012, 4, 0.34, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(self.render_option(selected_choices, option_value, option_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L534_C8", "label": "return", "type": "return", "loc": [534, 534], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "vector": [13, 2, 0.6297, 0.0012, 2, 0.43, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u'\\n'.join(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "label": "NullBooleanSelect", "type": "class", "loc": [536, 567], "level": 0, "parent": null, "vector": [3, 0, 0.6504, 0.0377, 0, 0.66, 0.8095, 548, 0, 4, 0, 0, 366, 0, 11], "semantic": {"name": "NullBooleanSelect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NullBooleanSelect(Select):\n \"\"\"\n A Select Widget intended to be used with NullBooleanField.\n \"\"\"\n def __init__(self, attrs=None):\n choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No')))\n super(NullBooleanSelect, self).__init__(attrs, choices)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L537_C4", "label": "expression", "type": "expression", "loc": [537, 539], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "vector": [8, 1, 0.6344, 0.0035, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A Select Widget intended to be used with NullBooleanField.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4", "label": "__init__", "type": "function", "loc": [540, 542], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "vector": [2, 1, 0.638, 0.0035, 1, 0.35, 0.25, 555, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None):\n choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No')))\n super(NullBooleanSelect, self).__init__(attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L541_C8", "label": "choices =", "type": "assigned_variable", "loc": [541, 541], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4", "vector": [14, 2, 0.638, 0.0012, 2, 0.49, 0.0, 405, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "choices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " choices = ((u'1', ugettext('Unknown')), (u'2', ugettext('Yes')), (u'3', ugettext('No')))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L542_C8", "label": "__init__()", "type": "expression", "loc": [542, 542], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4", "vector": [8, 2, 0.6392, 0.0012, 2, 0.49, 1.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(NullBooleanSelect, self).__init__(attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4", "label": "render", "type": "function", "loc": [544, 549], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "vector": [2, 1, 0.6445, 0.0071, 1, 0.35, 0.5, 24, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n try:\n value = {True: u'2', False: u'3', u'2': u'2', u'3': u'3'}[value]\n except KeyError:\n value = u'1'\n return super(NullBooleanSelect, self).render(name, value, attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8", "label": "try", "type": "try", "loc": [545, 548], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4", "vector": [7, 2, 0.6445, 0.0047, 2, 0.83, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n value = {True: u'2', False: u'3', u'2': u'2', u'3': u'3'}[value]\n except KeyError:\n value = u'1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L546_C12", "label": "value =", "type": "assigned_variable", "loc": [546, 546], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8", "vector": [14, 3, 0.6439, 0.0012, 3, 0.92, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = {True: u'2', False: u'3', u'2': u'2', u'3': u'3'}[value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L548_C12", "label": "value =", "type": "assigned_variable", "loc": [548, 548], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8", "vector": [14, 3, 0.6462, 0.0012, 3, 0.92, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = u'1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L549_C8", "label": "return", "type": "return", "loc": [549, 549], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4", "vector": [13, 2, 0.6474, 0.0012, 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 super(NullBooleanSelect, self).render(name, value, attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4", "label": "value_from_datadict", "type": "function", "loc": [551, 558], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "vector": [2, 1, 0.6539, 0.0094, 1, 0.35, 0.75, 272, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n value = data.get(name, None)\n return {u'2': True,\n True: True,\n 'True': True,\n u'3': False,\n 'False': False,\n False: False}.get(value, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L552_C8", "label": "value = get()", "type": "assigned_variable", "loc": [552, 552], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4", "vector": [14, 2, 0.6509, 0.0012, 2, 0.22, 0.0, 441, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " value = data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L553_C8", "label": "return", "type": "return", "loc": [553, 558], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4", "vector": [13, 2, 0.6551, 0.0071, 2, 0.22, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {u'2': True,\n True: True,\n 'True': True,\n u'3': False,\n 'False': False,\n False: False}.get(value, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "label": "_has_changed", "type": "function", "loc": [560, 567], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "vector": [2, 1, 0.6645, 0.0094, 1, 0.35, 1.0, 719, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n # For a NullBooleanSelect, None (unknown) and False (No)\n # are not the same\n if initial is not None:\n initial = bool(initial)\n if data is not None:\n data = bool(data)\n return initial != data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L563_C8", "label": "if", "type": "if", "loc": [563, 564], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "vector": [4, 2, 0.6645, 0.0024, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if initial is not None:\n initial = bool(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L564_C12", "label": "initial = bool()", "type": "assigned_variable", "loc": [564, 564], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L563_C8", "vector": [14, 3, 0.6651, 0.0012, 3, 0.91, 0.0, 838, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " initial = bool(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L565_C8", "label": "if", "type": "if", "loc": [565, 566], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "vector": [4, 2, 0.6669, 0.0024, 2, 0.24, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is not None:\n data = bool(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L566_C12", "label": "data = bool()", "type": "assigned_variable", "loc": [566, 566], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L565_C8", "vector": [14, 3, 0.6675, 0.0012, 3, 0.02, 0.0, 929, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " data = bool(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L567_C8", "label": "return", "type": "return", "loc": [567, 567], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "vector": [13, 2, 0.6686, 0.0012, 2, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return initial != data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "label": "SelectMultiple", "type": "class", "loc": [569, 595], "level": 0, "parent": null, "vector": [3, 0, 0.6863, 0.0318, 0, 0.66, 0.8333, 630, 0, 3, 0, 0, 366, 0, 15], "semantic": {"name": "SelectMultiple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SelectMultiple(Select):\n def render(self, name, value, attrs=None, choices=()):\n if value is None: value = []\n final_attrs = self.build_attrs(attrs, name=name)\n output = [u'<select multiple=\"multiple\"%s>' % flatatt(final_attrs)]\n options = self.render_options(choices, value)\n if options:\n output.append(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "label": "render", "type": "function", "loc": [570, 578], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "vector": [2, 1, 0.6769, 0.0106, 1, 0.19, 0.0, 24, 0, 5, 1, 0, 0, 0, 7], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n if value is None: value = []\n final_attrs = self.build_attrs(attrs, name=name)\n output = [u'<select multiple=\"multiple\"%s>' % flatatt(final_attrs)]\n options = self.render_options(choices, value)\n if options:\n output.append(options)\n output.append('</select>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L571_C8", "label": "if", "type": "if", "loc": [571, 571], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [4, 2, 0.6733, 0.0012, 2, 0.58, 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: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L571_C26", "label": "value =", "type": "assigned_variable", "loc": [571, 571], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L571_C8", "vector": [14, 3, 0.6733, 0.0012, 3, 0.29, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L572_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [572, 572], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [14, 2, 0.6745, 0.0012, 2, 0.58, 0.1667, 750, 3, 2, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L573_C8", "label": "output =", "type": "assigned_variable", "loc": [573, 573], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [14, 2, 0.6757, 0.0012, 2, 0.58, 0.3333, 886, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = [u'<select multiple=\"multiple\"%s>' % flatatt(final_attrs)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L574_C8", "label": "options = render_options()", "type": "assigned_variable", "loc": [574, 574], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [14, 2, 0.6769, 0.0012, 2, 0.58, 0.5, 707, 3, 2, 0, 0, 264, 10, 1], "semantic": {"name": "options", "arg_names": [], "import_names": [], "rhs_call_name": "render_options", "annotation": ""}, "snippet": " options = self.render_options(choices, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L575_C8", "label": "if", "type": "if", "loc": [575, 576], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [4, 2, 0.6787, 0.0024, 2, 0.58, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if options:\n output.append(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L576_C12", "label": "append()", "type": "expression", "loc": [576, 576], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L575_C8", "vector": [8, 3, 0.6792, 0.0012, 3, 0.04, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(options)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L577_C8", "label": "append()", "type": "expression", "loc": [577, 577], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [8, 2, 0.6804, 0.0012, 2, 0.58, 0.8333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append('</select>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L578_C8", "label": "return", "type": "return", "loc": [578, 578], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "vector": [13, 2, 0.6816, 0.0012, 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 mark_safe(u'\\n'.join(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4", "label": "value_from_datadict", "type": "function", "loc": [580, 583], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "vector": [2, 1, 0.6857, 0.0047, 1, 0.19, 0.5, 272, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n if isinstance(data, (MultiValueDict, MergeDict)):\n return data.getlist(name)\n return data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L581_C8", "label": "if", "type": "if", "loc": [581, 582], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4", "vector": [4, 2, 0.6857, 0.0024, 2, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(data, (MultiValueDict, MergeDict)):\n return data.getlist(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L582_C12", "label": "return", "type": "return", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L581_C8", "vector": [13, 3, 0.6863, 0.0012, 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 data.getlist(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L583_C8", "label": "return", "type": "return", "loc": [583, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4", "vector": [13, 2, 0.6875, 0.0012, 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 data.get(name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "label": "_has_changed", "type": "function", "loc": [585, 595], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "vector": [2, 1, 0.6958, 0.013, 1, 0.19, 1.0, 719, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n if initial is None:\n initial = []\n if data is None:\n data = []\n if len(initial) != len(data):\n return True\n for value1, value2 in zip(initial, data):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L586_C8", "label": "if", "type": "if", "loc": [586, 587], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "vector": [4, 2, 0.6916, 0.0024, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if initial is None:\n initial = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L587_C12", "label": "initial =", "type": "assigned_variable", "loc": [587, 587], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L586_C8", "vector": [14, 3, 0.6922, 0.0012, 3, 0.96, 0.0, 838, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L588_C8", "label": "if", "type": "if", "loc": [588, 589], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "vector": [4, 2, 0.694, 0.0024, 2, 0.46, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is None:\n data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L589_C12", "label": "data =", "type": "assigned_variable", "loc": [589, 589], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L588_C8", "vector": [14, 3, 0.6946, 0.0012, 3, 0.09, 0.0, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L590_C8", "label": "if", "type": "if", "loc": [590, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "vector": [4, 2, 0.6963, 0.0024, 2, 0.46, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(initial) != len(data):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L591_C12", "label": "return", "type": "return", "loc": [591, 591], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L590_C8", "vector": [13, 3, 0.6969, 0.0012, 3, 0.62, 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_99002:For_L592_C8", "label": "for value1, value2", "type": "for", "loc": [592, 594], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "vector": [6, 2, 0.6993, 0.0035, 2, 0.46, 0.75, 754, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "value1, value2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for value1, value2 in zip(initial, data):\n if force_unicode(value1) != force_unicode(value2):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L593_C12", "label": "if", "type": "if", "loc": [593, 594], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L592_C8", "vector": [4, 3, 0.6999, 0.0024, 3, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if force_unicode(value1) != force_unicode(value2):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L594_C16", "label": "return", "type": "return", "loc": [594, 594], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L593_C12", "vector": [13, 4, 0.7005, 0.0012, 4, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L595_C8", "label": "return", "type": "return", "loc": [595, 595], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "vector": [13, 2, 0.7017, 0.0012, 2, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "label": "RadioInput", "type": "class", "loc": [597, 627], "level": 0, "parent": null, "vector": [3, 0, 0.7217, 0.0366, 0, 0.66, 0.8571, 227, 0, 4, 0, 0, 599, 0, 10], "semantic": {"name": "RadioInput", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RadioInput(StrAndUnicode):\n \"\"\"\n An object used by RadioFieldRenderer that represents a single\n <input type='radio'>.\n \"\"\"\n\n def __init__(self, name, value, attrs, choice, index):\n self.name, self.value = name, value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L598_C4", "label": "expression", "type": "expression", "loc": [598, 601], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "vector": [8, 1, 0.707, 0.0047, 1, 0.58, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An object used by RadioFieldRenderer that represents a single\n <input type='radio'>.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "label": "__init__", "type": "function", "loc": [603, 608], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "vector": [2, 1, 0.714, 0.0071, 1, 0.58, 0.25, 555, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "name", "value", "attrs", "choice", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, value, attrs, choice, index):\n self.name, self.value = name, value\n self.attrs = attrs\n self.choice_value = force_unicode(choice[0])\n self.choice_label = force_unicode(choice[1])\n self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L604_C8", "label": "assign", "type": "assigned_variable", "loc": [604, 604], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "vector": [14, 2, 0.7123, 0.0012, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name, self.value = name, value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L605_C8", "label": "self.attrs =", "type": "assigned_variable", "loc": [605, 605], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "vector": [14, 2, 0.7134, 0.0012, 2, 0.46, 0.25, 793, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.attrs = attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L606_C8", "label": "self.choice_value = force_unicode()", "type": "assigned_variable", "loc": [606, 606], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "vector": [14, 2, 0.7146, 0.0012, 2, 0.46, 0.5, 280, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "self.choice_value", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " self.choice_value = force_unicode(choice[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L607_C8", "label": "self.choice_label = force_unicode()", "type": "assigned_variable", "loc": [607, 607], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "vector": [14, 2, 0.7158, 0.0012, 2, 0.46, 0.75, 739, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "self.choice_label", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " self.choice_label = force_unicode(choice[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L608_C8", "label": "self.index =", "type": "assigned_variable", "loc": [608, 608], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "vector": [14, 2, 0.717, 0.0012, 2, 0.46, 1.0, 777, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "label": "__unicode__", "type": "function", "loc": [610, 616], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "vector": [2, 1, 0.7229, 0.0083, 1, 0.58, 0.5, 318, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n if 'id' in self.attrs:\n label_for = ' for=\"%s_%s\"' % (self.attrs['id'], self.index)\n else:\n label_for = ''\n choice_label = conditional_escape(force_unicode(self.choice_label))\n return mark_safe(u'<label%s>%s %s</label>' % (label_for, self.tag(), choice_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8", "label": "if", "type": "if", "loc": [611, 614], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "vector": [4, 2, 0.7223, 0.0047, 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 'id' in self.attrs:\n label_for = ' for=\"%s_%s\"' % (self.attrs['id'], self.index)\n else:\n label_for = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L612_C12", "label": "label_for =", "type": "assigned_variable", "loc": [612, 612], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8", "vector": [14, 3, 0.7217, 0.0012, 3, 0.65, 0.0, 587, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label_for", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_for = ' for=\"%s_%s\"' % (self.attrs['id'], self.index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L614_C12", "label": "label_for =", "type": "assigned_variable", "loc": [614, 614], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8", "vector": [14, 3, 0.7241, 0.0012, 3, 0.65, 1.0, 587, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label_for", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_for = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L615_C8", "label": "choice_label = conditional_escape()", "type": "assigned_variable", "loc": [615, 615], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "vector": [14, 2, 0.7252, 0.0012, 2, 0.67, 0.5, 815, 3, 1, 0, 0, 171, 10, 2], "semantic": {"name": "choice_label", "arg_names": [], "import_names": [], "rhs_call_name": "conditional_escape", "annotation": ""}, "snippet": " choice_label = conditional_escape(force_unicode(self.choice_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L616_C8", "label": "return", "type": "return", "loc": [616, 616], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "vector": [13, 2, 0.7264, 0.0012, 2, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<label%s>%s %s</label>' % (label_for, self.tag(), choice_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L618_C4", "label": "is_checked", "type": "function", "loc": [618, 619], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "vector": [2, 1, 0.7294, 0.0024, 1, 0.58, 0.75, 585, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_checked", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_checked(self):\n return self.value == self.choice_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L619_C8", "label": "return", "type": "return", "loc": [619, 619], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L618_C4", "vector": [13, 2, 0.73, 0.0012, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.value == self.choice_value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "label": "tag", "type": "function", "loc": [621, 627], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "vector": [2, 1, 0.7358, 0.0083, 1, 0.58, 1.0, 732, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "tag", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tag(self):\n if 'id' in self.attrs:\n self.attrs['id'] = '%s_%s' % (self.attrs['id'], self.index)\n final_attrs = dict(self.attrs, type='radio', name=self.name, value=self.choice_value)\n if self.is_checked():\n final_attrs['checked'] = 'checked'\n return mark_safe(u'<input%s />' % flatatt(final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L622_C8", "label": "if", "type": "if", "loc": [622, 623], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "vector": [4, 2, 0.7341, 0.0024, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'id' in self.attrs:\n self.attrs['id'] = '%s_%s' % (self.attrs['id'], self.index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L623_C12", "label": "assign", "type": "assigned_variable", "loc": [623, 623], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L622_C8", "vector": [14, 3, 0.7347, 0.0012, 3, 0.29, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.attrs['id'] = '%s_%s' % (self.attrs['id'], self.index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L624_C8", "label": "final_attrs = dict()", "type": "assigned_variable", "loc": [624, 624], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "vector": [14, 2, 0.7358, 0.0012, 2, 0.09, 0.3333, 750, 3, 4, 0, 0, 827, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " final_attrs = dict(self.attrs, type='radio', name=self.name, value=self.choice_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L625_C8", "label": "if", "type": "if", "loc": [625, 626], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "vector": [4, 2, 0.7376, 0.0024, 2, 0.09, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_checked():\n final_attrs['checked'] = 'checked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L626_C12", "label": "assign", "type": "assigned_variable", "loc": [626, 626], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L625_C8", "vector": [14, 3, 0.7382, 0.0012, 3, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " final_attrs['checked'] = 'checked'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L627_C8", "label": "return", "type": "return", "loc": [627, 627], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "vector": [13, 2, 0.7394, 0.0012, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<input%s />' % flatatt(final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "label": "RadioFieldRenderer", "type": "class", "loc": [629, 652], "level": 0, "parent": null, "vector": [3, 0, 0.7553, 0.0283, 0, 0.66, 0.881, 556, 0, 5, 0, 0, 599, 0, 9], "semantic": {"name": "RadioFieldRenderer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RadioFieldRenderer(StrAndUnicode):\n \"\"\"\n An object used by RadioSelect to enable customization of radio widgets.\n \"\"\"\n\n def __init__(self, name, value, attrs, choices):\n self.name, self.value, self.attrs = name, value, attrs\n self.choices = choices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L630_C4", "label": "expression", "type": "expression", "loc": [630, 632], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [8, 1, 0.7441, 0.0035, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An object used by RadioSelect to enable customization of radio widgets.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4", "label": "__init__", "type": "function", "loc": [634, 636], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [2, 1, 0.7488, 0.0035, 1, 0.27, 0.2, 555, 0, 5, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, value, attrs, choices):\n self.name, self.value, self.attrs = name, value, attrs\n self.choices = choices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L635_C8", "label": "assign", "type": "assigned_variable", "loc": [635, 635], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4", "vector": [14, 2, 0.7488, 0.0012, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name, self.value, self.attrs = name, value, attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L636_C8", "label": "self.choices =", "type": "assigned_variable", "loc": [636, 636], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4", "vector": [14, 2, 0.75, 0.0012, 2, 0.57, 1.0, 259, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.choices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.choices = choices"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L638_C4", "label": "__iter__", "type": "function", "loc": [638, 640], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [2, 1, 0.7535, 0.0035, 1, 0.27, 0.4, 891, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n for i, choice in enumerate(self.choices):\n yield RadioInput(self.name, self.value, self.attrs.copy(), choice, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L639_C8", "label": "for i, choice", "type": "for", "loc": [639, 640], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L638_C4", "vector": [6, 2, 0.7541, 0.0024, 2, 0.74, 0.0, 700, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i, choice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, choice in enumerate(self.choices):\n yield RadioInput(self.name, self.value, self.attrs.copy(), choice, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L640_C12", "label": "expression", "type": "expression", "loc": [640, 640], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L639_C8", "vector": [8, 3, 0.7547, 0.0012, 3, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield RadioInput(self.name, self.value, self.attrs.copy(), choice, i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4", "label": "__getitem__", "type": "function", "loc": [642, 644], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [2, 1, 0.7583, 0.0035, 1, 0.27, 0.6, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__getitem__", "arg_names": ["self", "idx"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, idx):\n choice = self.choices[idx] # Let the IndexError propogate\n return RadioInput(self.name, self.value, self.attrs.copy(), choice, idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L643_C8", "label": "choice =", "type": "assigned_variable", "loc": [643, 643], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4", "vector": [14, 2, 0.7583, 0.0012, 2, 0.92, 0.0, 30, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "choice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " choice = self.choices[idx] # Let the IndexError propogate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L644_C8", "label": "return", "type": "return", "loc": [644, 644], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4", "vector": [13, 2, 0.7594, 0.0012, 2, 0.92, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return RadioInput(self.name, self.value, self.attrs.copy(), choice, idx)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L646_C4", "label": "__unicode__", "type": "function", "loc": [646, 647], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [2, 1, 0.7624, 0.0024, 1, 0.27, 0.8, 318, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n return self.render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L647_C8", "label": "return", "type": "return", "loc": [647, 647], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L646_C4", "vector": [13, 2, 0.763, 0.0012, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4", "label": "render", "type": "function", "loc": [649, 652], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "vector": [2, 1, 0.7671, 0.0047, 1, 0.27, 1.0, 24, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "render", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self):\n \"\"\"Outputs a <ul> for this set of radio fields.\"\"\"\n return mark_safe(u'<ul>\\n%s\\n</ul>' % u'\\n'.join([u'<li>%s</li>'\n % force_unicode(w) for w in self]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L650_C8", "label": "expression", "type": "expression", "loc": [650, 650], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4", "vector": [8, 2, 0.7665, 0.0012, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Outputs a <ul> for this set of radio fields.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L651_C8", "label": "return", "type": "return", "loc": [651, 652], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4", "vector": [13, 2, 0.7683, 0.0024, 2, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'<ul>\\n%s\\n</ul>' % u'\\n'.join([u'<li>%s</li>'\n % force_unicode(w) for w in self]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "label": "RadioSelect", "type": "class", "loc": [654, 683], "level": 0, "parent": null, "vector": [3, 0, 0.7883, 0.0354, 0, 0.66, 0.9048, 967, 0, 4, 0, 0, 366, 0, 11], "semantic": {"name": "RadioSelect", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RadioSelect(Select):\n renderer = RadioFieldRenderer\n\n def __init__(self, *args, **kwargs):\n # Override the default renderer if we were passed one.\n renderer = kwargs.pop('renderer', None)\n if renderer:\n self.renderer = renderer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L655_C4", "label": "renderer =", "type": "assigned_variable", "loc": [655, 655], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [14, 1, 0.7724, 0.0012, 1, 0.03, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "renderer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " renderer = RadioFieldRenderer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "label": "__init__", "type": "function", "loc": [657, 662], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [2, 1, 0.7777, 0.0071, 1, 0.03, 0.2, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n # Override the default renderer if we were passed one.\n renderer = kwargs.pop('renderer', None)\n if renderer:\n self.renderer = renderer\n super(RadioSelect, self).__init__(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L659_C8", "label": "renderer = pop()", "type": "assigned_variable", "loc": [659, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "vector": [14, 2, 0.7771, 0.0012, 2, 0.62, 0.0, 428, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "renderer", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " renderer = kwargs.pop('renderer', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L660_C8", "label": "if", "type": "if", "loc": [660, 661], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "vector": [4, 2, 0.7789, 0.0024, 2, 0.62, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if renderer:\n self.renderer = renderer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L661_C12", "label": "self.renderer =", "type": "assigned_variable", "loc": [661, 661], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L660_C8", "vector": [14, 3, 0.7795, 0.0012, 3, 0.89, 0.0, 130, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.renderer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.renderer = renderer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L662_C8", "label": "__init__()", "type": "expression", "loc": [662, 662], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "vector": [8, 2, 0.7807, 0.0012, 2, 0.62, 1.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(RadioSelect, self).__init__(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "label": "get_renderer", "type": "function", "loc": [664, 670], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [2, 1, 0.7866, 0.0083, 1, 0.03, 0.4, 966, 0, 5, 1, 0, 0, 0, 5], "semantic": {"name": "get_renderer", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_renderer(self, name, value, attrs=None, choices=()):\n \"\"\"Returns an instance of the renderer.\"\"\"\n if value is None: value = ''\n str_value = force_unicode(value) # Normalize to string.\n final_attrs = self.build_attrs(attrs)\n choices = list(chain(self.choices, choices))\n return self.renderer(name, str_value, final_attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L665_C8", "label": "expression", "type": "expression", "loc": [665, 665], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [8, 2, 0.7842, 0.0012, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns an instance of the renderer.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L666_C8", "label": "if", "type": "if", "loc": [666, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [4, 2, 0.7854, 0.0012, 2, 0.42, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L666_C26", "label": "value =", "type": "assigned_variable", "loc": [666, 666], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L666_C8", "vector": [14, 3, 0.7854, 0.0012, 3, 0.97, 0.0, 441, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L667_C8", "label": "str_value = force_unicode()", "type": "assigned_variable", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [14, 2, 0.7866, 0.0012, 2, 0.42, 0.4, 147, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "str_value", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " str_value = force_unicode(value) # Normalize to string."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L668_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [668, 668], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [14, 2, 0.7877, 0.0012, 2, 0.42, 0.6, 750, 3, 1, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L669_C8", "label": "choices = list()", "type": "assigned_variable", "loc": [669, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [14, 2, 0.7889, 0.0012, 2, 0.42, 0.8, 405, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "choices", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " choices = list(chain(self.choices, choices))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L670_C8", "label": "return", "type": "return", "loc": [670, 670], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "vector": [13, 2, 0.7901, 0.0012, 2, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.renderer(name, str_value, final_attrs, choices)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L672_C4", "label": "render", "type": "function", "loc": [672, 673], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [2, 1, 0.793, 0.0024, 1, 0.03, 0.6, 24, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n return self.get_renderer(name, value, attrs, choices).render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L673_C8", "label": "return", "type": "return", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L672_C4", "vector": [13, 2, 0.7936, 0.0012, 2, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_renderer(name, value, attrs, choices).render()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4", "label": "id_for_label", "type": "function", "loc": [675, 682], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [2, 1, 0.8001, 0.0094, 1, 0.03, 0.8, 952, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "id_for_label", "arg_names": ["self", "id_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def id_for_label(self, id_):\n # RadioSelect is represented by multiple <input type=\"radio\"> fields,\n # each of which has a distinct ID. The IDs are made distinct by a \"_X\"\n # suffix, where X is the zero-based index of the radio field. Thus,\n # the label for a RadioSelect should reference the first one ('_0').\n if id_:\n id_ += '_0'\n return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L680_C8", "label": "if", "type": "if", "loc": [680, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4", "vector": [4, 2, 0.8025, 0.0024, 2, 0.58, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id_:\n id_ += '_0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L682_C8", "label": "return", "type": "return", "loc": [682, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4", "vector": [13, 2, 0.8042, 0.0012, 2, 0.58, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L683_C4", "label": "id_for_label = classmethod()", "type": "assigned_variable", "loc": [683, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "vector": [14, 1, 0.8054, 0.0012, 1, 0.03, 1.0, 952, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "id_for_label", "arg_names": [], "import_names": [], "rhs_call_name": "classmethod", "annotation": ""}, "snippet": " id_for_label = classmethod(id_for_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "label": "CheckboxSelectMultiple", "type": "class", "loc": [685, 715], "level": 0, "parent": null, "vector": [3, 0, 0.8255, 0.0366, 0, 0.66, 0.9286, 130, 0, 2, 0, 0, 630, 0, 16], "semantic": {"name": "CheckboxSelectMultiple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CheckboxSelectMultiple(SelectMultiple):\n def render(self, name, value, attrs=None, choices=()):\n if value is None: value = []\n has_id = attrs and 'id' in attrs\n final_attrs = self.build_attrs(attrs, name=name)\n output = [u'<ul>']\n # Normalize to strings\n str_values = set([force_unicode(v) for v in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "label": "render", "type": "function", "loc": [686, 708], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "vector": [2, 1, 0.8219, 0.0271, 1, 0.32, 0.0, 24, 0, 5, 1, 0, 0, 0, 15], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs", "choices"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None, choices=()):\n if value is None: value = []\n has_id = attrs and 'id' in attrs\n final_attrs = self.build_attrs(attrs, name=name)\n output = [u'<ul>']\n # Normalize to strings\n str_values = set([force_unicode(v) for v in value])\n for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L687_C8", "label": "if", "type": "if", "loc": [687, 687], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [4, 2, 0.8101, 0.0012, 2, 0.98, 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: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L687_C26", "label": "value =", "type": "assigned_variable", "loc": [687, 687], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L687_C8", "vector": [14, 3, 0.8101, 0.0012, 3, 0.36, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None: value = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L688_C8", "label": "has_id =", "type": "assigned_variable", "loc": [688, 688], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [14, 2, 0.8113, 0.0012, 2, 0.98, 0.1429, 713, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "has_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_id = attrs and 'id' in attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L689_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [689, 689], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [14, 2, 0.8125, 0.0012, 2, 0.98, 0.2857, 750, 3, 2, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L690_C8", "label": "output =", "type": "assigned_variable", "loc": [690, 690], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [14, 2, 0.8137, 0.0012, 2, 0.98, 0.4286, 886, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output = [u'<ul>']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L692_C8", "label": "str_values = set()", "type": "assigned_variable", "loc": [692, 692], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [14, 2, 0.816, 0.0012, 2, 0.98, 0.5714, 50, 3, 1, 0, 0, 21, 10, 2], "semantic": {"name": "str_values", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " str_values = set([force_unicode(v) for v in value])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "label": "for i", "type": "for", "loc": [693, 706], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [6, 2, 0.8249, 0.0165, 2, 0.98, 0.7143, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):\n # If an ID attribute was given, add a numeric index as a suffix,\n # so that the checkboxes don't all have the same ID attribute.\n if has_id:\n final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))\n label_for = u' for=\"%s\"' % final_attrs['id']\n else:\n label_for = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "label": "if", "type": "if", "loc": [696, 700], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [4, 3, 0.8231, 0.0059, 3, 0.27, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if has_id:\n final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))\n label_for = u' for=\"%s\"' % final_attrs['id']\n else:\n label_for = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L697_C16", "label": "final_attrs = dict()", "type": "assigned_variable", "loc": [697, 697], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "vector": [14, 4, 0.8219, 0.0012, 4, 0.08, 0.0, 750, 3, 2, 0, 0, 827, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " final_attrs = dict(final_attrs, id='%s_%s' % (attrs['id'], i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L698_C16", "label": "label_for =", "type": "assigned_variable", "loc": [698, 698], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "vector": [14, 4, 0.8231, 0.0012, 4, 0.08, 0.5, 587, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "label_for", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_for = u' for=\"%s\"' % final_attrs['id']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L700_C16", "label": "label_for =", "type": "assigned_variable", "loc": [700, 700], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "vector": [14, 4, 0.8255, 0.0012, 4, 0.08, 1.0, 587, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "label_for", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " label_for = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L702_C12", "label": "cb = CheckboxInput()", "type": "assigned_variable", "loc": [702, 702], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [14, 3, 0.8278, 0.0012, 3, 0.27, 0.2, 540, 3, 2, 0, 0, 609, 10, 1], "semantic": {"name": "cb", "arg_names": [], "import_names": [], "rhs_call_name": "CheckboxInput", "annotation": ""}, "snippet": " cb = CheckboxInput(final_attrs, check_test=lambda value: value in str_values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L703_C12", "label": "option_value = force_unicode()", "type": "assigned_variable", "loc": [703, 703], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [14, 3, 0.829, 0.0012, 3, 0.27, 0.4, 495, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "option_value", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " option_value = force_unicode(option_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L704_C12", "label": "rendered_cb = render()", "type": "assigned_variable", "loc": [704, 704], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [14, 3, 0.8302, 0.0012, 3, 0.27, 0.6, 222, 3, 2, 0, 0, 24, 10, 1], "semantic": {"name": "rendered_cb", "arg_names": [], "import_names": [], "rhs_call_name": "render", "annotation": ""}, "snippet": " rendered_cb = cb.render(name, option_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L705_C12", "label": "option_label = conditional_escape()", "type": "assigned_variable", "loc": [705, 705], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [14, 3, 0.8314, 0.0012, 3, 0.27, 0.8, 872, 3, 1, 0, 0, 171, 10, 2], "semantic": {"name": "option_label", "arg_names": [], "import_names": [], "rhs_call_name": "conditional_escape", "annotation": ""}, "snippet": " option_label = conditional_escape(force_unicode(option_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L706_C12", "label": "append()", "type": "expression", "loc": [706, 706], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "vector": [8, 3, 0.8325, 0.0012, 3, 0.27, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(u'<li><label%s>%s %s</label></li>' % (label_for, rendered_cb, option_label))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L707_C8", "label": "append()", "type": "expression", "loc": [707, 707], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [8, 2, 0.8337, 0.0012, 2, 0.98, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(u'</ul>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L708_C8", "label": "return", "type": "return", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "vector": [13, 2, 0.8349, 0.0012, 2, 0.98, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(u'\\n'.join(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4", "label": "id_for_label", "type": "function", "loc": [710, 714], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "vector": [2, 1, 0.8396, 0.0059, 1, 0.32, 0.5, 952, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "id_for_label", "arg_names": ["self", "id_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def id_for_label(self, id_):\n # See the comment for RadioSelect.id_for_label()\n if id_:\n id_ += '_0'\n return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L712_C8", "label": "if", "type": "if", "loc": [712, 713], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4", "vector": [4, 2, 0.8402, 0.0024, 2, 0.44, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id_:\n id_ += '_0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L714_C8", "label": "return", "type": "return", "loc": [714, 714], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4", "vector": [13, 2, 0.842, 0.0012, 2, 0.44, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L715_C4", "label": "id_for_label = classmethod()", "type": "assigned_variable", "loc": [715, 715], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "vector": [14, 1, 0.8432, 0.0012, 1, 0.32, 1.0, 952, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "id_for_label", "arg_names": [], "import_names": [], "rhs_call_name": "classmethod", "annotation": ""}, "snippet": " id_for_label = classmethod(id_for_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "label": "MultiWidget", "type": "class", "loc": [717, 819], "level": 0, "parent": null, "vector": [3, 0, 0.9057, 0.1215, 0, 0.66, 0.9524, 920, 0, 9, 0, 0, 969, 0, 30], "semantic": {"name": "MultiWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MultiWidget(Widget):\n \"\"\"\n A widget that is composed of multiple widgets.\n\n Its render() method is different than other widgets', because it has to\n figure out how to split a single value for display in multiple widgets.\n The ``value`` argument can be one of two things:\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L718_C4", "label": "expression", "type": "expression", "loc": [718, 743], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [8, 1, 0.8614, 0.0307, 1, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A widget that is composed of multiple widgets.\n\n Its render() method is different than other widgets', because it has to\n figure out how to split a single value for display in multiple widgets.\n The ``value`` argument can be one of two things:\n\n * A list."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4", "label": "__init__", "type": "function", "loc": [744, 746], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.8785, 0.0035, 1, 0.18, 0.0909, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "widgets", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, widgets, attrs=None):\n self.widgets = [isinstance(w, type) and w() or w for w in widgets]\n super(MultiWidget, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L745_C8", "label": "self.widgets =", "type": "assigned_variable", "loc": [745, 745], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4", "vector": [14, 2, 0.8785, 0.0012, 2, 0.19, 0.0, 22, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.widgets = [isinstance(w, type) and w() or w for w in widgets]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L746_C8", "label": "__init__()", "type": "expression", "loc": [746, 746], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4", "vector": [8, 2, 0.8797, 0.0012, 2, 0.19, 1.0, 555, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(MultiWidget, self).__init__(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "label": "render", "type": "function", "loc": [748, 767], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.8933, 0.0236, 1, 0.18, 0.1818, 24, 0, 4, 1, 0, 0, 0, 10], "semantic": {"name": "render", "arg_names": ["self", "name", "value", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def render(self, name, value, attrs=None):\n if self.is_localized:\n for widget in self.widgets:\n widget.is_localized = self.is_localized\n # value is a list of values, each corresponding to a widget\n # in self.widgets.\n if not isinstance(value, list):\n value = self.decompress(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L749_C8", "label": "if", "type": "if", "loc": [749, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [4, 2, 0.8844, 0.0035, 2, 0.93, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_localized:\n for widget in self.widgets:\n widget.is_localized = self.is_localized"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L750_C12", "label": "for widget", "type": "for", "loc": [750, 751], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L749_C8", "vector": [6, 3, 0.885, 0.0024, 3, 0.89, 0.0, 972, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for widget in self.widgets:\n widget.is_localized = self.is_localized"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L751_C16", "label": "widget.is_localized =", "type": "assigned_variable", "loc": [751, 751], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L750_C12", "vector": [14, 4, 0.8856, 0.0012, 4, 0.99, 0.0, 907, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "widget.is_localized", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget.is_localized = self.is_localized"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L754_C8", "label": "if", "type": "if", "loc": [754, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [4, 2, 0.8897, 0.0024, 2, 0.93, 0.1667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(value, list):\n value = self.decompress(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L755_C12", "label": "value = decompress()", "type": "assigned_variable", "loc": [755, 755], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L754_C8", "vector": [14, 3, 0.8903, 0.0012, 3, 0.8, 0.0, 441, 3, 1, 0, 0, 979, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "decompress", "annotation": ""}, "snippet": " value = self.decompress(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L756_C8", "label": "output =", "type": "assigned_variable", "loc": [756, 756], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [14, 2, 0.8915, 0.0012, 2, 0.93, 0.3333, 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_99002:Assign_L757_C8", "label": "final_attrs = build_attrs()", "type": "assigned_variable", "loc": [757, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [14, 2, 0.8927, 0.0012, 2, 0.93, 0.5, 750, 3, 1, 0, 0, 588, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "build_attrs", "annotation": ""}, "snippet": " final_attrs = self.build_attrs(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L758_C8", "label": "id_ = get()", "type": "assigned_variable", "loc": [758, 758], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [14, 2, 0.8939, 0.0012, 2, 0.93, 0.6667, 345, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "id_", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " id_ = final_attrs.get('id', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "label": "for i, widget", "type": "for", "loc": [759, 766], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [6, 2, 0.8992, 0.0094, 2, 0.93, 0.8333, 447, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, widget in enumerate(self.widgets):\n try:\n widget_value = value[i]\n except IndexError:\n widget_value = None\n if id_:\n final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))\n output.append(widget.render(name + '_%s' % i, widget_value, final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12", "label": "try", "type": "try", "loc": [760, 763], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "vector": [7, 3, 0.898, 0.0047, 3, 0.42, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n widget_value = value[i]\n except IndexError:\n widget_value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L761_C16", "label": "widget_value =", "type": "assigned_variable", "loc": [761, 761], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12", "vector": [14, 4, 0.8974, 0.0012, 4, 0.6, 0.0, 878, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "widget_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget_value = value[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L763_C16", "label": "widget_value =", "type": "assigned_variable", "loc": [763, 763], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12", "vector": [14, 4, 0.8998, 0.0012, 4, 0.6, 0.0, 878, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "widget_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget_value = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L764_C12", "label": "if", "type": "if", "loc": [764, 765], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "vector": [4, 3, 0.9015, 0.0024, 3, 0.42, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id_:\n final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L765_C16", "label": "final_attrs = dict()", "type": "assigned_variable", "loc": [765, 765], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L764_C12", "vector": [14, 4, 0.9021, 0.0012, 4, 0.55, 0.0, 750, 3, 2, 0, 0, 827, 10, 1], "semantic": {"name": "final_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " final_attrs = dict(final_attrs, id='%s_%s' % (id_, i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L766_C12", "label": "append()", "type": "expression", "loc": [766, 766], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "vector": [8, 3, 0.9033, 0.0012, 3, 0.42, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " output.append(widget.render(name + '_%s' % i, widget_value, final_attrs))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L767_C8", "label": "return", "type": "return", "loc": [767, 767], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "vector": [13, 2, 0.9045, 0.0012, 2, 0.93, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mark_safe(self.format_output(output))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4", "label": "id_for_label", "type": "function", "loc": [769, 773], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9092, 0.0059, 1, 0.18, 0.2727, 952, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "id_for_label", "arg_names": ["self", "id_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def id_for_label(self, id_):\n # See the comment for RadioSelect.id_for_label()\n if id_:\n id_ += '_0'\n return id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L771_C8", "label": "if", "type": "if", "loc": [771, 772], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4", "vector": [4, 2, 0.9098, 0.0024, 2, 0.89, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if id_:\n id_ += '_0'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L773_C8", "label": "return", "type": "return", "loc": [773, 773], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4", "vector": [13, 2, 0.9116, 0.0012, 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 id_"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L774_C4", "label": "id_for_label = classmethod()", "type": "assigned_variable", "loc": [774, 774], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [14, 1, 0.9127, 0.0012, 1, 0.18, 0.3636, 952, 3, 1, 0, 0, 76, 10, 1], "semantic": {"name": "id_for_label", "arg_names": [], "import_names": [], "rhs_call_name": "classmethod", "annotation": ""}, "snippet": " id_for_label = classmethod(id_for_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L776_C4", "label": "value_from_datadict", "type": "function", "loc": [776, 777], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9157, 0.0024, 1, 0.18, 0.4545, 272, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "value_from_datadict", "arg_names": ["self", "data", "files", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_datadict(self, data, files, name):\n return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L777_C8", "label": "return", "type": "return", "loc": [777, 777], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L776_C4", "vector": [13, 2, 0.9163, 0.0012, 2, 0.76, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [widget.value_from_datadict(data, files, name + '_%s' % i) for i, widget in enumerate(self.widgets)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "label": "_has_changed", "type": "function", "loc": [779, 788], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9239, 0.0118, 1, 0.18, 0.5455, 719, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_has_changed", "arg_names": ["self", "initial", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_changed(self, initial, data):\n if initial is None:\n initial = [u'' for x in range(0, len(data))]\n else:\n if not isinstance(initial, list):\n initial = self.decompress(initial)\n for widget, initial, data in zip(self.widgets, initial, data):\n if widget._has_changed(initial, data):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8", "label": "if", "type": "if", "loc": [780, 784], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "vector": [4, 2, 0.9222, 0.0059, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if initial is None:\n initial = [u'' for x in range(0, len(data))]\n else:\n if not isinstance(initial, list):\n initial = self.decompress(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L781_C12", "label": "initial =", "type": "assigned_variable", "loc": [781, 781], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8", "vector": [14, 3, 0.921, 0.0012, 3, 0.04, 0.0, 838, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial = [u'' for x in range(0, len(data))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L783_C12", "label": "if", "type": "if", "loc": [783, 784], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8", "vector": [4, 3, 0.9239, 0.0024, 3, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(initial, list):\n initial = self.decompress(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L784_C16", "label": "initial = decompress()", "type": "assigned_variable", "loc": [784, 784], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L783_C12", "vector": [14, 4, 0.9245, 0.0012, 4, 0.35, 0.0, 838, 3, 1, 0, 0, 979, 10, 1], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "decompress", "annotation": ""}, "snippet": " initial = self.decompress(initial)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L785_C8", "label": "for widget, initial, data", "type": "for", "loc": [785, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "vector": [6, 2, 0.9269, 0.0035, 2, 0.97, 0.5, 704, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "widget, initial, data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for widget, initial, data in zip(self.widgets, initial, data):\n if widget._has_changed(initial, data):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L786_C12", "label": "if", "type": "if", "loc": [786, 787], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L785_C8", "vector": [4, 3, 0.9275, 0.0024, 3, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if widget._has_changed(initial, data):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L787_C16", "label": "return", "type": "return", "loc": [787, 787], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L786_C12", "vector": [13, 4, 0.9281, 0.0012, 4, 0.22, 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_99002:Return_L788_C8", "label": "return", "type": "return", "loc": [788, 788], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "vector": [13, 2, 0.9292, 0.0012, 2, 0.97, 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_99002:FunctionDef_L790_C4", "label": "format_output", "type": "function", "loc": [790, 798], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9363, 0.0106, 1, 0.18, 0.6364, 417, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "format_output", "arg_names": ["self", "rendered_widgets"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def format_output(self, rendered_widgets):\n \"\"\"\n Given a list of rendered widgets (as strings), returns a Unicode string\n representing the HTML for the whole lot.\n\n This hook allows you to format the HTML design of the widgets, if\n needed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L791_C8", "label": "expression", "type": "expression", "loc": [791, 797], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L790_C4", "vector": [8, 2, 0.9363, 0.0083, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Given a list of rendered widgets (as strings), returns a Unicode string\n representing the HTML for the whole lot.\n\n This hook allows you to format the HTML design of the widgets, if\n needed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L798_C8", "label": "return", "type": "return", "loc": [798, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L790_C4", "vector": [13, 2, 0.941, 0.0012, 2, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return u''.join(rendered_widgets)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L800_C4", "label": "decompress", "type": "function", "loc": [800, 806], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9469, 0.0083, 1, 0.18, 0.7273, 979, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "decompress", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def decompress(self, value):\n \"\"\"\n Returns a list of decompressed values for the given compressed value.\n The given value can be assumed to be valid, but not necessarily\n non-empty.\n \"\"\"\n raise NotImplementedError('Subclasses must implement this method.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L801_C8", "label": "expression", "type": "expression", "loc": [801, 805], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L800_C4", "vector": [8, 2, 0.9469, 0.0059, 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 Returns a list of decompressed values for the given compressed value.\n The given value can be assumed to be valid, but not necessarily\n non-empty.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "label": "_get_media", "type": "function", "loc": [808, 813], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.9558, 0.0071, 1, 0.18, 0.8182, 210, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_media", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_media(self):\n \"Media for a multiwidget is the combination of all media of the subwidgets\"\n media = Media()\n for w in self.widgets:\n media = media + w.media\n return media"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L809_C8", "label": "expression", "type": "expression", "loc": [809, 809], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "vector": [8, 2, 0.954, 0.0012, 2, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Media for a multiwidget is the combination of all media of the subwidgets\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L810_C8", "label": "media = Media()", "type": "assigned_variable", "loc": [810, 810], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "vector": [14, 2, 0.9552, 0.0012, 2, 0.8, 0.3333, 317, 3, 0, 0, 0, 185, 10, 1], "semantic": {"name": "media", "arg_names": [], "import_names": [], "rhs_call_name": "Media", "annotation": ""}, "snippet": " media = Media()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L811_C8", "label": "for w", "type": "for", "loc": [811, 812], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "vector": [6, 2, 0.957, 0.0024, 2, 0.8, 0.6667, 549, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "w", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for w in self.widgets:\n media = media + w.media"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L812_C12", "label": "media =", "type": "assigned_variable", "loc": [812, 812], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L811_C8", "vector": [14, 3, 0.9575, 0.0012, 3, 0.13, 0.0, 317, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "media", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " media = media + w.media"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L813_C8", "label": "return", "type": "return", "loc": [813, 813], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "vector": [13, 2, 0.9587, 0.0012, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return media"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L814_C4", "label": "media = property()", "type": "assigned_variable", "loc": [814, 814], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [14, 1, 0.9599, 0.0012, 1, 0.18, 0.9091, 317, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "media", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " media = property(_get_media)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "label": "__deepcopy__", "type": "function", "loc": [816, 819], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "vector": [2, 1, 0.964, 0.0047, 1, 0.18, 1.0, 652, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "__deepcopy__", "arg_names": ["self", "memo"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __deepcopy__(self, memo):\n obj = super(MultiWidget, self).__deepcopy__(memo)\n obj.widgets = copy.deepcopy(self.widgets)\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L817_C8", "label": "obj = __deepcopy__()", "type": "assigned_variable", "loc": [817, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "vector": [14, 2, 0.9634, 0.0012, 2, 0.64, 0.0, 505, 3, 1, 0, 0, 652, 10, 2], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "__deepcopy__", "annotation": ""}, "snippet": " obj = super(MultiWidget, self).__deepcopy__(memo)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L818_C8", "label": "obj.widgets = deepcopy()", "type": "assigned_variable", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "vector": [14, 2, 0.9646, 0.0012, 2, 0.64, 0.5, 408, 3, 1, 0, 0, 44, 10, 1], "semantic": {"name": "obj.widgets", "arg_names": [], "import_names": [], "rhs_call_name": "deepcopy", "annotation": ""}, "snippet": " obj.widgets = copy.deepcopy(self.widgets)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L819_C8", "label": "return", "type": "return", "loc": [819, 819], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "vector": [13, 2, 0.9658, 0.0012, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "label": "SplitDateTimeWidget", "type": "class", "loc": [821, 836], "level": 0, "parent": null, "vector": [3, 0, 0.977, 0.0189, 0, 0.66, 0.9762, 717, 0, 2, 0, 0, 920, 0, 7], "semantic": {"name": "SplitDateTimeWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SplitDateTimeWidget(MultiWidget):\n \"\"\"\n A Widget that splits datetime input into two <input type=\"text\"> boxes.\n \"\"\"\n date_format = DateInput.format\n time_format = TimeInput.format\n\n def __init__(self, attrs=None, date_format=None, time_format=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L822_C4", "label": "expression", "type": "expression", "loc": [822, 824], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "vector": [8, 1, 0.9705, 0.0035, 1, 0.03, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A Widget that splits datetime input into two <input type=\"text\"> boxes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L825_C4", "label": "date_format =", "type": "assigned_variable", "loc": [825, 825], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "vector": [14, 1, 0.9729, 0.0012, 1, 0.03, 0.25, 390, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "date_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " date_format = DateInput.format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L826_C4", "label": "time_format =", "type": "assigned_variable", "loc": [826, 826], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "vector": [14, 1, 0.9741, 0.0012, 1, 0.03, 0.5, 736, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "time_format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " time_format = TimeInput.format"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4", "label": "__init__", "type": "function", "loc": [828, 831], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "vector": [2, 1, 0.9782, 0.0047, 1, 0.03, 0.75, 555, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "date_format", "time_format"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, date_format=None, time_format=None):\n widgets = (DateInput(attrs=attrs, format=date_format),\n TimeInput(attrs=attrs, format=time_format))\n super(SplitDateTimeWidget, self).__init__(widgets, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L829_C8", "label": "widgets =", "type": "assigned_variable", "loc": [829, 830], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4", "vector": [14, 2, 0.9782, 0.0024, 2, 0.75, 0.0, 178, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "widgets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widgets = (DateInput(attrs=attrs, format=date_format),\n TimeInput(attrs=attrs, format=time_format))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L831_C8", "label": "__init__()", "type": "expression", "loc": [831, 831], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4", "vector": [8, 2, 0.98, 0.0012, 2, 0.75, 1.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SplitDateTimeWidget, self).__init__(widgets, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4", "label": "decompress", "type": "function", "loc": [833, 836], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "vector": [2, 1, 0.9841, 0.0047, 1, 0.03, 1.0, 979, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "decompress", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def decompress(self, value):\n if value:\n return [value.date(), value.time().replace(microsecond=0)]\n return [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L834_C8", "label": "if", "type": "if", "loc": [834, 835], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4", "vector": [4, 2, 0.9841, 0.0024, 2, 0.67, 0.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value:\n return [value.date(), value.time().replace(microsecond=0)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L835_C12", "label": "return", "type": "return", "loc": [835, 835], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L834_C8", "vector": [13, 3, 0.9847, 0.0012, 3, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [value.date(), value.time().replace(microsecond=0)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L836_C8", "label": "return", "type": "return", "loc": [836, 836], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4", "vector": [13, 2, 0.9858, 0.0012, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [None, None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "label": "SplitHiddenDateTimeWidget", "type": "class", "loc": [838, 848], "level": 0, "parent": null, "vector": [3, 0, 0.9941, 0.013, 0, 0.66, 1.0, 341, 0, 1, 0, 0, 717, 0, 2], "semantic": {"name": "SplitHiddenDateTimeWidget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SplitHiddenDateTimeWidget(SplitDateTimeWidget):\n \"\"\"\n A Widget that splits datetime input into two <input type=\"hidden\"> inputs.\n \"\"\"\n is_hidden = True\n\n def __init__(self, attrs=None, date_format=None, time_format=None):\n super(SplitHiddenDateTimeWidget, self).__init__(attrs, date_format, time_format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L839_C4", "label": "expression", "type": "expression", "loc": [839, 841], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "vector": [8, 1, 0.9906, 0.0035, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A Widget that splits datetime input into two <input type=\"hidden\"> inputs.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L842_C4", "label": "is_hidden =", "type": "assigned_variable", "loc": [842, 842], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "vector": [14, 1, 0.9929, 0.0012, 1, 0.11, 0.5, 524, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_hidden", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_hidden = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4", "label": "__init__", "type": "function", "loc": [844, 848], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "vector": [2, 1, 0.9976, 0.0059, 1, 0.11, 1.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "attrs", "date_format", "time_format"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, attrs=None, date_format=None, time_format=None):\n super(SplitHiddenDateTimeWidget, self).__init__(attrs, date_format, time_format)\n for widget in self.widgets:\n widget.input_type = 'hidden'\n widget.is_hidden = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L845_C8", "label": "__init__()", "type": "expression", "loc": [845, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4", "vector": [8, 2, 0.9965, 0.0012, 2, 0.95, 0.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(SplitHiddenDateTimeWidget, self).__init__(attrs, date_format, time_format)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8", "label": "for widget", "type": "for", "loc": [846, 848], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4", "vector": [6, 2, 0.9988, 0.0035, 2, 0.95, 1.0, 972, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "widget", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for widget in self.widgets:\n widget.input_type = 'hidden'\n widget.is_hidden = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L847_C12", "label": "widget.input_type =", "type": "assigned_variable", "loc": [847, 847], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8", "vector": [14, 3, 0.9988, 0.0012, 3, 0.5, 0.0, 695, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "widget.input_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget.input_type = 'hidden'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L848_C12", "label": "widget.is_hidden =", "type": "assigned_variable", "loc": [848, 848], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8", "vector": [14, 3, 1.0, 0.0012, 3, 0.5, 1.0, 622, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "widget.is_hidden", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " widget.is_hidden = True"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L32_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L35_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L40_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L79_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L80_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L80_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L81_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L85_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L86_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L86_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L87_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L87_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L88_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L111_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L113_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L110_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L114_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L114_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L115_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L120_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L97_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L123_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L214_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L215_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L227_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L233_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L230_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L238_C34"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L241_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L241_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L256_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L262_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L265_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L270_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L271_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L269_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L286_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L285_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L294_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L297_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L301_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L325_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L324_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L329_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L330_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L331_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L332_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L333_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L328_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L334_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L292_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L342_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L346_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L340_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L348_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L351_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L355_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L351_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L360_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L360_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L372_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L371_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L379_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L383_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L365_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L398_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L399_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L401_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L405_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L407_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L408_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L411_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L413_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L415_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L410_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L397_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L423_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L422_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L424_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L427_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L430_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L433_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L439_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L440_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L444_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L443_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L445_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L445_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L442_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L447_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L429_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L449_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L454_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L453_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L449_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L462_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L461_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L470_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L469_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L473_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L474_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L475_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L478_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L481_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L481_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L487_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L488_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L489_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L480_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L460_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L492_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L492_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L495_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L499_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L498_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L503_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L506_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L506_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L506_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L508_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L510_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L510_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L512_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L505_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L516_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L517_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L515_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L518_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L497_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L524_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L528_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L529_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L529_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L530_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L531_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L527_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L533_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L522_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L534_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L537_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L541_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L540_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L542_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L546_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L545_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L548_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L544_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L549_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L552_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L551_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L553_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L536_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L563_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L563_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L564_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L565_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L565_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L566_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L560_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L567_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L571_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L571_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L571_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L572_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L573_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L574_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L575_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L575_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L576_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L577_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L570_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L578_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L581_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L581_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L580_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L583_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L569_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L586_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L586_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L587_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L588_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L588_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L589_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L590_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L590_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L592_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L592_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L593_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L593_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L594_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L585_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L595_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L598_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L604_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L605_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L606_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L607_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L603_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L608_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L612_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L611_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L614_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L615_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L610_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L616_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L618_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L618_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L619_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L597_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L622_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L622_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L623_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L624_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L625_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L625_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L626_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L621_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L627_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L630_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L635_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L634_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L636_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L638_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L638_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L639_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L639_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L640_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L643_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L642_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L644_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L646_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L646_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L647_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L629_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L650_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L649_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L651_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L655_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L659_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L660_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L661_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L657_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L662_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L666_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L666_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L666_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L668_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L669_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L664_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L672_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L672_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L680_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L675_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L654_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L683_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L687_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L687_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L687_C26"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L688_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L689_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L690_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L692_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L697_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L698_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L696_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L700_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L702_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L703_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L704_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L705_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L693_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L706_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L707_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L686_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L712_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L710_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L714_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L685_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L715_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L718_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L744_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L749_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L749_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L750_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L750_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L751_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L754_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L755_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L756_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L761_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:Try_L760_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L763_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L764_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L764_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L765_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L759_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L766_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L748_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L767_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L771_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L769_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L773_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L774_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L776_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L776_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L781_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L780_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L783_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L783_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L784_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L785_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L785_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L786_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L786_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L787_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L779_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L788_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L790_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L798_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L800_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L800_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L801_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L809_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L810_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L811_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L811_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L812_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L808_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L813_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L814_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L717_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L819_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L822_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L825_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L826_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L828_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L831_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L821_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:If_L834_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L835_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L833_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Return_L836_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L839_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L842_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:ClassDef_L838_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Expr_L845_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:FunctionDef_L844_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L847_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99002:For_L846_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99002:Assign_L848_C12"}] |
"""
Django validation and HTML form handling.
TODO:
Default value for field
Field labels
Nestable Forms
FatalValidationError -- short-circuits all other validators on a form
ValidationWarning
"This form field requires foo.js" and form.js_includes()
"""
from django.core.exceptions import ValidationError
from widgets import *
from fields import *
from forms import *
from models import *
| ajibawa-2023/Python-Code-Large/train/row_99003 | 6 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99003:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 11], "level": 0, "parent": null, "vector": [8, 0, 0.3529, 0.6471, 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 validation and HTML form handling.\n\nTODO:\n Default value for field\n Field labels\n Nestable Forms\n FatalValidationError -- short-circuits all other validators on a form"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99003:ImportFrom_L13_C0", "label": "from django.core.exceptions import ValidationError", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.7647, 0.0588, 0, 0.66, 0.2, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["ValidationError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import ValidationError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99003:ImportFrom_L14_C0", "label": "from widgets import *", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.8235, 0.0588, 0, 0.66, 0.4, 178, 0, 1, 0, 0, 178, 0, 0], "semantic": {"name": "widgets", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from widgets import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99003:ImportFrom_L15_C0", "label": "from fields import *", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.8824, 0.0588, 0, 0.66, 0.6, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "fields", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from fields import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99003:ImportFrom_L16_C0", "label": "from forms import *", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.9412, 0.0588, 0, 0.66, 0.8, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "forms", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from forms import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99003:ImportFrom_L17_C0", "label": "from models import *", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.0588, 0, 0.66, 1.0, 495, 0, 1, 0, 0, 495, 0, 0], "semantic": {"name": "models", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from models import *"}] | [] |
VERSION = (1, 3, 0, 'alpha', 1)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s %s %s' % (version, VERSION[3], VERSION[4])
from django.utils.version import get_svn_revision
svn_rev = get_svn_revision()
if svn_rev != u'SVN-unknown':
version = "%s %s" % (version, svn_rev)
return version
| ajibawa-2023/Python-Code-Large/train/row_99005 | 14 | 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_99005:Assign_L1_C0", "label": "VERSION =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 0.0625, 0.0625, 0, 0.66, 0.0, 557, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VERSION = (1, 3, 0, 'alpha', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "label": "get_version", "type": "function", "loc": [3, 16], "level": 0, "parent": null, "vector": [2, 0, 0.5938, 0.875, 0, 0.66, 1.0, 75, 0, 0, 1, 0, 0, 0, 1], "semantic": {"name": "get_version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_version():\n version = '%s.%s' % (VERSION[0], VERSION[1])\n if VERSION[2]:\n version = '%s.%s' % (version, VERSION[2])\n if VERSION[3:] == ('alpha', 0):\n version = '%s pre-alpha' % version\n else:\n if VERSION[3] != 'final':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L4_C4", "label": "version =", "type": "assigned_variable", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [14, 1, 0.25, 0.0625, 1, 0.8, 0.0, 623, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = '%s.%s' % (VERSION[0], VERSION[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L5_C4", "label": "if", "type": "if", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [4, 1, 0.3438, 0.125, 1, 0.8, 0.1667, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if VERSION[2]:\n version = '%s.%s' % (version, VERSION[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L6_C8", "label": "version =", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L5_C4", "vector": [14, 2, 0.375, 0.0625, 2, 0.18, 0.0, 623, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = '%s.%s' % (version, VERSION[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4", "label": "if", "type": "if", "loc": [7, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [4, 1, 0.5625, 0.3125, 1, 0.8, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if VERSION[3:] == ('alpha', 0):\n version = '%s pre-alpha' % version\n else:\n if VERSION[3] != 'final':\n version = '%s %s %s' % (version, VERSION[3], VERSION[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L8_C8", "label": "version =", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4", "vector": [14, 2, 0.5, 0.0625, 2, 0.77, 0.0, 623, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = '%s pre-alpha' % version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L10_C8", "label": "if", "type": "if", "loc": [10, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4", "vector": [4, 2, 0.6562, 0.125, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if VERSION[3] != 'final':\n version = '%s %s %s' % (version, VERSION[3], VERSION[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L11_C12", "label": "version =", "type": "assigned_variable", "loc": [11, 11], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L10_C8", "vector": [14, 3, 0.6875, 0.0625, 3, 0.69, 0.0, 623, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = '%s %s %s' % (version, VERSION[3], VERSION[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:ImportFrom_L12_C4", "label": "from django.utils.version import get_svn_revision", "type": "import", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [1, 1, 0.75, 0.0625, 1, 0.8, 0.5, 895, 0, 1, 0, 0, 895, 0, 0], "semantic": {"name": "django.utils.version", "arg_names": [], "import_names": ["get_svn_revision"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.utils.version import get_svn_revision"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L13_C4", "label": "svn_rev = get_svn_revision()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [14, 1, 0.8125, 0.0625, 1, 0.8, 0.6667, 858, 3, 0, 0, 0, 672, 10, 1], "semantic": {"name": "svn_rev", "arg_names": [], "import_names": [], "rhs_call_name": "get_svn_revision", "annotation": ""}, "snippet": " svn_rev = get_svn_revision()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L14_C4", "label": "if", "type": "if", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [4, 1, 0.9062, 0.125, 1, 0.8, 0.8333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if svn_rev != u'SVN-unknown':\n version = \"%s %s\" % (version, svn_rev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L15_C8", "label": "version =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L14_C4", "vector": [14, 2, 0.9375, 0.0625, 2, 0.03, 0.0, 623, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " version = \"%s %s\" % (version, svn_rev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99005:Return_L16_C4", "label": "return", "type": "return", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "vector": [13, 1, 1.0, 0.0625, 1, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return version"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L10_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L11_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:ImportFrom_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:If_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99005:FunctionDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99005:Return_L16_C4"}] |
from django.dispatch import Signal
class_prepared = Signal(providing_args=["class"])
pre_init = Signal(providing_args=["instance", "args", "kwargs"])
post_init = Signal(providing_args=["instance"])
pre_save = Signal(providing_args=["instance", "raw", "using"])
post_save = Signal(providing_args=["instance", "raw", "created", "using"])
pre_delete = Signal(providing_args=["instance", "using"])
post_delete = Signal(providing_args=["instance", "using"])
post_syncdb = Signal(providing_args=["class", "app", "created_models", "verbosity", "interactive"])
m2m_changed = Signal(providing_args=["action", "instance", "reverse", "model", "pk_set", "using"])
| ajibawa-2023/Python-Code-Large/train/row_99007 | 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_99007:ImportFrom_L1_C0", "label": "from django.dispatch import Signal", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0625, 0.0625, 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_99007:Assign_L3_C0", "label": "class_prepared = Signal()", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0625, 0, 0.66, 0.1111, 564, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "class_prepared", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "class_prepared = Signal(providing_args=[\"class\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L5_C0", "label": "pre_init = Signal()", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0625, 0, 0.66, 0.2222, 269, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "pre_init", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "pre_init = Signal(providing_args=[\"instance\", \"args\", \"kwargs\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L6_C0", "label": "post_init = Signal()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0625, 0, 0.66, 0.3333, 652, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "post_init", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "post_init = Signal(providing_args=[\"instance\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L8_C0", "label": "pre_save = Signal()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0625, 0, 0.66, 0.4444, 751, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "pre_save", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "pre_save = Signal(providing_args=[\"instance\", \"raw\", \"using\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L9_C0", "label": "post_save = Signal()", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5625, 0.0625, 0, 0.66, 0.5556, 917, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "post_save", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "post_save = Signal(providing_args=[\"instance\", \"raw\", \"created\", \"using\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L11_C0", "label": "pre_delete = Signal()", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6875, 0.0625, 0, 0.66, 0.6667, 873, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "pre_delete", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "pre_delete = Signal(providing_args=[\"instance\", \"using\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L12_C0", "label": "post_delete = Signal()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0625, 0, 0.66, 0.7778, 940, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "post_delete", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "post_delete = Signal(providing_args=[\"instance\", \"using\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L14_C0", "label": "post_syncdb = Signal()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.875, 0.0625, 0, 0.66, 0.8889, 533, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "post_syncdb", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "post_syncdb = Signal(providing_args=[\"class\", \"app\", \"created_models\", \"verbosity\", \"interactive\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99007:Assign_L16_C0", "label": "m2m_changed = Signal()", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0625, 0, 0.66, 1.0, 245, 3, 1, 0, 0, 592, 10, 1], "semantic": {"name": "m2m_changed", "arg_names": [], "import_names": [], "rhs_call_name": "Signal", "annotation": ""}, "snippet": "m2m_changed = Signal(providing_args=[\"action\", \"instance\", \"reverse\", \"model\", \"pk_set\", \"using\"])"}] | [] |
from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.utils.datastructures import SortedDict
from django.utils.functional import wraps
def CASCADE(collector, field, sub_objs, using):
collector.collect(sub_objs, source=field.rel.to,
source_attr=field.name, nullable=field.null)
if field.null and not connections[using].features.can_defer_constraint_checks:
collector.add_field_update(field, None, sub_objs)
def PROTECT(collector, field, sub_objs, using):
raise IntegrityError("Cannot delete some instances of model '%s' because "
"they are referenced through a protected foreign key: '%s.%s'" % (
field.rel.to.__name__, sub_objs[0].__class__.__name__, field.name
))
def SET(value):
if callable(value):
def set_on_delete(collector, field, sub_objs, using):
collector.add_field_update(field, value(), sub_objs)
else:
def set_on_delete(collector, field, sub_objs, using):
collector.add_field_update(field, value, sub_objs)
return set_on_delete
SET_NULL = SET(None)
def SET_DEFAULT(collector, field, sub_objs, using):
collector.add_field_update(field, field.get_default(), sub_objs)
def DO_NOTHING(collector, field, sub_objs, using):
pass
def force_managed(func):
@wraps(func)
def decorated(self, *args, **kwargs):
if not transaction.is_managed(using=self.using):
transaction.enter_transaction_management(using=self.using)
forced_managed = True
else:
forced_managed = False
try:
func(self, *args, **kwargs)
if forced_managed:
transaction.commit(using=self.using)
else:
transaction.commit_unless_managed(using=self.using)
finally:
if forced_managed:
transaction.leave_transaction_management(using=self.using)
return decorated
class Collector(object):
def __init__(self, using):
self.using = using
self.data = {} # {model: [instances]}
self.batches = {} # {model: {field: set([instances])}}
self.field_updates = {} # {model: {(field, value): set([instances])}}
self.dependencies = {} # {model: set([models])}
def add(self, objs, source=None, nullable=False):
"""
Adds 'objs' to the collection of objects to be deleted. If the call is
the result of a cascade, 'source' should be the model that caused it
and 'nullable' should be set to True, if the relation can be null.
Returns a list of all objects that were not already collected.
"""
if not objs:
return []
new_objs = []
model = objs[0].__class__
instances = self.data.setdefault(model, [])
for obj in objs:
if obj not in instances:
new_objs.append(obj)
instances.extend(new_objs)
# Nullable relationships can be ignored -- they are nulled out before
# deleting, and therefore do not affect the order in which objects have
# to be deleted.
if new_objs and source is not None and not nullable:
self.dependencies.setdefault(source, set()).add(model)
return new_objs
def add_batch(self, model, field, objs):
"""
Schedules a batch delete. Every instance of 'model' that is related to
an instance of 'obj' through 'field' will be deleted.
"""
self.batches.setdefault(model, {}).setdefault(field, set()).update(objs)
def add_field_update(self, field, value, objs):
"""
Schedules a field update. 'objs' must be a homogenous iterable
collection of model instances (e.g. a QuerySet).
"""
if not objs:
return
model = objs[0].__class__
self.field_updates.setdefault(
model, {}).setdefault(
(field, value), set()).update(objs)
def collect(self, objs, source=None, nullable=False, collect_related=True,
source_attr=None):
"""
Adds 'objs' to the collection of objects to be deleted as well as all
parent instances. 'objs' must be a homogenous iterable collection of
model instances (e.g. a QuerySet). If 'collect_related' is True,
related objects will be handled by their respective on_delete handler.
If the call is the result of a cascade, 'source' should be the model
that caused it and 'nullable' should be set to True, if the relation
can be null.
"""
if not connections[self.using].features.supports_deleting_related_objects:
collect_related = False
new_objs = self.add(objs, source, nullable)
if not new_objs:
return
model = new_objs[0].__class__
# Recursively collect parent models, but not their related objects.
# These will be found by meta.get_all_related_objects()
for parent_model, ptr in model._meta.parents.iteritems():
if ptr:
parent_objs = [getattr(obj, ptr.name) for obj in new_objs]
self.collect(parent_objs, source=model,
source_attr=ptr.rel.related_name,
collect_related=False)
if collect_related:
for related in model._meta.get_all_related_objects(include_hidden=True):
field = related.field
if related.model._meta.auto_created:
self.add_batch(related.model, field, new_objs)
else:
sub_objs = self.related_objects(related, new_objs)
if not sub_objs:
continue
field.rel.on_delete(self, field, sub_objs, self.using)
# TODO This entire block is only needed as a special case to
# support cascade-deletes for GenericRelation. It should be
# removed/fixed when the ORM gains a proper abstraction for virtual
# or composite fields, and GFKs are reworked to fit into that.
for relation in model._meta.many_to_many:
if not relation.rel.through:
sub_objs = relation.bulk_related_objects(new_objs, self.using)
self.collect(sub_objs,
source=model,
source_attr=relation.rel.related_name,
nullable=True)
def related_objects(self, related, objs):
"""
Gets a QuerySet of objects related to ``objs`` via the relation ``related``.
"""
return related.model._base_manager.using(self.using).filter(
**{"%s__in" % related.field.name: objs}
)
def instances_with_model(self):
for model, instances in self.data.iteritems():
for obj in instances:
yield model, obj
def sort(self):
sorted_models = []
models = self.data.keys()
while len(sorted_models) < len(models):
found = False
for model in models:
if model in sorted_models:
continue
dependencies = self.dependencies.get(model)
if not (dependencies and dependencies.difference(sorted_models)):
sorted_models.append(model)
found = True
if not found:
return
self.data = SortedDict([(model, self.data[model])
for model in sorted_models])
@force_managed
def delete(self):
# sort instance collections
for instances in self.data.itervalues():
instances.sort(key=attrgetter("pk"))
# if possible, bring the models in an order suitable for databases that
# don't support transactions or cannot defer contraint checks until the
# end of a transaction.
self.sort()
# send pre_delete signals
for model, obj in self.instances_with_model():
if not model._meta.auto_created:
signals.pre_delete.send(
sender=model, instance=obj, using=self.using
)
# update fields
for model, instances_for_fieldvalues in self.field_updates.iteritems():
query = sql.UpdateQuery(model)
for (field, value), instances in instances_for_fieldvalues.iteritems():
query.update_batch([obj.pk for obj in instances],
{field.name: value}, self.using)
# reverse instance collections
for instances in self.data.itervalues():
instances.reverse()
# delete batches
for model, batches in self.batches.iteritems():
query = sql.DeleteQuery(model)
for field, instances in batches.iteritems():
query.delete_batch([obj.pk for obj in instances], self.using, field)
# delete instances
for model, instances in self.data.iteritems():
query = sql.DeleteQuery(model)
pk_list = [obj.pk for obj in instances]
query.delete_batch(pk_list, self.using)
# send post_delete signals
for model, obj in self.instances_with_model():
if not model._meta.auto_created:
signals.post_delete.send(
sender=model, instance=obj, using=self.using
)
# update collected instances
for model, instances_for_fieldvalues in self.field_updates.iteritems():
for (field, value), instances in instances_for_fieldvalues.iteritems():
for obj in instances:
setattr(obj, field.attname, value)
for model, instances in self.data.iteritems():
for instance in instances:
setattr(instance, model._meta.pk.attname, None)
| ajibawa-2023/Python-Code-Large/train/row_99008 | 142 | 248 | 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_99008:ImportFrom_L1_C0", "label": "from operator import attrgetter", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.004, 0.004, 0, 0.66, 0.0, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["attrgetter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from operator import attrgetter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ImportFrom_L3_C0", "label": "from django.db import connections, transaction, IntegrityError", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0121, 0.004, 0, 0.66, 0.0769, 40, 0, 3, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connections", "transaction", "IntegrityError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connections, transaction, IntegrityError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ImportFrom_L4_C0", "label": "from django.db.models import signals, sql", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0161, 0.004, 0, 0.66, 0.1538, 680, 0, 2, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["signals", "sql"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import signals, sql"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ImportFrom_L5_C0", "label": "from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0202, 0.004, 0, 0.66, 0.2308, 971, 0, 1, 0, 0, 971, 0, 0], "semantic": {"name": "django.db.models.sql.constants", "arg_names": [], "import_names": ["GET_ITERATOR_CHUNK_SIZE"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ImportFrom_L6_C0", "label": "from django.utils.datastructures import SortedDict", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0242, 0.004, 0, 0.66, 0.3077, 757, 0, 1, 0, 0, 757, 0, 0], "semantic": {"name": "django.utils.datastructures", "arg_names": [], "import_names": ["SortedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.datastructures import SortedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ImportFrom_L7_C0", "label": "from django.utils.functional import wraps", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0282, 0.004, 0, 0.66, 0.3846, 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_99008:FunctionDef_L10_C0", "label": "CASCADE", "type": "function", "loc": [10, 14], "level": 0, "parent": null, "vector": [2, 0, 0.0484, 0.0202, 0, 0.66, 0.4615, 24, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "CASCADE", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def CASCADE(collector, field, sub_objs, using):\n collector.collect(sub_objs, source=field.rel.to,\n source_attr=field.name, nullable=field.null)\n if field.null and not connections[using].features.can_defer_constraint_checks:\n collector.add_field_update(field, None, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L11_C4", "label": "collect()", "type": "expression", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L10_C0", "vector": [8, 1, 0.0464, 0.0081, 1, 0.12, 0.0, 34, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "collect", "arg_names": [], "import_names": [], "rhs_call_name": "collect", "annotation": ""}, "snippet": " collector.collect(sub_objs, source=field.rel.to,\n source_attr=field.name, nullable=field.null)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L13_C4", "label": "if", "type": "if", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L10_C0", "vector": [4, 1, 0.0544, 0.0081, 1, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.null and not connections[using].features.can_defer_constraint_checks:\n collector.add_field_update(field, None, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L14_C8", "label": "add_field_update()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L13_C4", "vector": [8, 2, 0.0565, 0.004, 2, 0.12, 0.0, 787, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_field_update", "arg_names": [], "import_names": [], "rhs_call_name": "add_field_update", "annotation": ""}, "snippet": " collector.add_field_update(field, None, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L16_C0", "label": "PROTECT", "type": "function", "loc": [16, 20], "level": 0, "parent": null, "vector": [2, 0, 0.0726, 0.0202, 0, 0.66, 0.5385, 9, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "PROTECT", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def PROTECT(collector, field, sub_objs, using):\n raise IntegrityError(\"Cannot delete some instances of model '%s' because \"\n \"they are referenced through a protected foreign key: '%s.%s'\" % (\n field.rel.to.__name__, sub_objs[0].__class__.__name__, field.name\n ))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L22_C0", "label": "SET", "type": "function", "loc": [22, 29], "level": 0, "parent": null, "vector": [2, 0, 0.1028, 0.0323, 0, 0.66, 0.6154, 140, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "SET", "arg_names": ["value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SET(value):\n if callable(value):\n def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value(), sub_objs)\n else:\n def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value, sub_objs)\n return set_on_delete"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4", "label": "if", "type": "if", "loc": [23, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L22_C0", "vector": [4, 1, 0.1028, 0.0242, 1, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if callable(value):\n def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value(), sub_objs)\n else:\n def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L24_C8", "label": "set_on_delete", "type": "function", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4", "vector": [2, 2, 0.0988, 0.0081, 2, 0.75, 0.0, 227, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "set_on_delete", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value(), sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L25_C12", "label": "add_field_update()", "type": "expression", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L24_C8", "vector": [8, 3, 0.1008, 0.004, 3, 0.77, 0.0, 787, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_field_update", "arg_names": [], "import_names": [], "rhs_call_name": "add_field_update", "annotation": ""}, "snippet": " collector.add_field_update(field, value(), sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L27_C8", "label": "set_on_delete", "type": "function", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4", "vector": [2, 2, 0.1109, 0.0081, 2, 0.75, 1.0, 227, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "set_on_delete", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_on_delete(collector, field, sub_objs, using):\n collector.add_field_update(field, value, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L28_C12", "label": "add_field_update()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L27_C8", "vector": [8, 3, 0.1129, 0.004, 3, 0.39, 0.0, 787, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_field_update", "arg_names": [], "import_names": [], "rhs_call_name": "add_field_update", "annotation": ""}, "snippet": " collector.add_field_update(field, value, sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L29_C4", "label": "return", "type": "return", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L22_C0", "vector": [13, 1, 0.1169, 0.004, 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 set_on_delete"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L31_C0", "label": "SET_NULL = SET()", "type": "assigned_variable", "loc": [31, 31], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.004, 0, 0.66, 0.6923, 186, 3, 1, 0, 0, 140, 10, 1], "semantic": {"name": "SET_NULL", "arg_names": [], "import_names": [], "rhs_call_name": "SET", "annotation": ""}, "snippet": "SET_NULL = SET(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L33_C0", "label": "SET_DEFAULT", "type": "function", "loc": [33, 34], "level": 0, "parent": null, "vector": [2, 0, 0.1351, 0.0081, 0, 0.66, 0.7692, 889, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "SET_DEFAULT", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SET_DEFAULT(collector, field, sub_objs, using):\n collector.add_field_update(field, field.get_default(), sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L34_C4", "label": "add_field_update()", "type": "expression", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L33_C0", "vector": [8, 1, 0.1371, 0.004, 1, 0.41, 0.0, 787, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_field_update", "arg_names": [], "import_names": [], "rhs_call_name": "add_field_update", "annotation": ""}, "snippet": " collector.add_field_update(field, field.get_default(), sub_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L36_C0", "label": "DO_NOTHING", "type": "function", "loc": [36, 37], "level": 0, "parent": null, "vector": [2, 0, 0.1472, 0.0081, 0, 0.66, 0.8462, 527, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "DO_NOTHING", "arg_names": ["collector", "field", "sub_objs", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def DO_NOTHING(collector, field, sub_objs, using):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L39_C0", "label": "force_managed", "type": "function", "loc": [39, 56], "level": 0, "parent": null, "vector": [2, 0, 0.1915, 0.0726, 0, 0.66, 0.9231, 250, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "force_managed", "arg_names": ["func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def force_managed(func):\n @wraps(func)\n def decorated(self, *args, **kwargs):\n if not transaction.is_managed(using=self.using):\n transaction.enter_transaction_management(using=self.using)\n forced_managed = True\n else:\n forced_managed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4", "label": "decorated", "type": "function", "loc": [41, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L39_C0", "vector": [2, 1, 0.1935, 0.0605, 1, 0.52, 0.0, 504, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "decorated", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def decorated(self, *args, **kwargs):\n if not transaction.is_managed(using=self.using):\n transaction.enter_transaction_management(using=self.using)\n forced_managed = True\n else:\n forced_managed = False\n try:\n func(self, *args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "label": "if", "type": "if", "loc": [42, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4", "vector": [4, 2, 0.1774, 0.0202, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not transaction.is_managed(using=self.using):\n transaction.enter_transaction_management(using=self.using)\n forced_managed = True\n else:\n forced_managed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L43_C12", "label": "enter_transaction_management()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "vector": [8, 3, 0.1734, 0.004, 3, 0.45, 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=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L44_C12", "label": "forced_managed =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "vector": [14, 3, 0.1774, 0.004, 3, 0.45, 0.5, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forced_managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forced_managed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L46_C12", "label": "forced_managed =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "vector": [14, 3, 0.1855, 0.004, 3, 0.45, 1.0, 736, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "forced_managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " forced_managed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "label": "try", "type": "try", "loc": [47, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4", "vector": [7, 2, 0.2056, 0.0363, 2, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n func(self, *args, **kwargs)\n if forced_managed:\n transaction.commit(using=self.using)\n else:\n transaction.commit_unless_managed(using=self.using)\n finally:\n if forced_managed:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L48_C12", "label": "func()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "vector": [8, 3, 0.1935, 0.004, 3, 0.05, 0.0, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(self, *args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12", "label": "if", "type": "if", "loc": [49, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "vector": [4, 3, 0.2036, 0.0161, 3, 0.05, 0.5, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if forced_managed:\n transaction.commit(using=self.using)\n else:\n transaction.commit_unless_managed(using=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L50_C16", "label": "commit()", "type": "expression", "loc": [50, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12", "vector": [8, 4, 0.2016, 0.004, 4, 0.07, 0.0, 281, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "commit", "arg_names": [], "import_names": [], "rhs_call_name": "commit", "annotation": ""}, "snippet": " transaction.commit(using=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L52_C16", "label": "commit_unless_managed()", "type": "expression", "loc": [52, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12", "vector": [8, 4, 0.2097, 0.004, 4, 0.07, 1.0, 431, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "commit_unless_managed", "arg_names": [], "import_names": [], "rhs_call_name": "commit_unless_managed", "annotation": ""}, "snippet": " transaction.commit_unless_managed(using=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L54_C12", "label": "if", "type": "if", "loc": [54, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "vector": [4, 3, 0.2198, 0.0081, 3, 0.05, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if forced_managed:\n transaction.leave_transaction_management(using=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L55_C16", "label": "leave_transaction_management()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L54_C12", "vector": [8, 4, 0.2218, 0.004, 4, 0.75, 0.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=self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L56_C4", "label": "return", "type": "return", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L39_C0", "vector": [13, 1, 0.2258, 0.004, 1, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return decorated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "label": "Collector", "type": "class", "loc": [58, 248], "level": 0, "parent": null, "vector": [3, 0, 0.6169, 0.7702, 0, 0.66, 1.0, 189, 0, 9, 0, 0, 186, 0, 60], "semantic": {"name": "Collector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Collector(object):\n def __init__(self, using):\n self.using = using\n self.data = {} # {model: [instances]}\n self.batches = {} # {model: {field: set([instances])}}\n self.field_updates = {} # {model: {(field, value): set([instances])}}\n self.dependencies = {} # {model: set([models])}\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "label": "__init__", "type": "function", "loc": [59, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.248, 0.0242, 1, 0.31, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, using):\n self.using = using\n self.data = {} # {model: [instances]}\n self.batches = {} # {model: {field: set([instances])}}\n self.field_updates = {} # {model: {(field, value): set([instances])}}\n self.dependencies = {} # {model: set([models])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L60_C8", "label": "self.using =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "vector": [14, 2, 0.2419, 0.004, 2, 0.36, 0.0, 734, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.using = using"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L61_C8", "label": "self.data =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "vector": [14, 2, 0.246, 0.004, 2, 0.36, 0.25, 838, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = {} # {model: [instances]}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L62_C8", "label": "self.batches =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "vector": [14, 2, 0.25, 0.004, 2, 0.36, 0.5, 32, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.batches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.batches = {} # {model: {field: set([instances])}}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L63_C8", "label": "self.field_updates =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "vector": [14, 2, 0.254, 0.004, 2, 0.36, 0.75, 861, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.field_updates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field_updates = {} # {model: {(field, value): set([instances])}}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L64_C8", "label": "self.dependencies =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "vector": [14, 2, 0.2581, 0.004, 2, 0.36, 1.0, 529, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.dependencies", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.dependencies = {} # {model: set([models])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "label": "add", "type": "function", "loc": [66, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.3105, 0.0927, 1, 0.31, 0.125, 241, 0, 4, 1, 0, 0, 0, 6], "semantic": {"name": "add", "arg_names": ["self", "objs", "source", "nullable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, objs, source=None, nullable=False):\n \"\"\"\n Adds 'objs' to the collection of objects to be deleted. If the call is\n the result of a cascade, 'source' should be the model that caused it\n and 'nullable' should be set to True, if the relation can be null.\n\n Returns a list of all objects that were not already collected.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L67_C8", "label": "expression", "type": "expression", "loc": [67, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [8, 2, 0.2823, 0.0282, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Adds 'objs' to the collection of objects to be deleted. If the call is\n the result of a cascade, 'source' should be the model that caused it\n and 'nullable' should be set to True, if the relation can be null.\n\n Returns a list of all objects that were not already collected.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L74_C8", "label": "if", "type": "if", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [4, 2, 0.3004, 0.0081, 2, 0.18, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not objs:\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L75_C12", "label": "return", "type": "return", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L74_C8", "vector": [13, 3, 0.3024, 0.004, 3, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L76_C8", "label": "new_objs =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [14, 2, 0.3065, 0.004, 2, 0.18, 0.25, 11, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "new_objs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_objs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L77_C8", "label": "model =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [14, 2, 0.3105, 0.004, 2, 0.18, 0.375, 722, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model = objs[0].__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L78_C8", "label": "instances = setdefault()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [14, 2, 0.3145, 0.004, 2, 0.18, 0.5, 98, 3, 2, 0, 0, 262, 10, 1], "semantic": {"name": "instances", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " instances = self.data.setdefault(model, [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L79_C8", "label": "for obj", "type": "for", "loc": [79, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [6, 2, 0.3226, 0.0121, 2, 0.18, 0.625, 505, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n if obj not in instances:\n new_objs.append(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L80_C12", "label": "if", "type": "if", "loc": [80, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L79_C8", "vector": [4, 3, 0.3246, 0.0081, 3, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj not in instances:\n new_objs.append(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L81_C16", "label": "append()", "type": "expression", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L80_C12", "vector": [8, 4, 0.3266, 0.004, 4, 0.5, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " new_objs.append(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L82_C8", "label": "extend()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [8, 2, 0.3306, 0.004, 2, 0.18, 0.75, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " instances.extend(new_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L86_C8", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [4, 2, 0.3488, 0.0081, 2, 0.18, 0.875, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if new_objs and source is not None and not nullable:\n self.dependencies.setdefault(source, set()).add(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L87_C12", "label": "add()", "type": "expression", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L86_C8", "vector": [8, 3, 0.3508, 0.004, 3, 0.4, 0.0, 241, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.dependencies.setdefault(source, set()).add(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "vector": [13, 2, 0.3548, 0.004, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return new_objs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4", "label": "add_batch", "type": "function", "loc": [90, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.373, 0.0242, 1, 0.31, 0.25, 70, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "add_batch", "arg_names": ["self", "model", "field", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_batch(self, model, field, objs):\n \"\"\"\n Schedules a batch delete. Every instance of 'model' that is related to\n an instance of 'obj' through 'field' will be deleted.\n \"\"\"\n self.batches.setdefault(model, {}).setdefault(field, set()).update(objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L91_C8", "label": "expression", "type": "expression", "loc": [91, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4", "vector": [8, 2, 0.373, 0.0161, 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 Schedules a batch delete. Every instance of 'model' that is related to\n an instance of 'obj' through 'field' will be deleted.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L95_C8", "label": "update()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4", "vector": [8, 2, 0.3831, 0.004, 2, 0.99, 1.0, 637, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.batches.setdefault(model, {}).setdefault(field, set()).update(objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "label": "add_field_update", "type": "function", "loc": [97, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.4113, 0.0444, 1, 0.31, 0.375, 787, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "add_field_update", "arg_names": ["self", "field", "value", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_field_update(self, field, value, objs):\n \"\"\"\n Schedules a field update. 'objs' must be a homogenous iterable\n collection of model instances (e.g. a QuerySet).\n \"\"\"\n if not objs:\n return\n model = objs[0].__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L98_C8", "label": "expression", "type": "expression", "loc": [98, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "vector": [8, 2, 0.4012, 0.0161, 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 Schedules a field update. 'objs' must be a homogenous iterable\n collection of model instances (e.g. a QuerySet).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L102_C8", "label": "if", "type": "if", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "vector": [4, 2, 0.4133, 0.0081, 2, 0.78, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not objs:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L102_C8", "vector": [13, 3, 0.4153, 0.004, 3, 0.43, 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_99008:Assign_L104_C8", "label": "model =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "vector": [14, 2, 0.4194, 0.004, 2, 0.78, 0.6667, 722, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model = objs[0].__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L105_C8", "label": "update()", "type": "expression", "loc": [105, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "vector": [8, 2, 0.4274, 0.0121, 2, 0.78, 1.0, 637, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.field_updates.setdefault(\n model, {}).setdefault(\n (field, value), set()).update(objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "label": "collect", "type": "function", "loc": [109, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.5423, 0.2097, 1, 0.31, 0.5, 34, 0, 6, 0, 0, 0, 0, 10], "semantic": {"name": "collect", "arg_names": ["self", "objs", "source", "nullable", "collect_related", "source_attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collect(self, objs, source=None, nullable=False, collect_related=True,\n source_attr=None):\n \"\"\"\n Adds 'objs' to the collection of objects to be deleted as well as all\n parent instances. 'objs' must be a homogenous iterable collection of\n model instances (e.g. a QuerySet). If 'collect_related' is True,\n related objects will be handled by their respective on_delete handler.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L111_C8", "label": "expression", "type": "expression", "loc": [111, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [8, 2, 0.4657, 0.0403, 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 Adds 'objs' to the collection of objects to be deleted as well as all\n parent instances. 'objs' must be a homogenous iterable collection of\n model instances (e.g. a QuerySet). If 'collect_related' is True,\n related objects will be handled by their respective on_delete handler.\n\n If the call is the result of a cascade, 'source' should be the model\n that caused it and 'nullable' should be set to True, if the relation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L122_C8", "label": "if", "type": "if", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [4, 2, 0.494, 0.0081, 2, 0.11, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not connections[self.using].features.supports_deleting_related_objects:\n collect_related = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L123_C12", "label": "collect_related =", "type": "assigned_variable", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L122_C8", "vector": [14, 3, 0.496, 0.004, 3, 0.7, 0.0, 412, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "collect_related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collect_related = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L125_C8", "label": "new_objs = add()", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [14, 2, 0.504, 0.004, 2, 0.11, 0.3333, 11, 3, 3, 0, 0, 241, 10, 1], "semantic": {"name": "new_objs", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " new_objs = self.add(objs, source, nullable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L126_C8", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [4, 2, 0.5101, 0.0081, 2, 0.11, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not new_objs:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L127_C12", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L126_C8", "vector": [13, 3, 0.5121, 0.004, 3, 0.3, 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_99008:Assign_L128_C8", "label": "model =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [14, 2, 0.5161, 0.004, 2, 0.11, 0.6667, 722, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model = new_objs[0].__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L132_C8", "label": "for parent_model, ptr", "type": "for", "loc": [132, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [6, 2, 0.5423, 0.0242, 2, 0.11, 0.8333, 719, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "parent_model, ptr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent_model, ptr in model._meta.parents.iteritems():\n if ptr:\n parent_objs = [getattr(obj, ptr.name) for obj in new_objs]\n self.collect(parent_objs, source=model,\n source_attr=ptr.rel.related_name,\n collect_related=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12", "label": "if", "type": "if", "loc": [133, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L132_C8", "vector": [4, 3, 0.5444, 0.0202, 3, 0.9, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ptr:\n parent_objs = [getattr(obj, ptr.name) for obj in new_objs]\n self.collect(parent_objs, source=model,\n source_attr=ptr.rel.related_name,\n collect_related=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L134_C16", "label": "parent_objs =", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12", "vector": [14, 4, 0.5403, 0.004, 4, 0.41, 0.0, 71, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parent_objs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parent_objs = [getattr(obj, ptr.name) for obj in new_objs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L135_C16", "label": "collect()", "type": "expression", "loc": [135, 137], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12", "vector": [8, 4, 0.5484, 0.0121, 4, 0.41, 1.0, 34, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "collect", "arg_names": [], "import_names": [], "rhs_call_name": "collect", "annotation": ""}, "snippet": " self.collect(parent_objs, source=model,\n source_attr=ptr.rel.related_name,\n collect_related=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8", "label": "if", "type": "if", "loc": [139, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "vector": [4, 2, 0.6028, 0.0887, 2, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if collect_related:\n for related in model._meta.get_all_related_objects(include_hidden=True):\n field = related.field\n if related.model._meta.auto_created:\n self.add_batch(related.model, field, new_objs)\n else:\n sub_objs = self.related_objects(related, new_objs)\n if not sub_objs:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12", "label": "for related", "type": "for", "loc": [140, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8", "vector": [6, 3, 0.5806, 0.0363, 3, 0.75, 0.0, 462, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for related in model._meta.get_all_related_objects(include_hidden=True):\n field = related.field\n if related.model._meta.auto_created:\n self.add_batch(related.model, field, new_objs)\n else:\n sub_objs = self.related_objects(related, new_objs)\n if not sub_objs:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L141_C16", "label": "field =", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12", "vector": [14, 4, 0.5685, 0.004, 4, 0.36, 0.0, 480, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = related.field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "label": "if", "type": "if", "loc": [142, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12", "vector": [4, 4, 0.5847, 0.0282, 4, 0.36, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if related.model._meta.auto_created:\n self.add_batch(related.model, field, new_objs)\n else:\n sub_objs = self.related_objects(related, new_objs)\n if not sub_objs:\n continue\n field.rel.on_delete(self, field, sub_objs, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L143_C20", "label": "add_batch()", "type": "expression", "loc": [143, 143], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "vector": [8, 5, 0.5766, 0.004, 5, 0.32, 0.0, 70, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_batch", "arg_names": [], "import_names": [], "rhs_call_name": "add_batch", "annotation": ""}, "snippet": " self.add_batch(related.model, field, new_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L145_C20", "label": "sub_objs = related_objects()", "type": "assigned_variable", "loc": [145, 145], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "vector": [14, 5, 0.5847, 0.004, 5, 0.32, 0.3333, 235, 3, 2, 0, 0, 768, 10, 1], "semantic": {"name": "sub_objs", "arg_names": [], "import_names": [], "rhs_call_name": "related_objects", "annotation": ""}, "snippet": " sub_objs = self.related_objects(related, new_objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L146_C20", "label": "if", "type": "if", "loc": [146, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "vector": [4, 5, 0.5907, 0.0081, 5, 0.32, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sub_objs:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L148_C20", "label": "on_delete()", "type": "expression", "loc": [148, 148], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "vector": [8, 5, 0.5968, 0.004, 5, 0.32, 1.0, 523, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "on_delete", "arg_names": [], "import_names": [], "rhs_call_name": "on_delete", "annotation": ""}, "snippet": " field.rel.on_delete(self, field, sub_objs, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L154_C12", "label": "for relation", "type": "for", "loc": [154, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8", "vector": [6, 3, 0.6331, 0.0282, 3, 0.75, 1.0, 363, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "relation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for relation in model._meta.many_to_many:\n if not relation.rel.through:\n sub_objs = relation.bulk_related_objects(new_objs, self.using)\n self.collect(sub_objs,\n source=model,\n source_attr=relation.rel.related_name,\n nullable=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16", "label": "if", "type": "if", "loc": [155, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L154_C12", "vector": [4, 4, 0.6351, 0.0242, 4, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not relation.rel.through:\n sub_objs = relation.bulk_related_objects(new_objs, self.using)\n self.collect(sub_objs,\n source=model,\n source_attr=relation.rel.related_name,\n nullable=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L156_C20", "label": "sub_objs = bulk_related_objects()", "type": "assigned_variable", "loc": [156, 156], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16", "vector": [14, 5, 0.629, 0.004, 5, 0.7, 0.0, 235, 3, 2, 0, 0, 85, 10, 1], "semantic": {"name": "sub_objs", "arg_names": [], "import_names": [], "rhs_call_name": "bulk_related_objects", "annotation": ""}, "snippet": " sub_objs = relation.bulk_related_objects(new_objs, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L157_C20", "label": "collect()", "type": "expression", "loc": [157, 160], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16", "vector": [8, 5, 0.6391, 0.0161, 5, 0.7, 1.0, 34, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "collect", "arg_names": [], "import_names": [], "rhs_call_name": "collect", "annotation": ""}, "snippet": " self.collect(sub_objs,\n source=model,\n source_attr=relation.rel.related_name,\n nullable=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4", "label": "related_objects", "type": "function", "loc": [162, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.6673, 0.0323, 1, 0.31, 0.625, 768, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "related_objects", "arg_names": ["self", "related", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def related_objects(self, related, objs):\n \"\"\"\n Gets a QuerySet of objects related to ``objs`` via the relation ``related``.\n\n \"\"\"\n return related.model._base_manager.using(self.using).filter(\n **{\"%s__in\" % related.field.name: objs}\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L163_C8", "label": "expression", "type": "expression", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4", "vector": [8, 2, 0.6633, 0.0161, 2, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Gets a QuerySet of objects related to ``objs`` via the relation ``related``.\n\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L167_C8", "label": "return", "type": "return", "loc": [167, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4", "vector": [13, 2, 0.6774, 0.0121, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return related.model._base_manager.using(self.using).filter(\n **{\"%s__in\" % related.field.name: objs}\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L171_C4", "label": "instances_with_model", "type": "function", "loc": [171, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.6956, 0.0161, 1, 0.31, 0.75, 966, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "instances_with_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def instances_with_model(self):\n for model, instances in self.data.iteritems():\n for obj in instances:\n yield model, obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L172_C8", "label": "for model, instances", "type": "for", "loc": [172, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L171_C4", "vector": [6, 2, 0.6976, 0.0121, 2, 0.4, 0.0, 515, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "model, instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, instances in self.data.iteritems():\n for obj in instances:\n yield model, obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L173_C12", "label": "for obj", "type": "for", "loc": [173, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L172_C8", "vector": [6, 3, 0.6996, 0.0081, 3, 0.06, 0.0, 505, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in instances:\n yield model, obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L174_C16", "label": "expression", "type": "expression", "loc": [174, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L173_C12", "vector": [8, 4, 0.7016, 0.004, 4, 0.93, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield model, obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "label": "sort", "type": "function", "loc": [176, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.7399, 0.0645, 1, 0.31, 0.875, 489, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "sort", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sort(self):\n sorted_models = []\n models = self.data.keys()\n while len(sorted_models) < len(models):\n found = False\n for model in models:\n if model in sorted_models:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L177_C8", "label": "sorted_models =", "type": "assigned_variable", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "vector": [14, 2, 0.7137, 0.004, 2, 0.3, 0.0, 359, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "sorted_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sorted_models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L178_C8", "label": "models = keys()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "vector": [14, 2, 0.7177, 0.004, 2, 0.3, 0.3333, 495, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " models = self.data.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "label": "while", "type": "while", "loc": [179, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "vector": [5, 2, 0.7419, 0.0444, 2, 0.3, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while len(sorted_models) < len(models):\n found = False\n for model in models:\n if model in sorted_models:\n continue\n dependencies = self.dependencies.get(model)\n if not (dependencies and dependencies.difference(sorted_models)):\n sorted_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L180_C12", "label": "found =", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "vector": [14, 3, 0.7258, 0.004, 3, 0.62, 0.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "label": "for model", "type": "for", "loc": [181, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "vector": [6, 3, 0.7419, 0.0282, 3, 0.62, 0.5, 722, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models:\n if model in sorted_models:\n continue\n dependencies = self.dependencies.get(model)\n if not (dependencies and dependencies.difference(sorted_models)):\n sorted_models.append(model)\n found = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L182_C16", "label": "if", "type": "if", "loc": [182, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "vector": [4, 4, 0.7359, 0.0081, 4, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model in sorted_models:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L184_C16", "label": "dependencies = get()", "type": "assigned_variable", "loc": [184, 184], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "vector": [14, 4, 0.7419, 0.004, 4, 0.1, 0.5, 357, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "dependencies", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " dependencies = self.dependencies.get(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16", "label": "if", "type": "if", "loc": [185, 187], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "vector": [4, 4, 0.75, 0.0121, 4, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (dependencies and dependencies.difference(sorted_models)):\n sorted_models.append(model)\n found = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L186_C20", "label": "append()", "type": "expression", "loc": [186, 186], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16", "vector": [8, 5, 0.75, 0.004, 5, 0.71, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " sorted_models.append(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L187_C20", "label": "found =", "type": "assigned_variable", "loc": [187, 187], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16", "vector": [14, 5, 0.754, 0.004, 5, 0.71, 1.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L188_C12", "label": "if", "type": "if", "loc": [188, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "vector": [4, 3, 0.7601, 0.0081, 3, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not found:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L189_C16", "label": "return", "type": "return", "loc": [189, 189], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L188_C12", "vector": [13, 4, 0.7621, 0.004, 4, 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_99008:Assign_L190_C8", "label": "self.data = SortedDict()", "type": "assigned_variable", "loc": [190, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "vector": [14, 2, 0.7681, 0.0081, 2, 0.3, 1.0, 838, 3, 1, 0, 0, 525, 10, 1], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "SortedDict", "annotation": ""}, "snippet": " self.data = SortedDict([(model, self.data[model])\n for model in sorted_models])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "label": "delete", "type": "function", "loc": [194, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "vector": [2, 1, 0.8911, 0.2218, 1, 0.31, 1.0, 266, 0, 1, 0, 0, 0, 0, 26], "semantic": {"name": "delete", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self):\n # sort instance collections\n for instances in self.data.itervalues():\n instances.sort(key=attrgetter(\"pk\"))\n\n # if possible, bring the models in an order suitable for databases that\n # don't support transactions or cannot defer contraint checks until the\n # end of a transaction."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L196_C8", "label": "for instances", "type": "for", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.7923, 0.0081, 2, 0.03, 0.0, 98, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for instances in self.data.itervalues():\n instances.sort(key=attrgetter(\"pk\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L197_C12", "label": "sort()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L196_C8", "vector": [8, 3, 0.7944, 0.004, 3, 0.36, 0.0, 489, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " instances.sort(key=attrgetter(\"pk\"))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L202_C8", "label": "sort()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [8, 2, 0.8145, 0.004, 2, 0.03, 0.1111, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " self.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L205_C8", "label": "for model, obj", "type": "for", "loc": [205, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.8347, 0.0202, 2, 0.03, 0.2222, 99, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "model, obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, obj in self.instances_with_model():\n if not model._meta.auto_created:\n signals.pre_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L206_C12", "label": "if", "type": "if", "loc": [206, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L205_C8", "vector": [4, 3, 0.8367, 0.0161, 3, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model._meta.auto_created:\n signals.pre_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L207_C16", "label": "send()", "type": "expression", "loc": [207, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L206_C12", "vector": [8, 4, 0.8387, 0.0121, 4, 0.11, 0.0, 826, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.pre_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8", "label": "for model, instances_for_fieldvalues", "type": "for", "loc": [212, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.8629, 0.0202, 2, 0.03, 0.3333, 723, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "model, instances_for_fieldvalues", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, instances_for_fieldvalues in self.field_updates.iteritems():\n query = sql.UpdateQuery(model)\n for (field, value), instances in instances_for_fieldvalues.iteritems():\n query.update_batch([obj.pk for obj in instances],\n {field.name: value}, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L213_C12", "label": "query = UpdateQuery()", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8", "vector": [14, 3, 0.8589, 0.004, 3, 0.82, 0.0, 546, 3, 1, 0, 0, 921, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "UpdateQuery", "annotation": ""}, "snippet": " query = sql.UpdateQuery(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L214_C12", "label": "for instances", "type": "for", "loc": [214, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8", "vector": [6, 3, 0.8669, 0.0121, 3, 0.82, 1.0, 98, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (field, value), instances in instances_for_fieldvalues.iteritems():\n query.update_batch([obj.pk for obj in instances],\n {field.name: value}, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L215_C16", "label": "update_batch()", "type": "expression", "loc": [215, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L214_C12", "vector": [8, 4, 0.869, 0.0081, 4, 0.42, 0.0, 590, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "update_batch", "arg_names": [], "import_names": [], "rhs_call_name": "update_batch", "annotation": ""}, "snippet": " query.update_batch([obj.pk for obj in instances],\n {field.name: value}, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L219_C8", "label": "for instances", "type": "for", "loc": [219, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.8851, 0.0081, 2, 0.03, 0.4444, 98, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for instances in self.data.itervalues():\n instances.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L220_C12", "label": "reverse()", "type": "expression", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L219_C8", "vector": [8, 3, 0.8871, 0.004, 3, 0.33, 0.0, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reverse", "arg_names": [], "import_names": [], "rhs_call_name": "reverse", "annotation": ""}, "snippet": " instances.reverse()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8", "label": "for model, batches", "type": "for", "loc": [223, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.9052, 0.0161, 2, 0.03, 0.5556, 966, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "model, batches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, batches in self.batches.iteritems():\n query = sql.DeleteQuery(model)\n for field, instances in batches.iteritems():\n query.delete_batch([obj.pk for obj in instances], self.using, field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L224_C12", "label": "query = DeleteQuery()", "type": "assigned_variable", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8", "vector": [14, 3, 0.9032, 0.004, 3, 0.77, 0.0, 546, 3, 1, 0, 0, 398, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "DeleteQuery", "annotation": ""}, "snippet": " query = sql.DeleteQuery(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L225_C12", "label": "for field, instances", "type": "for", "loc": [225, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8", "vector": [6, 3, 0.9093, 0.0081, 3, 0.77, 1.0, 868, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "field, instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, instances in batches.iteritems():\n query.delete_batch([obj.pk for obj in instances], self.using, field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L226_C16", "label": "delete_batch()", "type": "expression", "loc": [226, 226], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L225_C12", "vector": [8, 4, 0.9113, 0.004, 4, 0.93, 0.0, 133, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "delete_batch", "arg_names": [], "import_names": [], "rhs_call_name": "delete_batch", "annotation": ""}, "snippet": " query.delete_batch([obj.pk for obj in instances], self.using, field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "label": "for model, instances", "type": "for", "loc": [229, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.9294, 0.0161, 2, 0.03, 0.6667, 515, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "model, instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, instances in self.data.iteritems():\n query = sql.DeleteQuery(model)\n pk_list = [obj.pk for obj in instances]\n query.delete_batch(pk_list, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L230_C12", "label": "query = DeleteQuery()", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "vector": [14, 3, 0.9274, 0.004, 3, 0.38, 0.0, 546, 3, 1, 0, 0, 398, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "DeleteQuery", "annotation": ""}, "snippet": " query = sql.DeleteQuery(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L231_C12", "label": "pk_list =", "type": "assigned_variable", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "vector": [14, 3, 0.9315, 0.004, 3, 0.38, 0.5, 814, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pk_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pk_list = [obj.pk for obj in instances]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L232_C12", "label": "delete_batch()", "type": "expression", "loc": [232, 232], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "vector": [8, 3, 0.9355, 0.004, 3, 0.38, 1.0, 133, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "delete_batch", "arg_names": [], "import_names": [], "rhs_call_name": "delete_batch", "annotation": ""}, "snippet": " query.delete_batch(pk_list, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L235_C8", "label": "for model, obj", "type": "for", "loc": [235, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.9556, 0.0202, 2, 0.03, 0.7778, 99, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "model, obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, obj in self.instances_with_model():\n if not model._meta.auto_created:\n signals.post_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L236_C12", "label": "if", "type": "if", "loc": [236, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L235_C8", "vector": [4, 3, 0.9577, 0.0161, 3, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model._meta.auto_created:\n signals.post_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L237_C16", "label": "send()", "type": "expression", "loc": [237, 239], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L236_C12", "vector": [8, 4, 0.9597, 0.0121, 4, 0.36, 0.0, 826, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.post_delete.send(\n sender=model, instance=obj, using=self.using\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L242_C8", "label": "for model, instances_for_fieldvalues", "type": "for", "loc": [242, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.9819, 0.0161, 2, 0.03, 0.8889, 723, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "model, instances_for_fieldvalues", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, instances_for_fieldvalues in self.field_updates.iteritems():\n for (field, value), instances in instances_for_fieldvalues.iteritems():\n for obj in instances:\n setattr(obj, field.attname, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L243_C12", "label": "for instances", "type": "for", "loc": [243, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L242_C8", "vector": [6, 3, 0.9839, 0.0121, 3, 0.26, 0.0, 98, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (field, value), instances in instances_for_fieldvalues.iteritems():\n for obj in instances:\n setattr(obj, field.attname, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L244_C16", "label": "for obj", "type": "for", "loc": [244, 245], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L243_C12", "vector": [6, 4, 0.9859, 0.0081, 4, 0.79, 0.0, 505, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in instances:\n setattr(obj, field.attname, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L245_C20", "label": "setattr()", "type": "expression", "loc": [245, 245], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L244_C16", "vector": [8, 5, 0.9879, 0.004, 5, 0.08, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(obj, field.attname, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L246_C8", "label": "for model, instances", "type": "for", "loc": [246, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "vector": [6, 2, 0.996, 0.0121, 2, 0.03, 1.0, 515, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "model, instances", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, instances in self.data.iteritems():\n for instance in instances:\n setattr(instance, model._meta.pk.attname, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L247_C12", "label": "for instance", "type": "for", "loc": [247, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L246_C8", "vector": [6, 3, 0.998, 0.0081, 3, 0.24, 0.0, 255, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "instance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for instance in instances:\n setattr(instance, model._meta.pk.attname, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L248_C16", "label": "setattr()", "type": "expression", "loc": [248, 248], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L247_C12", "vector": [8, 4, 1.0, 0.004, 4, 0.3, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, model._meta.pk.attname, None)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L24_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L50_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L49_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L52_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:Try_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L74_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L80_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L135_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L143_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L145_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L146_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L142_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L148_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L154_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L156_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L155_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L157_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L171_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L173_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L174_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L182_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L181_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L186_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L185_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:While_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L188_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Return_L189_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L206_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L212_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L214_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L215_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L225_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L226_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Assign_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L232_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L237_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L243_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L244_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L244_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L245_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99008:For_L247_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99008:Expr_L248_C16"}] |
from datetime import datetime
from django.utils import tree
from django.utils.copycompat import deepcopy
class ExpressionNode(tree.Node):
"""
Base class for all query expressions.
"""
# Arithmetic connectors
ADD = '+'
SUB = '-'
MUL = '*'
DIV = '/'
MOD = '%%' # This is a quoted % operator - it is quoted
# because it can be used in strings that also
# have parameter substitution.
# Bitwise operators
AND = '&'
OR = '|'
def __init__(self, children=None, connector=None, negated=False):
if children is not None and len(children) > 1 and connector is None:
raise TypeError('You have to specify a connector.')
super(ExpressionNode, self).__init__(children, connector, negated)
def _combine(self, other, connector, reversed, node=None):
if reversed:
obj = ExpressionNode([other], connector)
obj.add(node or self, connector)
else:
obj = node or ExpressionNode([self], connector)
obj.add(other, connector)
return obj
###################
# VISITOR METHODS #
###################
def prepare(self, evaluator, query, allow_joins):
return evaluator.prepare_node(self, query, allow_joins)
def evaluate(self, evaluator, qn, connection):
return evaluator.evaluate_node(self, qn, connection)
#############
# OPERATORS #
#############
def __add__(self, other):
return self._combine(other, self.ADD, False)
def __sub__(self, other):
return self._combine(other, self.SUB, False)
def __mul__(self, other):
return self._combine(other, self.MUL, False)
def __div__(self, other):
return self._combine(other, self.DIV, False)
def __mod__(self, other):
return self._combine(other, self.MOD, False)
def __and__(self, other):
return self._combine(other, self.AND, False)
def __or__(self, other):
return self._combine(other, self.OR, False)
def __radd__(self, other):
return self._combine(other, self.ADD, True)
def __rsub__(self, other):
return self._combine(other, self.SUB, True)
def __rmul__(self, other):
return self._combine(other, self.MUL, True)
def __rdiv__(self, other):
return self._combine(other, self.DIV, True)
def __rmod__(self, other):
return self._combine(other, self.MOD, True)
def __rand__(self, other):
return self._combine(other, self.AND, True)
def __ror__(self, other):
return self._combine(other, self.OR, True)
def prepare_database_save(self, unused):
return self
class F(ExpressionNode):
"""
An expression representing the value of the given field.
"""
def __init__(self, name):
super(F, self).__init__(None, None, False)
self.name = name
def __deepcopy__(self, memodict):
obj = super(F, self).__deepcopy__(memodict)
obj.name = self.name
return obj
def prepare(self, evaluator, query, allow_joins):
return evaluator.prepare_leaf(self, query, allow_joins)
def evaluate(self, evaluator, qn, connection):
return evaluator.evaluate_leaf(self, qn, connection)
| ajibawa-2023/Python-Code-Large/train/row_99009 | 69 | 113 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99009:ImportFrom_L1_C0", "label": "from datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 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": "from datetime import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:ImportFrom_L3_C0", "label": "from django.utils import tree", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0088, 0, 0.66, 0.25, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["tree"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:ImportFrom_L4_C0", "label": "from django.utils.copycompat import deepcopy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0354, 0.0088, 0, 0.66, 0.5, 125, 0, 1, 0, 0, 125, 0, 0], "semantic": {"name": "django.utils.copycompat", "arg_names": [], "import_names": ["deepcopy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.copycompat import deepcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "label": "ExpressionNode", "type": "class", "loc": [6, 94], "level": 0, "parent": null, "vector": [3, 0, 0.4425, 0.7876, 0, 0.66, 0.75, 612, 0, 19, 0, 0, 668, 0, 24], "semantic": {"name": "ExpressionNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExpressionNode(tree.Node):\n \"\"\"\n Base class for all query expressions.\n \"\"\"\n # Arithmetic connectors\n ADD = '+'\n SUB = '-'\n MUL = '*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L7_C4", "label": "expression", "type": "expression", "loc": [7, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [8, 1, 0.0708, 0.0265, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Base class for all query expressions.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L11_C4", "label": "ADD =", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.0973, 0.0088, 1, 0.25, 0.0385, 408, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ADD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ADD = '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L12_C4", "label": "SUB =", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.1062, 0.0088, 1, 0.25, 0.0769, 722, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SUB", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " SUB = '-'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L13_C4", "label": "MUL =", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.115, 0.0088, 1, 0.25, 0.1154, 297, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MUL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " MUL = '*'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L14_C4", "label": "DIV =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.1239, 0.0088, 1, 0.25, 0.1538, 697, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "DIV", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " DIV = '/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L15_C4", "label": "MOD =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.1327, 0.0088, 1, 0.25, 0.1923, 987, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MOD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " MOD = '%%' # This is a quoted % operator - it is quoted"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L20_C4", "label": "AND =", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.177, 0.0088, 1, 0.25, 0.2308, 436, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "AND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " AND = '&'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L21_C4", "label": "OR =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [14, 1, 0.1858, 0.0088, 1, 0.25, 0.2692, 762, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " OR = '|'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.2168, 0.0354, 1, 0.25, 0.3077, 555, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "children", "connector", "negated"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, children=None, connector=None, negated=False):\n if children is not None and len(children) > 1 and connector is None:\n raise TypeError('You have to specify a connector.')\n super(ExpressionNode, self).__init__(children, connector, negated)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L24_C8", "label": "if", "type": "if", "loc": [24, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4", "vector": [4, 2, 0.2168, 0.0177, 2, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if children is not None and len(children) > 1 and connector is None:\n raise TypeError('You have to specify a connector.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L26_C8", "label": "__init__()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4", "vector": [8, 2, 0.2301, 0.0088, 2, 0.22, 1.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(ExpressionNode, self).__init__(children, connector, negated)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4", "label": "_combine", "type": "function", "loc": [28, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.2788, 0.0708, 1, 0.25, 0.3462, 388, 0, 5, 1, 0, 0, 0, 4], "semantic": {"name": "_combine", "arg_names": ["self", "other", "connector", "reversed", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _combine(self, other, connector, reversed, node=None):\n if reversed:\n obj = ExpressionNode([other], connector)\n obj.add(node or self, connector)\n else:\n obj = node or ExpressionNode([self], connector)\n obj.add(other, connector)\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "label": "if", "type": "if", "loc": [29, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4", "vector": [4, 2, 0.2788, 0.0531, 2, 0.22, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if reversed:\n obj = ExpressionNode([other], connector)\n obj.add(node or self, connector)\n else:\n obj = node or ExpressionNode([self], connector)\n obj.add(other, connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L30_C12", "label": "obj = ExpressionNode()", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "vector": [14, 3, 0.2655, 0.0088, 3, 0.63, 0.0, 505, 3, 2, 0, 0, 612, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "ExpressionNode", "annotation": ""}, "snippet": " obj = ExpressionNode([other], connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L31_C12", "label": "add()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "vector": [8, 3, 0.2743, 0.0088, 3, 0.63, 0.3333, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " obj.add(node or self, connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L33_C12", "label": "obj =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "vector": [14, 3, 0.292, 0.0088, 3, 0.63, 0.6667, 505, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj = node or ExpressionNode([self], connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L34_C12", "label": "add()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "vector": [8, 3, 0.3009, 0.0088, 3, 0.63, 1.0, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " obj.add(other, connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4", "vector": [13, 2, 0.3097, 0.0088, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L41_C4", "label": "prepare", "type": "function", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.3673, 0.0177, 1, 0.25, 0.3846, 556, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "prepare", "arg_names": ["self", "evaluator", "query", "allow_joins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self, evaluator, query, allow_joins):\n return evaluator.prepare_node(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L42_C8", "label": "return", "type": "return", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L41_C4", "vector": [13, 2, 0.3717, 0.0088, 2, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return evaluator.prepare_node(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L44_C4", "label": "evaluate", "type": "function", "loc": [44, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.3938, 0.0177, 1, 0.25, 0.4231, 528, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "evaluate", "arg_names": ["self", "evaluator", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def evaluate(self, evaluator, qn, connection):\n return evaluator.evaluate_node(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L44_C4", "vector": [13, 2, 0.3982, 0.0088, 2, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return evaluator.evaluate_node(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L51_C4", "label": "__add__", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.4558, 0.0177, 1, 0.25, 0.4615, 899, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__add__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __add__(self, other):\n return self._combine(other, self.ADD, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L51_C4", "vector": [13, 2, 0.4602, 0.0088, 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 self._combine(other, self.ADD, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L54_C4", "label": "__sub__", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.4823, 0.0177, 1, 0.25, 0.5, 555, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__sub__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __sub__(self, other):\n return self._combine(other, self.SUB, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L54_C4", "vector": [13, 2, 0.4867, 0.0088, 2, 0.24, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.SUB, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L57_C4", "label": "__mul__", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.5088, 0.0177, 1, 0.25, 0.5385, 215, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__mul__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __mul__(self, other):\n return self._combine(other, self.MUL, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L57_C4", "vector": [13, 2, 0.5133, 0.0088, 2, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.MUL, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L60_C4", "label": "__div__", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.5354, 0.0177, 1, 0.25, 0.5769, 399, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__div__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __div__(self, other):\n return self._combine(other, self.DIV, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L60_C4", "vector": [13, 2, 0.5398, 0.0088, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.DIV, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L63_C4", "label": "__mod__", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.5619, 0.0177, 1, 0.25, 0.6154, 476, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__mod__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __mod__(self, other):\n return self._combine(other, self.MOD, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L63_C4", "vector": [13, 2, 0.5664, 0.0088, 2, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.MOD, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L66_C4", "label": "__and__", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.5885, 0.0177, 1, 0.25, 0.6538, 916, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__and__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __and__(self, other):\n return self._combine(other, self.AND, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L66_C4", "vector": [13, 2, 0.5929, 0.0088, 2, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.AND, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L69_C4", "label": "__or__", "type": "function", "loc": [69, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.615, 0.0177, 1, 0.25, 0.6923, 789, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__or__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __or__(self, other):\n return self._combine(other, self.OR, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L69_C4", "vector": [13, 2, 0.6195, 0.0088, 2, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.OR, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L72_C4", "label": "__radd__", "type": "function", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.6416, 0.0177, 1, 0.25, 0.7308, 241, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__radd__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __radd__(self, other):\n return self._combine(other, self.ADD, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L73_C8", "label": "return", "type": "return", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L72_C4", "vector": [13, 2, 0.646, 0.0088, 2, 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._combine(other, self.ADD, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L75_C4", "label": "__rsub__", "type": "function", "loc": [75, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.6681, 0.0177, 1, 0.25, 0.7692, 213, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__rsub__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rsub__(self, other):\n return self._combine(other, self.SUB, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L75_C4", "vector": [13, 2, 0.6726, 0.0088, 2, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.SUB, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L78_C4", "label": "__rmul__", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.6947, 0.0177, 1, 0.25, 0.8077, 612, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__rmul__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rmul__(self, other):\n return self._combine(other, self.MUL, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L78_C4", "vector": [13, 2, 0.6991, 0.0088, 2, 0.76, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.MUL, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L81_C4", "label": "__rdiv__", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.7212, 0.0177, 1, 0.25, 0.8462, 687, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__rdiv__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rdiv__(self, other):\n return self._combine(other, self.DIV, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L81_C4", "vector": [13, 2, 0.7257, 0.0088, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.DIV, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L84_C4", "label": "__rmod__", "type": "function", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.7478, 0.0177, 1, 0.25, 0.8846, 968, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__rmod__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rmod__(self, other):\n return self._combine(other, self.MOD, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L84_C4", "vector": [13, 2, 0.7522, 0.0088, 2, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.MOD, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L87_C4", "label": "__rand__", "type": "function", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.7743, 0.0177, 1, 0.25, 0.9231, 308, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__rand__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __rand__(self, other):\n return self._combine(other, self.AND, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L87_C4", "vector": [13, 2, 0.7788, 0.0088, 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._combine(other, self.AND, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L90_C4", "label": "__ror__", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.8009, 0.0177, 1, 0.25, 0.9615, 346, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__ror__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __ror__(self, other):\n return self._combine(other, self.OR, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L91_C8", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L90_C4", "vector": [13, 2, 0.8053, 0.0088, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.OR, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L93_C4", "label": "prepare_database_save", "type": "function", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "vector": [2, 1, 0.8274, 0.0177, 1, 0.25, 1.0, 536, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "prepare_database_save", "arg_names": ["self", "unused"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare_database_save(self, unused):\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L93_C4", "vector": [13, 2, 0.8319, 0.0088, 2, 0.94, 0.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_99009:ClassDef_L96_C0", "label": "F", "type": "class", "loc": [96, 113], "level": 0, "parent": null, "vector": [3, 0, 0.9248, 0.1593, 0, 0.66, 1.0, 498, 0, 4, 0, 0, 612, 0, 6], "semantic": {"name": "F", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class F(ExpressionNode):\n \"\"\"\n An expression representing the value of the given field.\n \"\"\"\n def __init__(self, name):\n super(F, self).__init__(None, None, False)\n self.name = name\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L97_C4", "label": "expression", "type": "expression", "loc": [97, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "vector": [8, 1, 0.8673, 0.0265, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An expression representing the value of the given field.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4", "label": "__init__", "type": "function", "loc": [100, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "vector": [2, 1, 0.8938, 0.0265, 1, 0.89, 0.25, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name):\n super(F, self).__init__(None, None, False)\n self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L101_C8", "label": "__init__()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4", "vector": [8, 2, 0.8938, 0.0088, 2, 0.66, 0.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(F, self).__init__(None, None, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L102_C8", "label": "self.name =", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4", "vector": [14, 2, 0.9027, 0.0088, 2, 0.66, 1.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "label": "__deepcopy__", "type": "function", "loc": [104, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "vector": [2, 1, 0.9336, 0.0354, 1, 0.89, 0.5, 652, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__deepcopy__", "arg_names": ["self", "memodict"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __deepcopy__(self, memodict):\n obj = super(F, self).__deepcopy__(memodict)\n obj.name = self.name\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L105_C8", "label": "obj = __deepcopy__()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "vector": [14, 2, 0.9292, 0.0088, 2, 0.63, 0.0, 505, 3, 1, 0, 0, 652, 10, 2], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "__deepcopy__", "annotation": ""}, "snippet": " obj = super(F, self).__deepcopy__(memodict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L106_C8", "label": "obj.name =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "vector": [14, 2, 0.9381, 0.0088, 2, 0.63, 0.5, 708, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj.name = self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "vector": [13, 2, 0.9469, 0.0088, 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 obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L109_C4", "label": "prepare", "type": "function", "loc": [109, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "vector": [2, 1, 0.969, 0.0177, 1, 0.89, 0.75, 556, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "prepare", "arg_names": ["self", "evaluator", "query", "allow_joins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self, evaluator, query, allow_joins):\n return evaluator.prepare_leaf(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L110_C8", "label": "return", "type": "return", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L109_C4", "vector": [13, 2, 0.9735, 0.0088, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return evaluator.prepare_leaf(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L112_C4", "label": "evaluate", "type": "function", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "vector": [2, 1, 0.9956, 0.0177, 1, 0.89, 1.0, 528, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "evaluate", "arg_names": ["self", "evaluator", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def evaluate(self, evaluator, qn, connection):\n return evaluator.evaluate_leaf(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L113_C8", "label": "return", "type": "return", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L112_C4", "vector": [13, 2, 1.0, 0.0088, 2, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return evaluator.evaluate_leaf(self, qn, connection)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99009:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99009:Return_L113_C8"}] |
from django.core.exceptions import FieldError
from django.db import connections
from django.db.backends.util import truncate_name
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.query import get_proxied_model, get_order_dir, \
select_related_descend, Query
class SQLCompiler(object):
def __init__(self, query, connection, using):
self.query = query
self.connection = connection
self.using = using
self.quote_cache = {}
def pre_sql_setup(self):
"""
Does any necessary class setup immediately prior to producing SQL. This
is for things that can't necessarily be done in __init__ because we
might not have all the pieces in place at that time.
"""
if not self.query.tables:
self.query.join((None, self.query.model._meta.db_table, None, None))
if (not self.query.select and self.query.default_cols and not
self.query.included_inherited_models):
self.query.setup_inherited_models()
if self.query.select_related and not self.query.related_select_cols:
self.fill_related_selections()
def quote_name_unless_alias(self, name):
"""
A wrapper around connection.ops.quote_name that doesn't quote aliases
for table names. This avoids problems with some SQL dialects that treat
quoted strings specially (e.g. PostgreSQL).
"""
if name in self.quote_cache:
return self.quote_cache[name]
if ((name in self.query.alias_map and name not in self.query.table_map) or
name in self.query.extra_select):
self.quote_cache[name] = name
return name
r = self.connection.ops.quote_name(name)
self.quote_cache[name] = r
return r
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.
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 '', ()
self.pre_sql_setup()
out_cols = self.get_columns(with_col_aliases)
ordering, ordering_group_by = self.get_ordering()
# This must come after 'select' and 'ordering' -- see docstring of
# get_from_clause() for details.
from_, f_params = self.get_from_clause()
qn = self.quote_name_unless_alias
where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)
having, h_params = self.query.having.as_sql(qn=qn, connection=self.connection)
params = []
for val in self.query.extra_select.itervalues():
params.extend(val[1])
result = ['SELECT']
if self.query.distinct:
result.append('DISTINCT')
result.append(', '.join(out_cols + self.query.ordering_aliases))
result.append('FROM')
result.extend(from_)
params.extend(f_params)
if where:
result.append('WHERE %s' % where)
params.extend(w_params)
grouping, gb_params = self.get_grouping()
if grouping:
if ordering:
# If the backend can't group by PK (i.e., any database
# other than MySQL), then any fields mentioned in the
# ordering clause needs to be in the group by clause.
if not self.connection.features.allows_group_by_pk:
for col, col_params in ordering_group_by:
if col not in grouping:
grouping.append(str(col))
gb_params.extend(col_params)
else:
ordering = self.connection.ops.force_no_ordering()
result.append('GROUP BY %s' % ', '.join(grouping))
params.extend(gb_params)
if having:
result.append('HAVING %s' % having)
params.extend(h_params)
if ordering:
result.append('ORDER BY %s' % ', '.join(ordering))
if with_limits:
if self.query.high_mark is not None:
result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))
if self.query.low_mark:
if self.query.high_mark is None:
val = self.connection.ops.no_limit_value()
if val:
result.append('LIMIT %d' % val)
result.append('OFFSET %d' % self.query.low_mark)
return ' '.join(result), tuple(params)
def as_nested_sql(self):
"""
Perform the same functionality as the as_sql() method, returning an
SQL string and parameters. However, the alias prefixes are bumped
beforehand (in a copy -- the current query isn't changed), and any
ordering is removed if the query is unsliced.
Used when nesting this query inside another.
"""
obj = self.query.clone()
if obj.low_mark == 0 and obj.high_mark is None:
# If there is no slicing in use, then we can safely drop all ordering
obj.clear_ordering(True)
obj.bump_prefix()
return obj.get_compiler(connection=self.connection).as_sql()
def get_columns(self, with_aliases=False):
"""
Returns the list of columns to use in the select statement. If no
columns have been specified, returns all columns relating to fields in
the model.
If 'with_aliases' is true, any column names that are duplicated
(without the table names) are given unique aliases. This is needed in
some cases to avoid ambiguity with nested queries.
"""
qn = self.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
result = ['(%s) AS %s' % (col[0], qn2(alias)) for alias, col in self.query.extra_select.iteritems()]
aliases = set(self.query.extra_select.keys())
if with_aliases:
col_aliases = aliases.copy()
else:
col_aliases = set()
if self.query.select:
only_load = self.deferred_to_columns()
for col in self.query.select:
if isinstance(col, (list, tuple)):
alias, column = col
table = self.query.alias_map[alias][TABLE_NAME]
if table in only_load and col not in only_load[table]:
continue
r = '%s.%s' % (qn(alias), qn(column))
if with_aliases:
if col[1] in col_aliases:
c_alias = 'Col%d' % len(col_aliases)
result.append('%s AS %s' % (r, c_alias))
aliases.add(c_alias)
col_aliases.add(c_alias)
else:
result.append('%s AS %s' % (r, qn2(col[1])))
aliases.add(r)
col_aliases.add(col[1])
else:
result.append(r)
aliases.add(r)
col_aliases.add(col[1])
else:
result.append(col.as_sql(qn, self.connection))
if hasattr(col, 'alias'):
aliases.add(col.alias)
col_aliases.add(col.alias)
elif self.query.default_cols:
cols, new_aliases = self.get_default_columns(with_aliases,
col_aliases)
result.extend(cols)
aliases.update(new_aliases)
max_name_length = self.connection.ops.max_name_length()
result.extend([
'%s%s' % (
aggregate.as_sql(qn, self.connection),
alias is not None
and ' AS %s' % qn(truncate_name(alias, max_name_length))
or ''
)
for alias, aggregate in self.query.aggregate_select.items()
])
for table, col in self.query.related_select_cols:
r = '%s.%s' % (qn(table), qn(col))
if with_aliases and col in col_aliases:
c_alias = 'Col%d' % len(col_aliases)
result.append('%s AS %s' % (r, c_alias))
aliases.add(c_alias)
col_aliases.add(c_alias)
else:
result.append(r)
aliases.add(r)
col_aliases.add(col)
self._select_aliases = aliases
return result
def get_default_columns(self, with_aliases=False, col_aliases=None,
start_alias=None, opts=None, as_pairs=False, local_only=False):
"""
Computes the default columns for selecting every field in the base
model. Will sometimes be called to pull in related models (e.g. via
select_related), in which case "opts" and "start_alias" will be given
to provide a starting point for the traversal.
Returns a list of strings, quoted appropriately for use in SQL
directly, as well as a set of aliases used in the select statement (if
'as_pairs' is True, returns a list of (alias, col_name) pairs instead
of strings as the first component and None as the second component).
"""
result = []
if opts is None:
opts = self.query.model._meta
qn = self.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
aliases = set()
only_load = self.deferred_to_columns()
# Skip all proxy to the root proxied model
proxied_model = get_proxied_model(opts)
if start_alias:
seen = {None: start_alias}
for field, model in opts.get_fields_with_model():
if local_only and model is not None:
continue
if start_alias:
try:
alias = seen[model]
except KeyError:
if model is proxied_model:
alias = start_alias
else:
link_field = opts.get_ancestor_link(model)
alias = self.query.join((start_alias, model._meta.db_table,
link_field.column, model._meta.pk.column))
seen[model] = alias
else:
# If we're starting from the base model of the queryset, the
# aliases will have already been set up in pre_sql_setup(), so
# we can save time here.
alias = self.query.included_inherited_models[model]
table = self.query.alias_map[alias][TABLE_NAME]
if table in only_load and field.column not in only_load[table]:
continue
if as_pairs:
result.append((alias, field.column))
aliases.add(alias)
continue
if with_aliases and field.column in col_aliases:
c_alias = 'Col%d' % len(col_aliases)
result.append('%s.%s AS %s' % (qn(alias),
qn2(field.column), c_alias))
col_aliases.add(c_alias)
aliases.add(c_alias)
else:
r = '%s.%s' % (qn(alias), qn2(field.column))
result.append(r)
aliases.add(r)
if with_aliases:
col_aliases.add(field.column)
return result, aliases
def get_ordering(self):
"""
Returns a tuple containing a list representing the SQL elements in the
"order by" clause, and the list of SQL elements that need to be added
to the GROUP BY clause as a result of the ordering.
Also sets the ordering_aliases attribute on this instance to a list of
extra aliases needed in the select.
Determining the ordering SQL can change the tables we need to include,
so this should be run *before* get_from_clause().
"""
if self.query.extra_order_by:
ordering = self.query.extra_order_by
elif not self.query.default_ordering:
ordering = self.query.order_by
else:
ordering = self.query.order_by or self.query.model._meta.ordering
qn = self.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
distinct = self.query.distinct
select_aliases = self._select_aliases
result = []
group_by = []
ordering_aliases = []
if self.query.standard_ordering:
asc, desc = ORDER_DIR['ASC']
else:
asc, desc = ORDER_DIR['DESC']
# It's possible, due to model inheritance, that normal usage might try
# to include the same field more than once in the ordering. We track
# the table/column pairs we use and discard any after the first use.
processed_pairs = set()
for field in ordering:
if field == '?':
result.append(self.connection.ops.random_function_sql())
continue
if isinstance(field, int):
if field < 0:
order = desc
field = -field
else:
order = asc
result.append('%s %s' % (field, order))
group_by.append((field, []))
continue
col, order = get_order_dir(field, asc)
if col in self.query.aggregate_select:
result.append('%s %s' % (col, order))
continue
if '.' in field:
# This came in through an extra(order_by=...) addition. Pass it
# on verbatim.
table, col = col.split('.', 1)
if (table, col) not in processed_pairs:
elt = '%s.%s' % (qn(table), col)
processed_pairs.add((table, col))
if not distinct or elt in select_aliases:
result.append('%s %s' % (elt, order))
group_by.append((elt, []))
elif get_order_dir(field)[0] not in self.query.extra_select:
# 'col' is of the form 'field' or 'field1__field2' or
# '-field1__field2__field', etc.
for table, col, order in self.find_ordering_name(field,
self.query.model._meta, default_order=asc):
if (table, col) not in processed_pairs:
elt = '%s.%s' % (qn(table), qn2(col))
processed_pairs.add((table, col))
if distinct and elt not in select_aliases:
ordering_aliases.append(elt)
result.append('%s %s' % (elt, order))
group_by.append((elt, []))
else:
elt = qn2(col)
if distinct and col not in select_aliases:
ordering_aliases.append(elt)
result.append('%s %s' % (elt, order))
group_by.append(self.query.extra_select[col])
self.query.ordering_aliases = ordering_aliases
return result, group_by
def find_ordering_name(self, name, opts, alias=None, default_order='ASC',
already_seen=None):
"""
Returns the table alias (the name might be ambiguous, the alias will
not be) and column name for ordering by the given 'name' parameter.
The 'name' is of the form 'field1__field2__...__fieldN'.
"""
name, order = get_order_dir(name, default_order)
pieces = name.split(LOOKUP_SEP)
if not alias:
alias = self.query.get_initial_alias()
field, target, opts, joins, last, extra = self.query.setup_joins(pieces,
opts, alias, False)
alias = joins[-1]
col = target.column
if not field.rel:
# To avoid inadvertent trimming of a necessary alias, use the
# refcount to show that we are referencing a non-relation field on
# the model.
self.query.ref_alias(alias)
# Must use left outer joins for nullable fields and their relations.
self.query.promote_alias_chain(joins,
self.query.alias_map[joins[0]][JOIN_TYPE] == self.query.LOUTER)
# If we get to this point and the field is a relation to another model,
# append the default ordering for that model.
if field.rel and len(joins) > 1 and opts.ordering:
# Firstly, avoid infinite loops.
if not already_seen:
already_seen = set()
join_tuple = tuple([self.query.alias_map[j][TABLE_NAME] for j in joins])
if join_tuple in already_seen:
raise FieldError('Infinite loop caused by ordering.')
already_seen.add(join_tuple)
results = []
for item in opts.ordering:
results.extend(self.find_ordering_name(item, opts, alias,
order, already_seen))
return results
if alias:
# We have to do the same "final join" optimisation as in
# add_filter, since the final column might not otherwise be part of
# the select set (so we can't order on it).
while 1:
join = self.query.alias_map[alias]
if col != join[RHS_JOIN_COL]:
break
self.query.unref_alias(alias)
alias = join[LHS_ALIAS]
col = join[LHS_JOIN_COL]
return [(alias, col, order)]
def get_from_clause(self):
"""
Returns a list of strings that are joined together to go after the
"FROM" part of the query, as well as a list any extra parameters that
need to be included. Sub-classes, can override this to create a
from-clause via a "select".
This should only be called after any SQL construction methods that
might change the tables we need. This means the select columns and
ordering must be done first.
"""
result = []
qn = self.quote_name_unless_alias
qn2 = self.connection.ops.quote_name
first = True
for alias in self.query.tables:
if not self.query.alias_refcount[alias]:
continue
try:
name, alias, join_type, lhs, lhs_col, col, nullable = self.query.alias_map[alias]
except KeyError:
# Extra tables can end up in self.tables, but not in the
# alias_map if they aren't in a join. That's OK. We skip them.
continue
alias_str = (alias != name and ' %s' % alias or '')
if join_type and not first:
result.append('%s %s%s ON (%s.%s = %s.%s)'
% (join_type, qn(name), alias_str, qn(lhs),
qn2(lhs_col), qn(alias), qn2(col)))
else:
connector = not first and ', ' or ''
result.append('%s%s%s' % (connector, qn(name), alias_str))
first = False
for t in self.query.extra_tables:
alias, unused = self.query.table_alias(t)
# Only add the alias if it's not already present (the table_alias()
# calls increments the refcount, so an alias refcount of one means
# this is the only reference.
if alias not in self.query.alias_map or self.query.alias_refcount[alias] == 1:
connector = not first and ', ' or ''
result.append('%s%s' % (connector, qn(alias)))
first = False
return result, []
def get_grouping(self):
"""
Returns a tuple representing the SQL elements in the "group by" clause.
"""
qn = self.quote_name_unless_alias
result, params = [], []
if self.query.group_by is not None:
if len(self.query.model._meta.fields) == len(self.query.select) and \
self.connection.features.allows_group_by_pk:
self.query.group_by = [(self.query.model._meta.db_table, self.query.model._meta.pk.column)]
group_by = self.query.group_by or []
extra_selects = []
for extra_select, extra_params in self.query.extra_select.itervalues():
extra_selects.append(extra_select)
params.extend(extra_params)
for col in group_by + self.query.related_select_cols + extra_selects:
if isinstance(col, (list, tuple)):
result.append('%s.%s' % (qn(col[0]), qn(col[1])))
elif hasattr(col, 'as_sql'):
result.append(col.as_sql(qn))
else:
result.append('(%s)' % str(col))
return result, params
def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1,
used=None, requested=None, restricted=None, nullable=None,
dupe_set=None, avoid_set=None):
"""
Fill in the information needed for a select_related query. The current
depth is measured as the number of connections away from the root model
(for example, cur_depth=1 means we are looking at models with direct
connections to the root model).
"""
if not restricted and self.query.max_depth and cur_depth > self.query.max_depth:
# We've recursed far enough; bail out.
return
if not opts:
opts = self.query.get_meta()
root_alias = self.query.get_initial_alias()
self.query.related_select_cols = []
self.query.related_select_fields = []
if not used:
used = set()
if dupe_set is None:
dupe_set = set()
if avoid_set is None:
avoid_set = set()
orig_dupe_set = dupe_set
# Setup for the case when only particular related fields should be
# included in the related selection.
if requested is None:
if isinstance(self.query.select_related, dict):
requested = self.query.select_related
restricted = True
else:
restricted = False
for f, model in opts.get_fields_with_model():
if not select_related_descend(f, restricted, requested):
continue
# The "avoid" set is aliases we want to avoid just for this
# particular branch of the recursion. They aren't permanently
# forbidden from reuse in the related selection tables (which is
# what "used" specifies).
avoid = avoid_set.copy()
dupe_set = orig_dupe_set.copy()
table = f.rel.to._meta.db_table
promote = nullable or f.null
if model:
int_opts = opts
alias = root_alias
alias_chain = []
for int_model in opts.get_base_chain(model):
# Proxy model have elements in base chain
# with no parents, assign the new options
# object and skip to the next base in that
# case
if not int_opts.parents[int_model]:
int_opts = int_model._meta
continue
lhs_col = int_opts.parents[int_model].column
dedupe = lhs_col in opts.duplicate_targets
if dedupe:
avoid.update(self.query.dupe_avoidance.get((id(opts), lhs_col),
()))
dupe_set.add((opts, lhs_col))
int_opts = int_model._meta
alias = self.query.join((alias, int_opts.db_table, lhs_col,
int_opts.pk.column), exclusions=used,
promote=promote)
alias_chain.append(alias)
for (dupe_opts, dupe_col) in dupe_set:
self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)
if self.query.alias_map[root_alias][JOIN_TYPE] == self.query.LOUTER:
self.query.promote_alias_chain(alias_chain, True)
else:
alias = root_alias
dedupe = f.column in opts.duplicate_targets
if dupe_set or dedupe:
avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))
if dedupe:
dupe_set.add((opts, f.column))
alias = self.query.join((alias, table, f.column,
f.rel.get_related_field().column),
exclusions=used.union(avoid), promote=promote)
used.add(alias)
columns, aliases = self.get_default_columns(start_alias=alias,
opts=f.rel.to._meta, as_pairs=True)
self.query.related_select_cols.extend(columns)
if self.query.alias_map[alias][JOIN_TYPE] == self.query.LOUTER:
self.query.promote_alias_chain(aliases, True)
self.query.related_select_fields.extend(f.rel.to._meta.fields)
if restricted:
next = requested.get(f.name, {})
else:
next = False
new_nullable = f.null or promote
for dupe_opts, dupe_col in dupe_set:
self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)
self.fill_related_selections(f.rel.to._meta, alias, cur_depth + 1,
used, next, restricted, new_nullable, dupe_set, avoid)
if restricted:
related_fields = [
(o.field, o.model)
for o in opts.get_all_related_objects()
if o.field.unique
]
for f, model in related_fields:
if not select_related_descend(f, restricted, requested, reverse=True):
continue
# The "avoid" set is aliases we want to avoid just for this
# particular branch of the recursion. They aren't permanently
# forbidden from reuse in the related selection tables (which is
# what "used" specifies).
avoid = avoid_set.copy()
dupe_set = orig_dupe_set.copy()
table = model._meta.db_table
int_opts = opts
alias = root_alias
alias_chain = []
chain = opts.get_base_chain(f.rel.to)
if chain is not None:
for int_model in chain:
# Proxy model have elements in base chain
# with no parents, assign the new options
# object and skip to the next base in that
# case
if not int_opts.parents[int_model]:
int_opts = int_model._meta
continue
lhs_col = int_opts.parents[int_model].column
dedupe = lhs_col in opts.duplicate_targets
if dedupe:
avoid.update((self.query.dupe_avoidance.get(id(opts), lhs_col),
()))
dupe_set.add((opts, lhs_col))
int_opts = int_model._meta
alias = self.query.join(
(alias, int_opts.db_table, lhs_col, int_opts.pk.column),
exclusions=used, promote=True, reuse=used
)
alias_chain.append(alias)
for dupe_opts, dupe_col in dupe_set:
self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)
dedupe = f.column in opts.duplicate_targets
if dupe_set or dedupe:
avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))
if dedupe:
dupe_set.add((opts, f.column))
alias = self.query.join(
(alias, table, f.rel.get_related_field().column, f.column),
exclusions=used.union(avoid),
promote=True
)
used.add(alias)
columns, aliases = self.get_default_columns(start_alias=alias,
opts=model._meta, as_pairs=True, local_only=True)
self.query.related_select_cols.extend(columns)
self.query.related_select_fields.extend(model._meta.fields)
next = requested.get(f.related_query_name(), {})
new_nullable = f.null or None
self.fill_related_selections(model._meta, table, cur_depth+1,
used, next, restricted, new_nullable)
def deferred_to_columns(self):
"""
Converts the self.deferred_loading data structure to mapping of table
names to sets of column names which are to be loaded. Returns the
dictionary.
"""
columns = {}
self.query.deferred_to_data(columns, self.query.deferred_to_columns_cb)
return columns
def results_iter(self):
"""
Returns an iterator over the results from executing this query.
"""
resolve_columns = hasattr(self, 'resolve_columns')
fields = None
for rows in self.execute_sql(MULTI):
for row in rows:
if resolve_columns:
if fields is None:
# We only set this up here because
# related_select_fields isn't populated until
# execute_sql() has been called.
if self.query.select_fields:
fields = self.query.select_fields + self.query.related_select_fields
else:
fields = self.query.model._meta.fields
# If the field was deferred, exclude it from being passed
# into `resolve_columns` because it wasn't selected.
only_load = self.deferred_to_columns()
if only_load:
db_table = self.query.model._meta.db_table
fields = [f for f in fields if db_table in only_load and
f.column in only_load[db_table]]
row = self.resolve_columns(row, fields)
if self.query.aggregate_select:
aggregate_start = len(self.query.extra_select.keys()) + len(self.query.select)
aggregate_end = aggregate_start + len(self.query.aggregate_select)
row = tuple(row[:aggregate_start]) + tuple([
self.query.resolve_aggregate(value, aggregate, self.connection)
for (alias, aggregate), value
in zip(self.query.aggregate_select.items(), row[aggregate_start:aggregate_end])
]) + tuple(row[aggregate_end:])
yield row
def has_results(self):
# This is always executed on a query clone, so we can modify self.query
self.query.add_extra({'a': 1}, None, None, None, None, None)
self.query.set_extra_mask(('a',))
return bool(self.execute_sql(SINGLE))
def execute_sql(self, result_type=MULTI):
"""
Run the query against the database and returns the result(s). The
return value is a single data item if result_type is SINGLE, or an
iterator over the results if the result_type is MULTI.
result_type is either MULTI (use fetchmany() to retrieve all rows),
SINGLE (only retrieve a single row), or None. In this last case, the
cursor is returned if any query is executed, since it's used by
subclasses such as InsertQuery). It's possible, however, that no query
is needed, as the filters describe an empty set. In that case, None is
returned, to avoid any unnecessary database interaction.
"""
try:
sql, params = self.as_sql()
if not sql:
raise EmptyResultSet
except EmptyResultSet:
if result_type == MULTI:
return empty_iter()
else:
return
cursor = self.connection.cursor()
cursor.execute(sql, params)
if not result_type:
return cursor
if result_type == SINGLE:
if self.query.ordering_aliases:
return cursor.fetchone()[:-len(self.query.ordering_aliases)]
return cursor.fetchone()
# The MULTI case.
if self.query.ordering_aliases:
result = order_modified_iter(cursor, len(self.query.ordering_aliases),
self.connection.features.empty_fetchmany_value)
else:
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
self.connection.features.empty_fetchmany_value)
if not self.connection.features.can_use_chunked_reads:
# If we are using non-chunked reads, we return the same data
# structure as normally, but ensure it is all read into memory
# before going any further.
return list(result)
return result
class SQLInsertCompiler(SQLCompiler):
def placeholder(self, field, val):
if field is None:
# A field value of None means the value is raw.
return val
elif hasattr(field, 'get_placeholder'):
# Some fields (e.g. geo fields) need special munging before
# they can be inserted.
return field.get_placeholder(val, self.connection)
else:
# Return the common case for the placeholder
return '%s'
def as_sql(self):
# We don't need quote_name_unless_alias() here, since these are all
# going to be column names (so we can avoid the extra overhead).
qn = self.connection.ops.quote_name
opts = self.query.model._meta
result = ['INSERT INTO %s' % qn(opts.db_table)]
result.append('(%s)' % ', '.join([qn(c) for c in self.query.columns]))
values = [self.placeholder(*v) for v in self.query.values]
result.append('VALUES (%s)' % ', '.join(values))
params = self.query.params
if self.return_id and self.connection.features.can_return_id_from_insert:
col = "%s.%s" % (qn(opts.db_table), qn(opts.pk.column))
r_fmt, r_params = self.connection.ops.return_insert_id()
result.append(r_fmt % col)
params = params + r_params
return ' '.join(result), params
def execute_sql(self, return_id=False):
self.return_id = return_id
cursor = super(SQLInsertCompiler, self).execute_sql(None)
if not (return_id and cursor):
return
if self.connection.features.can_return_id_from_insert:
return self.connection.ops.fetch_returned_insert_id(cursor)
return self.connection.ops.last_insert_id(cursor,
self.query.model._meta.db_table, self.query.model._meta.pk.column)
class SQLDeleteCompiler(SQLCompiler):
def as_sql(self):
"""
Creates the SQL for this query. Returns the SQL string and list of
parameters.
"""
assert len(self.query.tables) == 1, \
"Can only delete from one table at a time."
qn = self.quote_name_unless_alias
result = ['DELETE FROM %s' % qn(self.query.tables[0])]
where, params = self.query.where.as_sql(qn=qn, connection=self.connection)
result.append('WHERE %s' % where)
return ' '.join(result), tuple(params)
class SQLUpdateCompiler(SQLCompiler):
def as_sql(self):
"""
Creates the SQL for this query. Returns the SQL string and list of
parameters.
"""
from django.db.models.base import Model
self.pre_sql_setup()
if not self.query.values:
return '', ()
table = self.query.tables[0]
qn = self.quote_name_unless_alias
result = ['UPDATE %s' % qn(table)]
result.append('SET')
values, update_params = [], []
for field, model, val in self.query.values:
if hasattr(val, 'prepare_database_save'):
val = val.prepare_database_save(field)
else:
val = field.get_db_prep_save(val, connection=self.connection)
# Getting the placeholder for the field.
if hasattr(field, 'get_placeholder'):
placeholder = field.get_placeholder(val, self.connection)
else:
placeholder = '%s'
if hasattr(val, 'evaluate'):
val = SQLEvaluator(val, self.query, allow_joins=False)
name = field.column
if hasattr(val, 'as_sql'):
sql, params = val.as_sql(qn, self.connection)
values.append('%s = %s' % (qn(name), sql))
update_params.extend(params)
elif val is not None:
values.append('%s = %s' % (qn(name), placeholder))
update_params.append(val)
else:
values.append('%s = NULL' % qn(name))
if not values:
return '', ()
result.append(', '.join(values))
where, params = self.query.where.as_sql(qn=qn, connection=self.connection)
if where:
result.append('WHERE %s' % where)
return ' '.join(result), tuple(update_params + params)
def execute_sql(self, result_type):
"""
Execute the specified update. Returns the number of rows affected by
the primary update query. The "primary update query" is the first
non-empty query that is executed. Row counts for any subsequent,
related queries are not available.
"""
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
rows = cursor and cursor.rowcount or 0
is_empty = cursor is None
del cursor
for query in self.query.get_related_updates():
aux_rows = query.get_compiler(self.using).execute_sql(result_type)
if is_empty:
rows = aux_rows
is_empty = False
return rows
def pre_sql_setup(self):
"""
If the update depends on results from other tables, we need to do some
munging of the "where" conditions to match the format required for
(portable) SQL updates. That is done here.
Further, if we are going to be running multiple updates, we pull out
the id values to update at this point so that they don't change as a
result of the progressive updates.
"""
self.query.select_related = False
self.query.clear_ordering(True)
super(SQLUpdateCompiler, self).pre_sql_setup()
count = self.query.count_active_tables()
if not self.query.related_updates and count == 1:
return
# We need to use a sub-select in the where clause to filter on things
# from other tables.
query = self.query.clone(klass=Query)
query.bump_prefix()
query.extra = {}
query.select = []
query.add_fields([query.model._meta.pk.name])
must_pre_select = count > 1 and not self.connection.features.update_can_self_select
# Now we adjust the current query: reset the where clause and get rid
# of all the tables we don't need (since they're in the sub-select).
self.query.where = self.query.where_class()
if self.query.related_updates or must_pre_select:
# Either we're using the idents in multiple update queries (so
# don't want them to change), or the db backend doesn't support
# selecting from the updating table (e.g. MySQL).
idents = []
for rows in query.get_compiler(self.using).execute_sql(MULTI):
idents.extend([r[0] for r in rows])
self.query.add_filter(('pk__in', idents))
self.query.related_ids = idents
else:
# The fast path. Filters and updates in one query.
self.query.add_filter(('pk__in', query))
for alias in self.query.tables[1:]:
self.query.alias_refcount[alias] = 0
class SQLAggregateCompiler(SQLCompiler):
def as_sql(self, qn=None):
"""
Creates the SQL for this query. Returns the SQL string and list of
parameters.
"""
if qn is None:
qn = self.quote_name_unless_alias
sql = ('SELECT %s FROM (%s) subquery' % (
', '.join([
aggregate.as_sql(qn, self.connection)
for aggregate in self.query.aggregate_select.values()
]),
self.query.subquery)
)
params = self.query.sub_params
return (sql, params)
class SQLDateCompiler(SQLCompiler):
def results_iter(self):
"""
Returns an iterator over the results from executing this query.
"""
resolve_columns = hasattr(self, 'resolve_columns')
if resolve_columns:
from django.db.models.fields import DateTimeField
fields = [DateTimeField()]
else:
from django.db.backends.util import typecast_timestamp
needs_string_cast = self.connection.features.needs_datetime_string_cast
offset = len(self.query.extra_select)
for rows in self.execute_sql(MULTI):
for row in rows:
date = row[offset]
if resolve_columns:
date = self.resolve_columns(row, fields)[offset]
elif needs_string_cast:
date = typecast_timestamp(str(date))
yield date
def empty_iter():
"""
Returns an iterator containing no results.
"""
yield iter([]).next()
def order_modified_iter(cursor, trim, sentinel):
"""
Yields blocks of rows from a cursor. We use this iterator in the special
case when extra output columns have been added to support ordering
requirements. We must trim those extra columns before anything else can use
the results, since they're only needed to make the SQL valid.
"""
for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
sentinel):
yield [r[:-trim] for r in rows]
| ajibawa-2023/Python-Code-Large/train/row_99011 | 603 | 983 | 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_99011:ImportFrom_L1_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.001, 0.001, 0, 0.66, 0.0, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["FieldError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import FieldError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L2_C0", "label": "from django.db import connections", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.001, 0, 0.66, 0.0714, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connections"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L3_C0", "label": "from django.db.backends.util import truncate_name", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0031, 0.001, 0, 0.66, 0.1429, 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_99011:ImportFrom_L4_C0", "label": "from django.db.models.sql.constants import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.001, 0, 0.66, 0.2143, 971, 0, 1, 0, 0, 971, 0, 0], "semantic": {"name": "django.db.models.sql.constants", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.constants import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L5_C0", "label": "from django.db.models.sql.datastructures import EmptyResultSet", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0051, 0.001, 0, 0.66, 0.2857, 945, 0, 1, 0, 0, 945, 0, 0], "semantic": {"name": "django.db.models.sql.datastructures", "arg_names": [], "import_names": ["EmptyResultSet"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.datastructures import EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L6_C0", "label": "from django.db.models.sql.expressions import SQLEvaluator", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0061, 0.001, 0, 0.66, 0.3571, 438, 0, 1, 0, 0, 438, 0, 0], "semantic": {"name": "django.db.models.sql.expressions", "arg_names": [], "import_names": ["SQLEvaluator"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.expressions import SQLEvaluator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L7_C0", "label": "from django.db.models.sql.query import get_proxied_model, get_order_dir, select_related_descend\u2026", "type": "import", "loc": [7, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.002, 0, 0.66, 0.4286, 656, 0, 4, 0, 0, 656, 0, 0], "semantic": {"name": "django.db.models.sql.query", "arg_names": [], "import_names": ["get_proxied_model", "get_order_dir", "select_related_descend", "Query"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.query import get_proxied_model, get_order_dir, \\\n select_related_descend, Query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "label": "SQLCompiler", "type": "class", "loc": [10, 757], "level": 0, "parent": null, "vector": [3, 0, 0.3901, 0.7609, 0, 0.66, 0.5, 718, 0, 16, 0, 0, 186, 0, 99], "semantic": {"name": "SQLCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLCompiler(object):\n def __init__(self, query, connection, using):\n self.query = query\n self.connection = connection\n self.using = using\n self.quote_cache = {}\n\n def pre_sql_setup(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "label": "__init__", "type": "function", "loc": [11, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.0132, 0.0051, 1, 0.24, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "query", "connection", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, query, connection, using):\n self.query = query\n self.connection = connection\n self.using = using\n self.quote_cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L12_C8", "label": "self.query =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "vector": [14, 2, 0.0122, 0.001, 2, 0.25, 0.0, 241, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query = query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L13_C8", "label": "self.connection =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "vector": [14, 2, 0.0132, 0.001, 2, 0.25, 0.3333, 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_99011:Assign_L14_C8", "label": "self.using =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "vector": [14, 2, 0.0142, 0.001, 2, 0.25, 0.6667, 734, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.using = using"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L15_C8", "label": "self.quote_cache =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "vector": [14, 2, 0.0153, 0.001, 2, 0.25, 1.0, 836, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.quote_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.quote_cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "label": "pre_sql_setup", "type": "function", "loc": [17, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.0234, 0.0132, 1, 0.24, 0.0667, 451, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "pre_sql_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pre_sql_setup(self):\n \"\"\"\n Does any necessary class setup immediately prior to producing SQL. This\n is for things that can't necessarily be done in __init__ because we\n might not have all the pieces in place at that time.\n \"\"\"\n if not self.query.tables:\n self.query.join((None, self.query.model._meta.db_table, None, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L18_C8", "label": "expression", "type": "expression", "loc": [18, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "vector": [8, 2, 0.0203, 0.0051, 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 Does any necessary class setup immediately prior to producing SQL. This\n is for things that can't necessarily be done in __init__ because we\n might not have all the pieces in place at that time.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L23_C8", "label": "if", "type": "if", "loc": [23, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "vector": [4, 2, 0.0239, 0.002, 2, 0.47, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.query.tables:\n self.query.join((None, self.query.model._meta.db_table, None, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L24_C12", "label": "join()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L23_C8", "vector": [8, 3, 0.0244, 0.001, 3, 0.9, 0.0, 933, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.query.join((None, self.query.model._meta.db_table, None, None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L25_C8", "label": "if", "type": "if", "loc": [25, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "vector": [4, 2, 0.0264, 0.0031, 2, 0.47, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not self.query.select and self.query.default_cols and not\n self.query.included_inherited_models):\n self.query.setup_inherited_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L27_C12", "label": "setup_inherited_models()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L25_C8", "vector": [8, 3, 0.0275, 0.001, 3, 0.19, 0.0, 348, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "setup_inherited_models", "arg_names": [], "import_names": [], "rhs_call_name": "setup_inherited_models", "annotation": ""}, "snippet": " self.query.setup_inherited_models()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L28_C8", "label": "if", "type": "if", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "vector": [4, 2, 0.029, 0.002, 2, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.select_related and not self.query.related_select_cols:\n self.fill_related_selections()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L29_C12", "label": "fill_related_selections()", "type": "expression", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L28_C8", "vector": [8, 3, 0.0295, 0.001, 3, 0.55, 0.0, 684, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fill_related_selections", "arg_names": [], "import_names": [], "rhs_call_name": "fill_related_selections", "annotation": ""}, "snippet": " self.fill_related_selections()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "label": "quote_name_unless_alias", "type": "function", "loc": [31, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.0387, 0.0153, 1, 0.24, 0.1333, 359, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "quote_name_unless_alias", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def quote_name_unless_alias(self, name):\n \"\"\"\n A wrapper around connection.ops.quote_name that doesn't quote aliases\n for table names. This avoids problems with some SQL dialects that treat\n quoted strings specially (e.g. PostgreSQL).\n \"\"\"\n if name in self.quote_cache:\n return self.quote_cache[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L32_C8", "label": "expression", "type": "expression", "loc": [32, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [8, 2, 0.0346, 0.0051, 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 A wrapper around connection.ops.quote_name that doesn't quote aliases\n for table names. This avoids problems with some SQL dialects that treat\n quoted strings specially (e.g. PostgreSQL).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [4, 2, 0.0381, 0.002, 2, 0.25, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in self.quote_cache:\n return self.quote_cache[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L38_C12", "label": "return", "type": "return", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L37_C8", "vector": [13, 3, 0.0387, 0.001, 3, 0.73, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.quote_cache[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8", "label": "if", "type": "if", "loc": [39, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [4, 2, 0.0412, 0.0041, 2, 0.25, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ((name in self.query.alias_map and name not in self.query.table_map) or\n name in self.query.extra_select):\n self.quote_cache[name] = name\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L41_C12", "label": "assign", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8", "vector": [14, 3, 0.0417, 0.001, 3, 0.3, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.quote_cache[name] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L42_C12", "label": "return", "type": "return", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8", "vector": [13, 3, 0.0427, 0.001, 3, 0.3, 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_99011:Assign_L43_C8", "label": "r = quote_name()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [14, 2, 0.0437, 0.001, 2, 0.25, 0.6, 436, 3, 1, 0, 0, 116, 10, 1], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "quote_name", "annotation": ""}, "snippet": " r = self.connection.ops.quote_name(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L44_C8", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [14, 2, 0.0448, 0.001, 2, 0.25, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.quote_cache[name] = r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L45_C8", "label": "return", "type": "return", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "vector": [13, 2, 0.0458, 0.001, 2, 0.25, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return r"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "label": "as_sql", "type": "function", "loc": [47, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.0849, 0.0753, 1, 0.24, 0.2, 122, 0, 3, 1, 0, 0, 0, 34], "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 of\n parameters.\n\n If 'with_limits' is False, any limit/offset information is not included\n in the query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L48_C8", "label": "expression", "type": "expression", "loc": [48, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.0519, 0.0071, 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 Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n\n If 'with_limits' is False, any limit/offset information is not included\n in the query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L55_C8", "label": "if", "type": "if", "loc": [55, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.0565, 0.002, 2, 0.72, 0.0435, 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_99011:Return_L56_C12", "label": "return", "type": "return", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L55_C8", "vector": [13, 3, 0.057, 0.001, 3, 0.23, 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_99011:Expr_L58_C8", "label": "pre_sql_setup()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.059, 0.001, 2, 0.72, 0.087, 451, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pre_sql_setup", "arg_names": [], "import_names": [], "rhs_call_name": "pre_sql_setup", "annotation": ""}, "snippet": " self.pre_sql_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L59_C8", "label": "out_cols = get_columns()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.06, 0.001, 2, 0.72, 0.1304, 17, 3, 1, 0, 0, 636, 10, 1], "semantic": {"name": "out_cols", "arg_names": [], "import_names": [], "rhs_call_name": "get_columns", "annotation": ""}, "snippet": " out_cols = self.get_columns(with_col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L60_C8", "label": "ordering, ordering_group_by = get_ordering()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.061, 0.001, 2, 0.72, 0.1739, 175, 3, 0, 0, 0, 452, 10, 1], "semantic": {"name": "ordering, ordering_group_by", "arg_names": [], "import_names": [], "rhs_call_name": "get_ordering", "annotation": ""}, "snippet": " ordering, ordering_group_by = self.get_ordering()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L64_C8", "label": "from_, f_params = get_from_clause()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0651, 0.001, 2, 0.72, 0.2174, 750, 3, 0, 0, 0, 318, 10, 1], "semantic": {"name": "from_, f_params", "arg_names": [], "import_names": [], "rhs_call_name": "get_from_clause", "annotation": ""}, "snippet": " from_, f_params = self.get_from_clause()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L66_C8", "label": "qn =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0671, 0.001, 2, 0.72, 0.2609, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L68_C8", "label": "where, w_params = as_sql()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0692, 0.001, 2, 0.72, 0.3043, 346, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "where, w_params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L69_C8", "label": "having, h_params = as_sql()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0702, 0.001, 2, 0.72, 0.3478, 950, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "having, h_params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " having, h_params = self.query.having.as_sql(qn=qn, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L70_C8", "label": "params =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0712, 0.001, 2, 0.72, 0.3913, 206, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L71_C8", "label": "for val", "type": "for", "loc": [71, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [6, 2, 0.0727, 0.002, 2, 0.72, 0.4348, 618, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for val in self.query.extra_select.itervalues():\n params.extend(val[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L72_C12", "label": "extend()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L71_C8", "vector": [8, 3, 0.0732, 0.001, 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": " params.extend(val[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L74_C8", "label": "result =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0753, 0.001, 2, 0.72, 0.4783, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = ['SELECT']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.0768, 0.002, 2, 0.72, 0.5217, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.distinct:\n result.append('DISTINCT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L76_C12", "label": "append()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L75_C8", "vector": [8, 3, 0.0773, 0.001, 3, 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": " result.append('DISTINCT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L77_C8", "label": "append()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.0783, 0.001, 2, 0.72, 0.5652, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(', '.join(out_cols + self.query.ordering_aliases))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L79_C8", "label": "append()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.0804, 0.001, 2, 0.72, 0.6087, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('FROM')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L80_C8", "label": "extend()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.0814, 0.001, 2, 0.72, 0.6522, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " result.extend(from_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L81_C8", "label": "extend()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [8, 2, 0.0824, 0.001, 2, 0.72, 0.6957, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " params.extend(f_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8", "label": "if", "type": "if", "loc": [83, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.0855, 0.0031, 2, 0.72, 0.7391, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if where:\n result.append('WHERE %s' % where)\n params.extend(w_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L84_C12", "label": "append()", "type": "expression", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8", "vector": [8, 3, 0.0855, 0.001, 3, 0.57, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('WHERE %s' % where)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L85_C12", "label": "extend()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8", "vector": [8, 3, 0.0865, 0.001, 3, 0.57, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " params.extend(w_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L87_C8", "label": "grouping, gb_params = get_grouping()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [14, 2, 0.0885, 0.001, 2, 0.72, 0.7826, 161, 3, 0, 0, 0, 944, 10, 1], "semantic": {"name": "grouping, gb_params", "arg_names": [], "import_names": [], "rhs_call_name": "get_grouping", "annotation": ""}, "snippet": " grouping, gb_params = self.get_grouping()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "label": "if", "type": "if", "loc": [88, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.0961, 0.0142, 2, 0.72, 0.8261, 0, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if grouping:\n if ordering:\n # If the backend can't group by PK (i.e., any database\n # other than MySQL), then any fields mentioned in the\n # ordering clause needs to be in the group by clause.\n if not self.connection.features.allows_group_by_pk:\n for col, col_params in ordering_group_by:\n if col not in grouping:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12", "label": "if", "type": "if", "loc": [89, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "vector": [4, 3, 0.0956, 0.0112, 3, 0.76, 0.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ordering:\n # If the backend can't group by PK (i.e., any database\n # other than MySQL), then any fields mentioned in the\n # ordering clause needs to be in the group by clause.\n if not self.connection.features.allows_group_by_pk:\n for col, col_params in ordering_group_by:\n if col not in grouping:\n grouping.append(str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L93_C16", "label": "if", "type": "if", "loc": [93, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12", "vector": [4, 4, 0.0966, 0.0051, 4, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.connection.features.allows_group_by_pk:\n for col, col_params in ordering_group_by:\n if col not in grouping:\n grouping.append(str(col))\n gb_params.extend(col_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L94_C20", "label": "for col, col_params", "type": "for", "loc": [94, 97], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L93_C16", "vector": [6, 5, 0.0972, 0.0041, 5, 0.97, 0.0, 496, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "col, col_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for col, col_params in ordering_group_by:\n if col not in grouping:\n grouping.append(str(col))\n gb_params.extend(col_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24", "label": "if", "type": "if", "loc": [95, 97], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L94_C20", "vector": [4, 6, 0.0977, 0.0031, 6, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col not in grouping:\n grouping.append(str(col))\n gb_params.extend(col_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L96_C28", "label": "append()", "type": "expression", "loc": [96, 96], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24", "vector": [8, 7, 0.0977, 0.001, 7, 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": " grouping.append(str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L97_C28", "label": "extend()", "type": "expression", "loc": [97, 97], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24", "vector": [8, 7, 0.0987, 0.001, 7, 0.4, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " gb_params.extend(col_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L99_C16", "label": "ordering = force_no_ordering()", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12", "vector": [14, 4, 0.1007, 0.001, 4, 0.39, 1.0, 656, 3, 0, 0, 0, 947, 10, 1], "semantic": {"name": "ordering", "arg_names": [], "import_names": [], "rhs_call_name": "force_no_ordering", "annotation": ""}, "snippet": " ordering = self.connection.ops.force_no_ordering()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L100_C12", "label": "append()", "type": "expression", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "vector": [8, 3, 0.1017, 0.001, 3, 0.76, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('GROUP BY %s' % ', '.join(grouping))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L101_C12", "label": "extend()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "vector": [8, 3, 0.1027, 0.001, 3, 0.76, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " params.extend(gb_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8", "label": "if", "type": "if", "loc": [103, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.1058, 0.0031, 2, 0.72, 0.8696, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if having:\n result.append('HAVING %s' % having)\n params.extend(h_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L104_C12", "label": "append()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8", "vector": [8, 3, 0.1058, 0.001, 3, 0.3, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('HAVING %s' % having)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L105_C12", "label": "extend()", "type": "expression", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8", "vector": [8, 3, 0.1068, 0.001, 3, 0.3, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " params.extend(h_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L107_C8", "label": "if", "type": "if", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.1094, 0.002, 2, 0.72, 0.913, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ordering:\n result.append('ORDER BY %s' % ', '.join(ordering))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L108_C12", "label": "append()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L107_C8", "vector": [8, 3, 0.1099, 0.001, 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": " result.append('ORDER BY %s' % ', '.join(ordering))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8", "label": "if", "type": "if", "loc": [110, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [4, 2, 0.116, 0.0092, 2, 0.72, 0.9565, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_limits:\n if self.query.high_mark is not None:\n result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))\n if self.query.low_mark:\n if self.query.high_mark is None:\n val = self.connection.ops.no_limit_value()\n if val:\n result.append('LIMIT %d' % val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L111_C12", "label": "if", "type": "if", "loc": [111, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8", "vector": [4, 3, 0.1134, 0.002, 3, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.high_mark is not None:\n result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L112_C16", "label": "append()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L111_C12", "vector": [8, 4, 0.1139, 0.001, 4, 0.79, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12", "label": "if", "type": "if", "loc": [113, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8", "vector": [4, 3, 0.1175, 0.0061, 3, 0.08, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.low_mark:\n if self.query.high_mark is None:\n val = self.connection.ops.no_limit_value()\n if val:\n result.append('LIMIT %d' % val)\n result.append('OFFSET %d' % self.query.low_mark)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16", "label": "if", "type": "if", "loc": [114, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12", "vector": [4, 4, 0.1175, 0.0041, 4, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.high_mark is None:\n val = self.connection.ops.no_limit_value()\n if val:\n result.append('LIMIT %d' % val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L115_C20", "label": "val = no_limit_value()", "type": "assigned_variable", "loc": [115, 115], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16", "vector": [14, 5, 0.117, 0.001, 5, 0.98, 0.0, 618, 3, 0, 0, 0, 407, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "no_limit_value", "annotation": ""}, "snippet": " val = self.connection.ops.no_limit_value()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L116_C20", "label": "if", "type": "if", "loc": [116, 117], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16", "vector": [4, 5, 0.1185, 0.002, 5, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val:\n result.append('LIMIT %d' % val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L117_C24", "label": "append()", "type": "expression", "loc": [117, 117], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L116_C20", "vector": [8, 6, 0.119, 0.001, 6, 0.89, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('LIMIT %d' % val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L118_C16", "label": "append()", "type": "expression", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12", "vector": [8, 4, 0.12, 0.001, 4, 0.24, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('OFFSET %d' % self.query.low_mark)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "vector": [13, 2, 0.1221, 0.001, 2, 0.72, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(result), tuple(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "label": "as_nested_sql", "type": "function", "loc": [122, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.1312, 0.0153, 1, 0.24, 0.2667, 284, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "as_nested_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_nested_sql(self):\n \"\"\"\n Perform the same functionality as the as_sql() method, returning an\n SQL string and parameters. However, the alias prefixes are bumped\n beforehand (in a copy -- the current query isn't changed), and any\n ordering is removed if the query is unsliced.\n\n Used when nesting this query inside another."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L123_C8", "label": "expression", "type": "expression", "loc": [123, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "vector": [8, 2, 0.1287, 0.0081, 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 Perform the same functionality as the as_sql() method, returning an\n SQL string and parameters. However, the alias prefixes are bumped\n beforehand (in a copy -- the current query isn't changed), and any\n ordering is removed if the query is unsliced.\n\n Used when nesting this query inside another.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L131_C8", "label": "obj = clone()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "vector": [14, 2, 0.1333, 0.001, 2, 0.71, 0.25, 505, 3, 0, 0, 0, 911, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " obj = self.query.clone()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L132_C8", "label": "if", "type": "if", "loc": [132, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "vector": [4, 2, 0.1353, 0.0031, 2, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj.low_mark == 0 and obj.high_mark is None:\n # If there is no slicing in use, then we can safely drop all ordering\n obj.clear_ordering(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L134_C12", "label": "clear_ordering()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L132_C8", "vector": [8, 3, 0.1363, 0.001, 3, 0.36, 0.0, 382, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_ordering", "arg_names": [], "import_names": [], "rhs_call_name": "clear_ordering", "annotation": ""}, "snippet": " obj.clear_ordering(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L135_C8", "label": "bump_prefix()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "vector": [8, 2, 0.1373, 0.001, 2, 0.71, 0.75, 180, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bump_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "bump_prefix", "annotation": ""}, "snippet": " obj.bump_prefix()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "vector": [13, 2, 0.1384, 0.001, 2, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj.get_compiler(connection=self.connection).as_sql()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "label": "get_columns", "type": "function", "loc": [138, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.1801, 0.0804, 1, 0.24, 0.3333, 636, 0, 2, 1, 0, 0, 0, 44], "semantic": {"name": "get_columns", "arg_names": ["self", "with_aliases"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_columns(self, with_aliases=False):\n \"\"\"\n Returns the list of columns to use in the select statement. If no\n columns have been specified, returns all columns relating to fields in\n the model.\n\n If 'with_aliases' is true, any column names that are duplicated\n (without the table names) are given unique aliases. This is needed in"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L139_C8", "label": "expression", "type": "expression", "loc": [139, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [8, 2, 0.1455, 0.0092, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the list of columns to use in the select statement. If no\n columns have been specified, returns all columns relating to fields in\n the model.\n\n If 'with_aliases' is true, any column names that are duplicated\n (without the table names) are given unique aliases. This is needed in\n some cases to avoid ambiguity with nested queries."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L148_C8", "label": "qn =", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.1506, 0.001, 2, 0.38, 0.0909, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L149_C8", "label": "qn2 =", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.1516, 0.001, 2, 0.38, 0.1818, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn2 = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L150_C8", "label": "result =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.1526, 0.001, 2, 0.38, 0.2727, 51, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = ['(%s) AS %s' % (col[0], qn2(alias)) for alias, col in self.query.extra_select.iteritems()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L151_C8", "label": "aliases = set()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.1536, 0.001, 2, 0.38, 0.3636, 88, 3, 1, 0, 0, 21, 10, 2], "semantic": {"name": "aliases", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " aliases = set(self.query.extra_select.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8", "label": "if", "type": "if", "loc": [152, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [4, 2, 0.1562, 0.0041, 2, 0.38, 0.4545, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_aliases:\n col_aliases = aliases.copy()\n else:\n col_aliases = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L153_C12", "label": "col_aliases = copy()", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8", "vector": [14, 3, 0.1556, 0.001, 3, 0.71, 0.0, 654, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "col_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " col_aliases = aliases.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L155_C12", "label": "col_aliases = set()", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8", "vector": [14, 3, 0.1577, 0.001, 3, 0.71, 1.0, 654, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "col_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " col_aliases = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "label": "if", "type": "if", "loc": [156, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [4, 2, 0.176, 0.0356, 2, 0.38, 0.5455, 0, 7, 0, 0, 0, 0, 0, 23], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.select:\n only_load = self.deferred_to_columns()\n for col in self.query.select:\n if isinstance(col, (list, tuple)):\n alias, column = col\n table = self.query.alias_map[alias][TABLE_NAME]\n if table in only_load and col not in only_load[table]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L157_C12", "label": "only_load = deferred_to_columns()", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "vector": [14, 3, 0.1597, 0.001, 3, 0.31, 0.0, 982, 3, 0, 0, 0, 25, 10, 1], "semantic": {"name": "only_load", "arg_names": [], "import_names": [], "rhs_call_name": "deferred_to_columns", "annotation": ""}, "snippet": " only_load = self.deferred_to_columns()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L158_C12", "label": "for col", "type": "for", "loc": [158, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "vector": [6, 3, 0.174, 0.0275, 3, 0.31, 0.5, 157, 7, 0, 0, 0, 0, 0, 19], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for col in self.query.select:\n if isinstance(col, (list, tuple)):\n alias, column = col\n table = self.query.alias_map[alias][TABLE_NAME]\n if table in only_load and col not in only_load[table]:\n continue\n r = '%s.%s' % (qn(alias), qn(column))\n if with_aliases:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "label": "if", "type": "if", "loc": [159, 184], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L158_C12", "vector": [4, 4, 0.1745, 0.0264, 4, 0.46, 0.0, 0, 3, 0, 0, 0, 0, 0, 19], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(col, (list, tuple)):\n alias, column = col\n table = self.query.alias_map[alias][TABLE_NAME]\n if table in only_load and col not in only_load[table]:\n continue\n r = '%s.%s' % (qn(alias), qn(column))\n if with_aliases:\n if col[1] in col_aliases:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L160_C20", "label": "alias, column =", "type": "assigned_variable", "loc": [160, 160], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [14, 5, 0.1628, 0.001, 5, 0.0, 0.0, 408, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias, column", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias, column = col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L161_C20", "label": "table =", "type": "assigned_variable", "loc": [161, 161], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [14, 5, 0.1638, 0.001, 5, 0.0, 0.1667, 338, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = self.query.alias_map[alias][TABLE_NAME]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L162_C20", "label": "if", "type": "if", "loc": [162, 163], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [4, 5, 0.1653, 0.002, 5, 0.0, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table in only_load and col not in only_load[table]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L164_C20", "label": "r =", "type": "assigned_variable", "loc": [164, 164], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [14, 5, 0.1668, 0.001, 5, 0.0, 0.5, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = '%s.%s' % (qn(alias), qn(column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "label": "if", "type": "if", "loc": [165, 178], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [4, 5, 0.1745, 0.0142, 5, 0.0, 0.6667, 0, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_aliases:\n if col[1] in col_aliases:\n c_alias = 'Col%d' % len(col_aliases)\n result.append('%s AS %s' % (r, c_alias))\n aliases.add(c_alias)\n col_aliases.add(c_alias)\n else:\n result.append('%s AS %s' % (r, qn2(col[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "label": "if", "type": "if", "loc": [166, 174], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "vector": [4, 6, 0.1729, 0.0092, 6, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col[1] in col_aliases:\n c_alias = 'Col%d' % len(col_aliases)\n result.append('%s AS %s' % (r, c_alias))\n aliases.add(c_alias)\n col_aliases.add(c_alias)\n else:\n result.append('%s AS %s' % (r, qn2(col[1])))\n aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L167_C28", "label": "c_alias =", "type": "assigned_variable", "loc": [167, 167], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [14, 7, 0.1699, 0.001, 7, 0.84, 0.0, 89, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c_alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_alias = 'Col%d' % len(col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L168_C28", "label": "append()", "type": "expression", "loc": [168, 168], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.1709, 0.001, 7, 0.84, 0.1667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s AS %s' % (r, c_alias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L169_C28", "label": "add()", "type": "expression", "loc": [169, 169], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.1719, 0.001, 7, 0.84, 0.3333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L170_C28", "label": "add()", "type": "expression", "loc": [170, 170], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.1729, 0.001, 7, 0.84, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L172_C28", "label": "append()", "type": "expression", "loc": [172, 172], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.175, 0.001, 7, 0.84, 0.6667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s AS %s' % (r, qn2(col[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L173_C28", "label": "add()", "type": "expression", "loc": [173, 173], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.176, 0.001, 7, 0.84, 0.8333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L174_C28", "label": "add()", "type": "expression", "loc": [174, 174], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "vector": [8, 7, 0.177, 0.001, 7, 0.84, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L176_C24", "label": "append()", "type": "expression", "loc": [176, 176], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "vector": [8, 6, 0.179, 0.001, 6, 0.54, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L177_C24", "label": "add()", "type": "expression", "loc": [177, 177], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "vector": [8, 6, 0.1801, 0.001, 6, 0.54, 0.6667, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L178_C24", "label": "add()", "type": "expression", "loc": [178, 178], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "vector": [8, 6, 0.1811, 0.001, 6, 0.54, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L180_C20", "label": "append()", "type": "expression", "loc": [180, 180], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [8, 5, 0.1831, 0.001, 5, 0.0, 0.8333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(col.as_sql(qn, self.connection))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20", "label": "if", "type": "if", "loc": [182, 184], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "vector": [4, 5, 0.1862, 0.0031, 5, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(col, 'alias'):\n aliases.add(col.alias)\n col_aliases.add(col.alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L183_C24", "label": "add()", "type": "expression", "loc": [183, 183], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20", "vector": [8, 6, 0.1862, 0.001, 6, 0.88, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(col.alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L184_C24", "label": "add()", "type": "expression", "loc": [184, 184], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20", "vector": [8, 6, 0.1872, 0.001, 6, 0.88, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(col.alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "label": "if", "type": "if", "loc": [186, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "vector": [4, 3, 0.1913, 0.0051, 3, 0.31, 1.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.query.default_cols:\n cols, new_aliases = self.get_default_columns(with_aliases,\n col_aliases)\n result.extend(cols)\n aliases.update(new_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L187_C12", "label": "cols, new_aliases = get_default_columns()", "type": "assigned_variable", "loc": [187, 188], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "vector": [14, 4, 0.1907, 0.002, 4, 0.13, 0.0, 806, 3, 2, 0, 0, 149, 10, 1], "semantic": {"name": "cols, new_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "get_default_columns", "annotation": ""}, "snippet": " cols, new_aliases = self.get_default_columns(with_aliases,\n col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L189_C12", "label": "extend()", "type": "expression", "loc": [189, 189], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "vector": [8, 4, 0.1923, 0.001, 4, 0.13, 0.5, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " result.extend(cols)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L190_C12", "label": "update()", "type": "expression", "loc": [190, 190], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "vector": [8, 4, 0.1933, 0.001, 4, 0.13, 1.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " aliases.update(new_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L192_C8", "label": "max_name_length = max_name_length()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.1953, 0.001, 2, 0.38, 0.6364, 680, 3, 0, 0, 0, 680, 10, 1], "semantic": {"name": "max_name_length", "arg_names": [], "import_names": [], "rhs_call_name": "max_name_length", "annotation": ""}, "snippet": " max_name_length = self.connection.ops.max_name_length()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L193_C8", "label": "extend()", "type": "expression", "loc": [193, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [8, 2, 0.2004, 0.0092, 2, 0.38, 0.7273, 660, 3, 1, 0, 0, 0, 0, 5], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " result.extend([\n '%s%s' % (\n aggregate.as_sql(qn, self.connection),\n alias is not None\n and ' AS %s' % qn(truncate_name(alias, max_name_length))\n or ''\n )\n for alias, aggregate in self.query.aggregate_select.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8", "label": "for table, col", "type": "for", "loc": [203, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [6, 2, 0.2116, 0.0112, 2, 0.38, 0.8182, 880, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "table, col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for table, col in self.query.related_select_cols:\n r = '%s.%s' % (qn(table), qn(col))\n if with_aliases and col in col_aliases:\n c_alias = 'Col%d' % len(col_aliases)\n result.append('%s AS %s' % (r, c_alias))\n aliases.add(c_alias)\n col_aliases.add(c_alias)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L204_C12", "label": "r =", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8", "vector": [14, 3, 0.2075, 0.001, 3, 0.71, 0.0, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = '%s.%s' % (qn(table), qn(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "label": "if", "type": "if", "loc": [205, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8", "vector": [4, 3, 0.2126, 0.0092, 3, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_aliases and col in col_aliases:\n c_alias = 'Col%d' % len(col_aliases)\n result.append('%s AS %s' % (r, c_alias))\n aliases.add(c_alias)\n col_aliases.add(c_alias)\n else:\n result.append(r)\n aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L206_C16", "label": "c_alias =", "type": "assigned_variable", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [14, 4, 0.2096, 0.001, 4, 0.83, 0.0, 89, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c_alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_alias = 'Col%d' % len(col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L207_C16", "label": "append()", "type": "expression", "loc": [207, 207], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2106, 0.001, 4, 0.83, 0.1667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s AS %s' % (r, c_alias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L208_C16", "label": "add()", "type": "expression", "loc": [208, 208], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2116, 0.001, 4, 0.83, 0.3333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L209_C16", "label": "add()", "type": "expression", "loc": [209, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2126, 0.001, 4, 0.83, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L211_C16", "label": "append()", "type": "expression", "loc": [211, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2146, 0.001, 4, 0.83, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L212_C16", "label": "add()", "type": "expression", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2157, 0.001, 4, 0.83, 0.8333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L213_C16", "label": "add()", "type": "expression", "loc": [213, 213], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "vector": [8, 4, 0.2167, 0.001, 4, 0.83, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L215_C8", "label": "self._select_aliases =", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [14, 2, 0.2187, 0.001, 2, 0.38, 0.9091, 583, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._select_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._select_aliases = aliases"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L216_C8", "label": "return", "type": "return", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "vector": [13, 2, 0.2197, 0.001, 2, 0.38, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "label": "get_default_columns", "type": "function", "loc": [218, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.2538, 0.0651, 1, 0.24, 0.4, 149, 0, 7, 1, 0, 0, 0, 19], "semantic": {"name": "get_default_columns", "arg_names": ["self", "with_aliases", "col_aliases", "start_alias", "opts", "as_pairs", "local_only"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_default_columns(self, with_aliases=False, col_aliases=None,\n start_alias=None, opts=None, as_pairs=False, local_only=False):\n \"\"\"\n Computes the default columns for selecting every field in the base\n model. Will sometimes be called to pull in related models (e.g. via\n select_related), in which case \"opts\" and \"start_alias\" will be given\n to provide a starting point for the traversal.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L220_C8", "label": "expression", "type": "expression", "loc": [220, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [8, 2, 0.2289, 0.0112, 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 Computes the default columns for selecting every field in the base\n model. Will sometimes be called to pull in related models (e.g. via\n select_related), in which case \"opts\" and \"start_alias\" will be given\n to provide a starting point for the traversal.\n\n Returns a list of strings, quoted appropriately for use in SQL\n directly, as well as a set of aliases used in the select statement (if"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L231_C8", "label": "result =", "type": "assigned_variable", "loc": [231, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.235, 0.001, 2, 0.78, 0.1, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L232_C8", "label": "if", "type": "if", "loc": [232, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [4, 2, 0.2365, 0.002, 2, 0.78, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if opts is None:\n opts = self.query.model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L233_C12", "label": "opts =", "type": "assigned_variable", "loc": [233, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L232_C8", "vector": [14, 3, 0.237, 0.001, 3, 0.94, 0.0, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = self.query.model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L234_C8", "label": "qn =", "type": "assigned_variable", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.238, 0.001, 2, 0.78, 0.3, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L235_C8", "label": "qn2 =", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.2391, 0.001, 2, 0.78, 0.4, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn2 = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L236_C8", "label": "aliases = set()", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.2401, 0.001, 2, 0.78, 0.5, 88, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "aliases", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " aliases = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L237_C8", "label": "only_load = deferred_to_columns()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.2411, 0.001, 2, 0.78, 0.6, 982, 3, 0, 0, 0, 25, 10, 1], "semantic": {"name": "only_load", "arg_names": [], "import_names": [], "rhs_call_name": "deferred_to_columns", "annotation": ""}, "snippet": " only_load = self.deferred_to_columns()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L239_C8", "label": "proxied_model = get_proxied_model()", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [14, 2, 0.2431, 0.001, 2, 0.78, 0.7, 797, 3, 1, 0, 0, 229, 10, 1], "semantic": {"name": "proxied_model", "arg_names": [], "import_names": [], "rhs_call_name": "get_proxied_model", "annotation": ""}, "snippet": " proxied_model = get_proxied_model(opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L241_C8", "label": "if", "type": "if", "loc": [241, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [4, 2, 0.2457, 0.002, 2, 0.78, 0.8, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_alias:\n seen = {None: start_alias}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L242_C12", "label": "seen =", "type": "assigned_variable", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L241_C8", "vector": [14, 3, 0.2462, 0.001, 3, 0.74, 0.0, 212, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "seen", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen = {None: start_alias}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "label": "for field, model", "type": "for", "loc": [243, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [6, 2, 0.266, 0.0387, 2, 0.78, 0.9, 407, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "field, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, model in opts.get_fields_with_model():\n if local_only and model is not None:\n continue\n if start_alias:\n try:\n alias = seen[model]\n except KeyError:\n if model is proxied_model:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L244_C12", "label": "if", "type": "if", "loc": [244, 245], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [4, 3, 0.2487, 0.002, 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 local_only and model is not None:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12", "label": "if", "type": "if", "loc": [246, 261], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [4, 3, 0.2579, 0.0163, 3, 0.24, 0.2, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if start_alias:\n try:\n alias = seen[model]\n except KeyError:\n if model is proxied_model:\n alias = start_alias\n else:\n link_field = opts.get_ancestor_link(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "label": "try", "type": "try", "loc": [247, 256], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12", "vector": [7, 4, 0.2558, 0.0102, 4, 0.69, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n alias = seen[model]\n except KeyError:\n if model is proxied_model:\n alias = start_alias\n else:\n link_field = opts.get_ancestor_link(model)\n alias = self.query.join((start_alias, model._meta.db_table,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L248_C20", "label": "alias =", "type": "assigned_variable", "loc": [248, 248], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "vector": [14, 5, 0.2523, 0.001, 5, 0.4, 0.0, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = seen[model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "label": "if", "type": "if", "loc": [250, 255], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "vector": [4, 5, 0.2569, 0.0061, 5, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model is proxied_model:\n alias = start_alias\n else:\n link_field = opts.get_ancestor_link(model)\n alias = self.query.join((start_alias, model._meta.db_table,\n link_field.column, model._meta.pk.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L251_C24", "label": "alias =", "type": "assigned_variable", "loc": [251, 251], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "vector": [14, 6, 0.2553, 0.001, 6, 0.44, 0.0, 657, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = start_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L253_C24", "label": "link_field = get_ancestor_link()", "type": "assigned_variable", "loc": [253, 253], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "vector": [14, 6, 0.2574, 0.001, 6, 0.44, 0.5, 887, 3, 1, 0, 0, 646, 10, 1], "semantic": {"name": "link_field", "arg_names": [], "import_names": [], "rhs_call_name": "get_ancestor_link", "annotation": ""}, "snippet": " link_field = opts.get_ancestor_link(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L254_C24", "label": "alias = join()", "type": "assigned_variable", "loc": [254, 255], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "vector": [14, 6, 0.2589, 0.002, 6, 0.44, 1.0, 657, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " alias = self.query.join((start_alias, model._meta.db_table,\n link_field.column, model._meta.pk.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L256_C20", "label": "assign", "type": "assigned_variable", "loc": [256, 256], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "vector": [14, 5, 0.2604, 0.001, 5, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " seen[model] = alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L261_C16", "label": "alias =", "type": "assigned_variable", "loc": [261, 261], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12", "vector": [14, 4, 0.2655, 0.001, 4, 0.69, 1.0, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = self.query.included_inherited_models[model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L262_C12", "label": "table =", "type": "assigned_variable", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [14, 3, 0.2665, 0.001, 3, 0.24, 0.4, 338, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = self.query.alias_map[alias][TABLE_NAME]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L263_C12", "label": "if", "type": "if", "loc": [263, 264], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [4, 3, 0.2681, 0.002, 3, 0.24, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table in only_load and field.column not in only_load[table]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12", "label": "if", "type": "if", "loc": [265, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [4, 3, 0.2711, 0.0041, 3, 0.24, 0.8, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if as_pairs:\n result.append((alias, field.column))\n aliases.add(alias)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L266_C16", "label": "append()", "type": "expression", "loc": [266, 266], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12", "vector": [8, 4, 0.2706, 0.001, 4, 0.61, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append((alias, field.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L267_C16", "label": "add()", "type": "expression", "loc": [267, 267], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12", "vector": [8, 4, 0.2716, 0.001, 4, 0.61, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "label": "if", "type": "if", "loc": [269, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "vector": [4, 3, 0.2792, 0.0122, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_aliases and field.column in col_aliases:\n c_alias = 'Col%d' % len(col_aliases)\n result.append('%s.%s AS %s' % (qn(alias),\n qn2(field.column), c_alias))\n col_aliases.add(c_alias)\n aliases.add(c_alias)\n else:\n r = '%s.%s' % (qn(alias), qn2(field.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L270_C16", "label": "c_alias =", "type": "assigned_variable", "loc": [270, 270], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [14, 4, 0.2747, 0.001, 4, 0.29, 0.0, 89, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "c_alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c_alias = 'Col%d' % len(col_aliases)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L271_C16", "label": "append()", "type": "expression", "loc": [271, 272], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [8, 4, 0.2762, 0.002, 4, 0.29, 0.1429, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s.%s AS %s' % (qn(alias),\n qn2(field.column), c_alias))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L273_C16", "label": "add()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [8, 4, 0.2777, 0.001, 4, 0.29, 0.2857, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L274_C16", "label": "add()", "type": "expression", "loc": [274, 274], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [8, 4, 0.2787, 0.001, 4, 0.29, 0.4286, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(c_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L276_C16", "label": "r =", "type": "assigned_variable", "loc": [276, 276], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [14, 4, 0.2808, 0.001, 4, 0.29, 0.5714, 436, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "r", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " r = '%s.%s' % (qn(alias), qn2(field.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L277_C16", "label": "append()", "type": "expression", "loc": [277, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [8, 4, 0.2818, 0.001, 4, 0.29, 0.7143, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L278_C16", "label": "add()", "type": "expression", "loc": [278, 278], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [8, 4, 0.2828, 0.001, 4, 0.29, 0.8571, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " aliases.add(r)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L279_C16", "label": "if", "type": "if", "loc": [279, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "vector": [4, 4, 0.2843, 0.002, 4, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if with_aliases:\n col_aliases.add(field.column)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L280_C20", "label": "add()", "type": "expression", "loc": [280, 280], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L279_C16", "vector": [8, 5, 0.2848, 0.001, 5, 0.14, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " col_aliases.add(field.column)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L281_C8", "label": "return", "type": "return", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "vector": [13, 2, 0.2859, 0.001, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result, aliases"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "label": "get_ordering", "type": "function", "loc": [283, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.3291, 0.0834, 1, 0.24, 0.4667, 452, 0, 1, 1, 0, 0, 0, 25], "semantic": {"name": "get_ordering", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ordering(self):\n \"\"\"\n Returns a tuple containing a list representing the SQL elements in the\n \"order by\" clause, and the list of SQL elements that need to be added\n to the GROUP BY clause as a result of the ordering.\n\n Also sets the ordering_aliases attribute on this instance to a list of\n extra aliases needed in the select."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L284_C8", "label": "expression", "type": "expression", "loc": [284, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [8, 2, 0.294, 0.0112, 2, 0.38, 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 containing a list representing the SQL elements in the\n \"order by\" clause, and the list of SQL elements that need to be added\n to the GROUP BY clause as a result of the ordering.\n\n Also sets the ordering_aliases attribute on this instance to a list of\n extra aliases needed in the select.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8", "label": "if", "type": "if", "loc": [295, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [4, 2, 0.3026, 0.0061, 2, 0.38, 0.0769, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.extra_order_by:\n ordering = self.query.extra_order_by\n elif not self.query.default_ordering:\n ordering = self.query.order_by\n else:\n ordering = self.query.order_by or self.query.model._meta.ordering"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L296_C12", "label": "ordering =", "type": "assigned_variable", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8", "vector": [14, 3, 0.3011, 0.001, 3, 0.67, 0.0, 656, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ordering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ordering = self.query.extra_order_by"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8", "label": "if", "type": "if", "loc": [297, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8", "vector": [4, 3, 0.3037, 0.0041, 3, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not self.query.default_ordering:\n ordering = self.query.order_by\n else:\n ordering = self.query.order_by or self.query.model._meta.ordering"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L298_C12", "label": "ordering =", "type": "assigned_variable", "loc": [298, 298], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8", "vector": [14, 4, 0.3032, 0.001, 4, 0.11, 0.0, 656, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ordering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ordering = self.query.order_by"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L300_C12", "label": "ordering =", "type": "assigned_variable", "loc": [300, 300], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8", "vector": [14, 4, 0.3052, 0.001, 4, 0.11, 1.0, 656, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ordering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ordering = self.query.order_by or self.query.model._meta.ordering"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L301_C8", "label": "qn =", "type": "assigned_variable", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3062, 0.001, 2, 0.38, 0.1538, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L302_C8", "label": "qn2 =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3072, 0.001, 2, 0.38, 0.2308, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn2 = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L303_C8", "label": "distinct =", "type": "assigned_variable", "loc": [303, 303], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3082, 0.001, 2, 0.38, 0.3077, 934, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "distinct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " distinct = self.query.distinct"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L304_C8", "label": "select_aliases =", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3093, 0.001, 2, 0.38, 0.3846, 367, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "select_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " select_aliases = self._select_aliases"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L305_C8", "label": "result =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3103, 0.001, 2, 0.38, 0.4615, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L306_C8", "label": "group_by =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3113, 0.001, 2, 0.38, 0.5385, 282, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "group_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " group_by = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L307_C8", "label": "ordering_aliases =", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3123, 0.001, 2, 0.38, 0.6154, 105, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ordering_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ordering_aliases = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8", "label": "if", "type": "if", "loc": [308, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [4, 2, 0.3149, 0.0041, 2, 0.38, 0.6923, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.standard_ordering:\n asc, desc = ORDER_DIR['ASC']\n else:\n asc, desc = ORDER_DIR['DESC']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L309_C12", "label": "asc, desc =", "type": "assigned_variable", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8", "vector": [14, 3, 0.3143, 0.001, 3, 0.68, 0.0, 153, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "asc, desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " asc, desc = ORDER_DIR['ASC']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L311_C12", "label": "asc, desc =", "type": "assigned_variable", "loc": [311, 311], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8", "vector": [14, 3, 0.3164, 0.001, 3, 0.68, 1.0, 153, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "asc, desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " asc, desc = ORDER_DIR['DESC']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L316_C8", "label": "processed_pairs = set()", "type": "assigned_variable", "loc": [316, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3215, 0.001, 2, 0.38, 0.7692, 665, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "processed_pairs", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " processed_pairs = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "label": "for field", "type": "for", "loc": [318, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [6, 2, 0.3459, 0.0458, 2, 0.38, 0.8462, 480, 2, 0, 0, 0, 0, 0, 24], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field in ordering:\n if field == '?':\n result.append(self.connection.ops.random_function_sql())\n continue\n if isinstance(field, int):\n if field < 0:\n order = desc\n field = -field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L319_C12", "label": "if", "type": "if", "loc": [319, 321], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "vector": [4, 3, 0.3255, 0.0031, 3, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field == '?':\n result.append(self.connection.ops.random_function_sql())\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L320_C16", "label": "append()", "type": "expression", "loc": [320, 320], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L319_C12", "vector": [8, 4, 0.3255, 0.001, 4, 0.21, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(self.connection.ops.random_function_sql())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "label": "if", "type": "if", "loc": [322, 330], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "vector": [4, 3, 0.3316, 0.0092, 3, 0.84, 0.25, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(field, int):\n if field < 0:\n order = desc\n field = -field\n else:\n order = asc\n result.append('%s %s' % (field, order))\n group_by.append((field, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "label": "if", "type": "if", "loc": [323, 327], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "vector": [4, 4, 0.3306, 0.0051, 4, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field < 0:\n order = desc\n field = -field\n else:\n order = asc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L324_C20", "label": "order =", "type": "assigned_variable", "loc": [324, 324], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "vector": [14, 5, 0.3296, 0.001, 5, 0.29, 0.0, 234, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "order", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " order = desc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L325_C20", "label": "field =", "type": "assigned_variable", "loc": [325, 325], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "vector": [14, 5, 0.3306, 0.001, 5, 0.29, 0.5, 480, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = -field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L327_C20", "label": "order =", "type": "assigned_variable", "loc": [327, 327], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "vector": [14, 5, 0.3327, 0.001, 5, 0.29, 1.0, 234, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "order", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " order = asc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L328_C16", "label": "append()", "type": "expression", "loc": [328, 328], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "vector": [8, 4, 0.3337, 0.001, 4, 0.97, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s' % (field, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L329_C16", "label": "append()", "type": "expression", "loc": [329, 329], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "vector": [8, 4, 0.3347, 0.001, 4, 0.97, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group_by.append((field, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L331_C12", "label": "col, order = get_order_dir()", "type": "assigned_variable", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "vector": [14, 3, 0.3367, 0.001, 3, 0.84, 0.5, 704, 3, 2, 0, 0, 660, 10, 1], "semantic": {"name": "col, order", "arg_names": [], "import_names": [], "rhs_call_name": "get_order_dir", "annotation": ""}, "snippet": " col, order = get_order_dir(field, asc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L332_C12", "label": "if", "type": "if", "loc": [332, 334], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "vector": [4, 3, 0.3388, 0.0031, 3, 0.84, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col in self.query.aggregate_select:\n result.append('%s %s' % (col, order))\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L333_C16", "label": "append()", "type": "expression", "loc": [333, 333], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L332_C12", "vector": [8, 4, 0.3388, 0.001, 4, 0.83, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s' % (col, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "label": "if", "type": "if", "loc": [335, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "vector": [4, 3, 0.3545, 0.0285, 3, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '.' in field:\n # This came in through an extra(order_by=...) addition. Pass it\n # on verbatim.\n table, col = col.split('.', 1)\n if (table, col) not in processed_pairs:\n elt = '%s.%s' % (qn(table), col)\n processed_pairs.add((table, col))\n if not distinct or elt in select_aliases:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L338_C16", "label": "table, col = split()", "type": "assigned_variable", "loc": [338, 338], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "vector": [14, 4, 0.3438, 0.001, 4, 0.27, 0.0, 880, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "table, col", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " table, col = col.split('.', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "label": "if", "type": "if", "loc": [339, 344], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "vector": [4, 4, 0.3474, 0.0061, 4, 0.27, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (table, col) not in processed_pairs:\n elt = '%s.%s' % (qn(table), col)\n processed_pairs.add((table, col))\n if not distinct or elt in select_aliases:\n result.append('%s %s' % (elt, order))\n group_by.append((elt, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L340_C20", "label": "elt =", "type": "assigned_variable", "loc": [340, 340], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "vector": [14, 5, 0.3459, 0.001, 5, 0.66, 0.0, 459, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "elt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elt = '%s.%s' % (qn(table), col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L341_C20", "label": "add()", "type": "expression", "loc": [341, 341], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "vector": [8, 5, 0.3469, 0.001, 5, 0.66, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " processed_pairs.add((table, col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20", "label": "if", "type": "if", "loc": [342, 344], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "vector": [4, 5, 0.3489, 0.0031, 5, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not distinct or elt in select_aliases:\n result.append('%s %s' % (elt, order))\n group_by.append((elt, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L343_C24", "label": "append()", "type": "expression", "loc": [343, 343], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20", "vector": [8, 6, 0.3489, 0.001, 6, 0.04, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s' % (elt, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L344_C24", "label": "append()", "type": "expression", "loc": [344, 344], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20", "vector": [8, 6, 0.3499, 0.001, 6, 0.04, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group_by.append((elt, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "label": "if", "type": "if", "loc": [345, 362], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "vector": [4, 4, 0.3596, 0.0183, 4, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif get_order_dir(field)[0] not in self.query.extra_select:\n # 'col' is of the form 'field' or 'field1__field2' or\n # '-field1__field2__field', etc.\n for table, col, order in self.find_ordering_name(field,\n self.query.model._meta, default_order=asc):\n if (table, col) not in processed_pairs:\n elt = '%s.%s' % (qn(table), qn2(col))\n processed_pairs.add((table, col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L348_C16", "label": "for table, col, order", "type": "for", "loc": [348, 356], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "vector": [6, 5, 0.3581, 0.0092, 5, 0.92, 0.0, 712, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "table, col, order", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for table, col, order in self.find_ordering_name(field,\n self.query.model._meta, default_order=asc):\n if (table, col) not in processed_pairs:\n elt = '%s.%s' % (qn(table), qn2(col))\n processed_pairs.add((table, col))\n if distinct and elt not in select_aliases:\n ordering_aliases.append(elt)\n result.append('%s %s' % (elt, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "label": "if", "type": "if", "loc": [350, 356], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L348_C16", "vector": [4, 6, 0.3591, 0.0071, 6, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (table, col) not in processed_pairs:\n elt = '%s.%s' % (qn(table), qn2(col))\n processed_pairs.add((table, col))\n if distinct and elt not in select_aliases:\n ordering_aliases.append(elt)\n result.append('%s %s' % (elt, order))\n group_by.append((elt, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L351_C24", "label": "elt =", "type": "assigned_variable", "loc": [351, 351], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "vector": [14, 7, 0.3571, 0.001, 7, 0.83, 0.0, 459, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "elt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elt = '%s.%s' % (qn(table), qn2(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L352_C24", "label": "add()", "type": "expression", "loc": [352, 352], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "vector": [8, 7, 0.3581, 0.001, 7, 0.83, 0.25, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " processed_pairs.add((table, col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L353_C24", "label": "if", "type": "if", "loc": [353, 354], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "vector": [4, 7, 0.3596, 0.002, 7, 0.83, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if distinct and elt not in select_aliases:\n ordering_aliases.append(elt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L354_C28", "label": "append()", "type": "expression", "loc": [354, 354], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L353_C24", "vector": [8, 8, 0.3601, 0.001, 8, 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": " ordering_aliases.append(elt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L355_C24", "label": "append()", "type": "expression", "loc": [355, 355], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "vector": [8, 7, 0.3611, 0.001, 7, 0.83, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s' % (elt, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L356_C24", "label": "append()", "type": "expression", "loc": [356, 356], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "vector": [8, 7, 0.3622, 0.001, 7, 0.83, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group_by.append((elt, []))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L358_C16", "label": "elt = qn2()", "type": "assigned_variable", "loc": [358, 358], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "vector": [14, 5, 0.3642, 0.001, 5, 0.92, 0.25, 459, 3, 1, 0, 0, 240, 10, 1], "semantic": {"name": "elt", "arg_names": [], "import_names": [], "rhs_call_name": "qn2", "annotation": ""}, "snippet": " elt = qn2(col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L359_C16", "label": "if", "type": "if", "loc": [359, 360], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "vector": [4, 5, 0.3657, 0.002, 5, 0.92, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if distinct and col not in select_aliases:\n ordering_aliases.append(elt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L360_C20", "label": "append()", "type": "expression", "loc": [360, 360], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L359_C16", "vector": [8, 6, 0.3662, 0.001, 6, 0.8, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " ordering_aliases.append(elt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L361_C16", "label": "append()", "type": "expression", "loc": [361, 361], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "vector": [8, 5, 0.3672, 0.001, 5, 0.92, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s' % (elt, order))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L362_C16", "label": "append()", "type": "expression", "loc": [362, 362], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "vector": [8, 5, 0.3683, 0.001, 5, 0.92, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " group_by.append(self.query.extra_select[col])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L363_C8", "label": "self.query.ordering_aliases =", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [14, 2, 0.3693, 0.001, 2, 0.38, 0.9231, 592, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query.ordering_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.ordering_aliases = ordering_aliases"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L364_C8", "label": "return", "type": "return", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "vector": [13, 2, 0.3703, 0.001, 2, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result, group_by"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "label": "find_ordering_name", "type": "function", "loc": [366, 419], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.3993, 0.0549, 1, 0.24, 0.5333, 311, 0, 6, 1, 0, 0, 0, 14], "semantic": {"name": "find_ordering_name", "arg_names": ["self", "name", "opts", "alias", "default_order", "already_seen"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def find_ordering_name(self, name, opts, alias=None, default_order='ASC',\n already_seen=None):\n \"\"\"\n Returns the table alias (the name might be ambiguous, the alias will\n not be) and column name for ordering by the given 'name' parameter.\n The 'name' is of the form 'field1__field2__...__fieldN'.\n \"\"\"\n name, order = get_order_dir(name, default_order)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L368_C8", "label": "expression", "type": "expression", "loc": [368, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [8, 2, 0.3764, 0.0051, 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 table alias (the name might be ambiguous, the alias will\n not be) and column name for ordering by the given 'name' parameter.\n The 'name' is of the form 'field1__field2__...__fieldN'.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L373_C8", "label": "name, order = get_order_dir()", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [14, 2, 0.3795, 0.001, 2, 0.71, 0.0909, 331, 3, 2, 0, 0, 660, 10, 1], "semantic": {"name": "name, order", "arg_names": [], "import_names": [], "rhs_call_name": "get_order_dir", "annotation": ""}, "snippet": " name, order = get_order_dir(name, default_order)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L374_C8", "label": "pieces = split()", "type": "assigned_variable", "loc": [374, 374], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [14, 2, 0.3805, 0.001, 2, 0.71, 0.1818, 181, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "pieces", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " pieces = name.split(LOOKUP_SEP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L375_C8", "label": "if", "type": "if", "loc": [375, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [4, 2, 0.382, 0.002, 2, 0.71, 0.2727, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not alias:\n alias = self.query.get_initial_alias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L376_C12", "label": "alias = get_initial_alias()", "type": "assigned_variable", "loc": [376, 376], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L375_C8", "vector": [14, 3, 0.3825, 0.001, 3, 0.14, 0.0, 657, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "get_initial_alias", "annotation": ""}, "snippet": " alias = self.query.get_initial_alias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L377_C8", "label": "field, target, opts, joins, last, extra = setup_joins()", "type": "assigned_variable", "loc": [377, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [14, 2, 0.384, 0.002, 2, 0.71, 0.3636, 821, 3, 4, 0, 0, 955, 10, 1], "semantic": {"name": "field, target, opts, joins, last, extra", "arg_names": [], "import_names": [], "rhs_call_name": "setup_joins", "annotation": ""}, "snippet": " field, target, opts, joins, last, extra = self.query.setup_joins(pieces,\n opts, alias, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L379_C8", "label": "alias =", "type": "assigned_variable", "loc": [379, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [14, 2, 0.3856, 0.001, 2, 0.71, 0.4545, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = joins[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L380_C8", "label": "col =", "type": "assigned_variable", "loc": [380, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [14, 2, 0.3866, 0.001, 2, 0.71, 0.5455, 157, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = target.column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L381_C8", "label": "if", "type": "if", "loc": [381, 385], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [4, 2, 0.3896, 0.0051, 2, 0.71, 0.6364, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not field.rel:\n # To avoid inadvertent trimming of a necessary alias, use the\n # refcount to show that we are referencing a non-relation field on\n # the model.\n self.query.ref_alias(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L385_C12", "label": "ref_alias()", "type": "expression", "loc": [385, 385], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L381_C8", "vector": [8, 3, 0.3917, 0.001, 3, 0.69, 0.0, 291, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ref_alias", "arg_names": [], "import_names": [], "rhs_call_name": "ref_alias", "annotation": ""}, "snippet": " self.query.ref_alias(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L388_C8", "label": "promote_alias_chain()", "type": "expression", "loc": [388, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [8, 2, 0.3952, 0.002, 2, 0.71, 0.7273, 76, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "promote_alias_chain", "arg_names": [], "import_names": [], "rhs_call_name": "promote_alias_chain", "annotation": ""}, "snippet": " self.query.promote_alias_chain(joins,\n self.query.alias_map[joins[0]][JOIN_TYPE] == self.query.LOUTER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "label": "if", "type": "if", "loc": [393, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [4, 2, 0.4064, 0.0142, 2, 0.71, 0.8182, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.rel and len(joins) > 1 and opts.ordering:\n # Firstly, avoid infinite loops.\n if not already_seen:\n already_seen = set()\n join_tuple = tuple([self.query.alias_map[j][TABLE_NAME] for j in joins])\n if join_tuple in already_seen:\n raise FieldError('Infinite loop caused by ordering.')\n already_seen.add(join_tuple)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L395_C12", "label": "if", "type": "if", "loc": [395, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [4, 3, 0.4023, 0.002, 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 not already_seen:\n already_seen = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L396_C16", "label": "already_seen = set()", "type": "assigned_variable", "loc": [396, 396], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L395_C12", "vector": [14, 4, 0.4028, 0.001, 4, 0.09, 0.0, 476, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "already_seen", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " already_seen = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L397_C12", "label": "join_tuple = tuple()", "type": "assigned_variable", "loc": [397, 397], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [14, 3, 0.4039, 0.001, 3, 0.42, 0.1667, 481, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "join_tuple", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " join_tuple = tuple([self.query.alias_map[j][TABLE_NAME] for j in joins])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L398_C12", "label": "if", "type": "if", "loc": [398, 399], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [4, 3, 0.4054, 0.002, 3, 0.42, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if join_tuple in already_seen:\n raise FieldError('Infinite loop caused by ordering.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L400_C12", "label": "add()", "type": "expression", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [8, 3, 0.4069, 0.001, 3, 0.42, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " already_seen.add(join_tuple)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L402_C12", "label": "results =", "type": "assigned_variable", "loc": [402, 402], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [14, 3, 0.409, 0.001, 3, 0.42, 0.6667, 143, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " results = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L403_C12", "label": "for item", "type": "for", "loc": [403, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [6, 3, 0.411, 0.0031, 3, 0.42, 0.8333, 434, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in opts.ordering:\n results.extend(self.find_ordering_name(item, opts, alias,\n order, already_seen))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L404_C16", "label": "extend()", "type": "expression", "loc": [404, 405], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L403_C12", "vector": [8, 4, 0.4115, 0.002, 4, 0.07, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " results.extend(self.find_ordering_name(item, opts, alias,\n order, already_seen))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L406_C12", "label": "return", "type": "return", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "vector": [13, 3, 0.413, 0.001, 3, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return results"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L408_C8", "label": "if", "type": "if", "loc": [408, 418], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [4, 2, 0.4201, 0.0112, 2, 0.71, 0.9091, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if alias:\n # We have to do the same \"final join\" optimisation as in\n # add_filter, since the final column might not otherwise be part of\n # the select set (so we can't order on it).\n while 1:\n join = self.query.alias_map[alias]\n if col != join[RHS_JOIN_COL]:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "label": "while", "type": "while", "loc": [412, 418], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L408_C8", "vector": [5, 3, 0.4222, 0.0071, 3, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while 1:\n join = self.query.alias_map[alias]\n if col != join[RHS_JOIN_COL]:\n break\n self.query.unref_alias(alias)\n alias = join[LHS_ALIAS]\n col = join[LHS_JOIN_COL]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L413_C16", "label": "join =", "type": "assigned_variable", "loc": [413, 413], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "vector": [14, 4, 0.4201, 0.001, 4, 0.59, 0.0, 933, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " join = self.query.alias_map[alias]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L414_C16", "label": "if", "type": "if", "loc": [414, 415], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "vector": [4, 4, 0.4217, 0.002, 4, 0.59, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col != join[RHS_JOIN_COL]:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L416_C16", "label": "unref_alias()", "type": "expression", "loc": [416, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "vector": [8, 4, 0.4232, 0.001, 4, 0.59, 0.5, 480, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unref_alias", "arg_names": [], "import_names": [], "rhs_call_name": "unref_alias", "annotation": ""}, "snippet": " self.query.unref_alias(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L417_C16", "label": "alias =", "type": "assigned_variable", "loc": [417, 417], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "vector": [14, 4, 0.4242, 0.001, 4, 0.59, 0.75, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = join[LHS_ALIAS]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L418_C16", "label": "col =", "type": "assigned_variable", "loc": [418, 418], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "vector": [14, 4, 0.4252, 0.001, 4, 0.59, 1.0, 157, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = join[LHS_JOIN_COL]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L419_C8", "label": "return", "type": "return", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "vector": [13, 2, 0.4262, 0.001, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [(alias, col, order)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "label": "get_from_clause", "type": "function", "loc": [421, 463], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.4496, 0.0437, 1, 0.24, 0.6, 318, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "get_from_clause", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_from_clause(self):\n \"\"\"\n Returns a list of strings that are joined together to go after the\n \"FROM\" part of the query, as well as a list any extra parameters that\n need to be included. Sub-classes, can override this to create a\n from-clause via a \"select\".\n\n This should only be called after any SQL construction methods that"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L422_C8", "label": "expression", "type": "expression", "loc": [422, 431], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [8, 2, 0.4339, 0.0102, 2, 0.61, 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 strings that are joined together to go after the\n \"FROM\" part of the query, as well as a list any extra parameters that\n need to be included. Sub-classes, can override this to create a\n from-clause via a \"select\".\n\n This should only be called after any SQL construction methods that\n might change the tables we need. This means the select columns and"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L432_C8", "label": "result =", "type": "assigned_variable", "loc": [432, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [14, 2, 0.4395, 0.001, 2, 0.61, 0.1429, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L433_C8", "label": "qn =", "type": "assigned_variable", "loc": [433, 433], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [14, 2, 0.4405, 0.001, 2, 0.61, 0.2857, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L434_C8", "label": "qn2 =", "type": "assigned_variable", "loc": [434, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [14, 2, 0.4415, 0.001, 2, 0.61, 0.4286, 240, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn2 = self.connection.ops.quote_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L435_C8", "label": "first =", "type": "assigned_variable", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [14, 2, 0.4425, 0.001, 2, 0.61, 0.5714, 199, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "label": "for alias", "type": "for", "loc": [436, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [6, 2, 0.4522, 0.0183, 2, 0.61, 0.7143, 657, 7, 0, 0, 0, 0, 0, 8], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for alias in self.query.tables:\n if not self.query.alias_refcount[alias]:\n continue\n try:\n name, alias, join_type, lhs, lhs_col, col, nullable = self.query.alias_map[alias]\n except KeyError:\n # Extra tables can end up in self.tables, but not in the\n # alias_map if they aren't in a join. That's OK. We skip them."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L437_C12", "label": "if", "type": "if", "loc": [437, 438], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "vector": [4, 3, 0.4451, 0.002, 3, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.query.alias_refcount[alias]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L439_C12", "label": "try", "type": "try", "loc": [439, 444], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "vector": [7, 3, 0.4491, 0.0061, 3, 0.33, 0.25, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n name, alias, join_type, lhs, lhs_col, col, nullable = self.query.alias_map[alias]\n except KeyError:\n # Extra tables can end up in self.tables, but not in the\n # alias_map if they aren't in a join. That's OK. We skip them.\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L440_C16", "label": "name, alias, join_type, lhs, lhs_col, col, nullable =", "type": "assigned_variable", "loc": [440, 440], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L439_C12", "vector": [14, 4, 0.4476, 0.001, 4, 0.7, 0.0, 972, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name, alias, join_type, lhs, lhs_col, col, nullable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name, alias, join_type, lhs, lhs_col, col, nullable = self.query.alias_map[alias]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L445_C12", "label": "alias_str =", "type": "assigned_variable", "loc": [445, 445], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "vector": [14, 3, 0.4527, 0.001, 3, 0.33, 0.5, 188, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias_str", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias_str = (alias != name and ' %s' % alias or '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "label": "if", "type": "if", "loc": [446, 452], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "vector": [4, 3, 0.4568, 0.0071, 3, 0.33, 0.75, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if join_type and not first:\n result.append('%s %s%s ON (%s.%s = %s.%s)'\n % (join_type, qn(name), alias_str, qn(lhs),\n qn2(lhs_col), qn(alias), qn2(col)))\n else:\n connector = not first and ', ' or ''\n result.append('%s%s%s' % (connector, qn(name), alias_str))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L447_C16", "label": "append()", "type": "expression", "loc": [447, 449], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "vector": [8, 4, 0.4557, 0.0031, 4, 0.24, 0.0, 243, 3, 1, 0, 0, 0, 0, 6], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s %s%s ON (%s.%s = %s.%s)'\n % (join_type, qn(name), alias_str, qn(lhs),\n qn2(lhs_col), qn(alias), qn2(col)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L451_C16", "label": "connector =", "type": "assigned_variable", "loc": [451, 451], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "vector": [14, 4, 0.4588, 0.001, 4, 0.24, 0.5, 385, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "connector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connector = not first and ', ' or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L452_C16", "label": "append()", "type": "expression", "loc": [452, 452], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "vector": [8, 4, 0.4598, 0.001, 4, 0.24, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s%s%s' % (connector, qn(name), alias_str))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L453_C12", "label": "first =", "type": "assigned_variable", "loc": [453, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "vector": [14, 3, 0.4608, 0.001, 3, 0.33, 1.0, 199, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8", "label": "for t", "type": "for", "loc": [454, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [6, 2, 0.4659, 0.0092, 2, 0.61, 0.8571, 15, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "t", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for t in self.query.extra_tables:\n alias, unused = self.query.table_alias(t)\n # Only add the alias if it's not already present (the table_alias()\n # calls increments the refcount, so an alias refcount of one means\n # this is the only reference.\n if alias not in self.query.alias_map or self.query.alias_refcount[alias] == 1:\n connector = not first and ', ' or ''\n result.append('%s%s' % (connector, qn(alias)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L455_C12", "label": "alias, unused = table_alias()", "type": "assigned_variable", "loc": [455, 455], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8", "vector": [14, 3, 0.4629, 0.001, 3, 0.17, 0.0, 281, 3, 1, 0, 0, 441, 10, 1], "semantic": {"name": "alias, unused", "arg_names": [], "import_names": [], "rhs_call_name": "table_alias", "annotation": ""}, "snippet": " alias, unused = self.query.table_alias(t)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "label": "if", "type": "if", "loc": [459, 462], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8", "vector": [4, 3, 0.4685, 0.0041, 3, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if alias not in self.query.alias_map or self.query.alias_refcount[alias] == 1:\n connector = not first and ', ' or ''\n result.append('%s%s' % (connector, qn(alias)))\n first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L460_C16", "label": "connector =", "type": "assigned_variable", "loc": [460, 460], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "vector": [14, 4, 0.468, 0.001, 4, 0.81, 0.0, 385, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "connector", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " connector = not first and ', ' or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L461_C16", "label": "append()", "type": "expression", "loc": [461, 461], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "vector": [8, 4, 0.469, 0.001, 4, 0.81, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s%s' % (connector, qn(alias)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L462_C16", "label": "first =", "type": "assigned_variable", "loc": [462, 462], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "vector": [14, 4, 0.47, 0.001, 4, 0.81, 1.0, 199, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "first", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " first = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L463_C8", "label": "return", "type": "return", "loc": [463, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "vector": [13, 2, 0.471, 0.001, 2, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "label": "get_grouping", "type": "function", "loc": [465, 489], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.4852, 0.0254, 1, 0.24, 0.6667, 944, 0, 1, 1, 0, 0, 0, 14], "semantic": {"name": "get_grouping", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_grouping(self):\n \"\"\"\n Returns a tuple representing the SQL elements in the \"group by\" clause.\n \"\"\"\n qn = self.quote_name_unless_alias\n result, params = [], []\n if self.query.group_by is not None:\n if len(self.query.model._meta.fields) == len(self.query.select) and \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L466_C8", "label": "expression", "type": "expression", "loc": [466, 468], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "vector": [8, 2, 0.4751, 0.0031, 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 a tuple representing the SQL elements in the \"group by\" clause.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L469_C8", "label": "qn =", "type": "assigned_variable", "loc": [469, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "vector": [14, 2, 0.4771, 0.001, 2, 0.46, 0.25, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L470_C8", "label": "result, params =", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "vector": [14, 2, 0.4781, 0.001, 2, 0.46, 0.5, 759, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "result, params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result, params = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "label": "if", "type": "if", "loc": [471, 488], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "vector": [4, 2, 0.4878, 0.0183, 2, 0.46, 0.75, 0, 0, 0, 0, 0, 0, 0, 14], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.group_by is not None:\n if len(self.query.model._meta.fields) == len(self.query.select) and \\\n self.connection.features.allows_group_by_pk:\n self.query.group_by = [(self.query.model._meta.db_table, self.query.model._meta.pk.column)]\n\n group_by = self.query.group_by or []\n\n extra_selects = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L472_C12", "label": "if", "type": "if", "loc": [472, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "vector": [4, 3, 0.4812, 0.0031, 3, 0.91, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.query.model._meta.fields) == len(self.query.select) and \\\n self.connection.features.allows_group_by_pk:\n self.query.group_by = [(self.query.model._meta.db_table, self.query.model._meta.pk.column)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L474_C16", "label": "self.query.group_by =", "type": "assigned_variable", "loc": [474, 474], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L472_C12", "vector": [14, 4, 0.4822, 0.001, 4, 0.89, 0.0, 876, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.query.group_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.group_by = [(self.query.model._meta.db_table, self.query.model._meta.pk.column)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L476_C12", "label": "group_by =", "type": "assigned_variable", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "vector": [14, 3, 0.4842, 0.001, 3, 0.91, 0.25, 282, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "group_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " group_by = self.query.group_by or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L478_C12", "label": "extra_selects =", "type": "assigned_variable", "loc": [478, 478], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "vector": [14, 3, 0.4863, 0.001, 3, 0.91, 0.5, 17, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "extra_selects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extra_selects = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12", "label": "for extra_select, extra_params", "type": "for", "loc": [479, 481], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "vector": [6, 3, 0.4883, 0.0031, 3, 0.91, 0.75, 692, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "extra_select, extra_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for extra_select, extra_params in self.query.extra_select.itervalues():\n extra_selects.append(extra_select)\n params.extend(extra_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L480_C16", "label": "append()", "type": "expression", "loc": [480, 480], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12", "vector": [8, 4, 0.4883, 0.001, 4, 0.17, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " extra_selects.append(extra_select)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L481_C16", "label": "extend()", "type": "expression", "loc": [481, 481], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12", "vector": [8, 4, 0.4893, 0.001, 4, 0.17, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " params.extend(extra_params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L482_C12", "label": "for col", "type": "for", "loc": [482, 488], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "vector": [6, 3, 0.4934, 0.0071, 3, 0.91, 1.0, 157, 4, 0, 0, 0, 0, 0, 9], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for col in group_by + self.query.related_select_cols + extra_selects:\n if isinstance(col, (list, tuple)):\n result.append('%s.%s' % (qn(col[0]), qn(col[1])))\n elif hasattr(col, 'as_sql'):\n result.append(col.as_sql(qn))\n else:\n result.append('(%s)' % str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16", "label": "if", "type": "if", "loc": [483, 488], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L482_C12", "vector": [4, 4, 0.4939, 0.0061, 4, 0.05, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(col, (list, tuple)):\n result.append('%s.%s' % (qn(col[0]), qn(col[1])))\n elif hasattr(col, 'as_sql'):\n result.append(col.as_sql(qn))\n else:\n result.append('(%s)' % str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L484_C20", "label": "append()", "type": "expression", "loc": [484, 484], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16", "vector": [8, 5, 0.4924, 0.001, 5, 0.45, 0.0, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('%s.%s' % (qn(col[0]), qn(col[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16", "label": "if", "type": "if", "loc": [485, 488], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16", "vector": [4, 5, 0.4949, 0.0041, 5, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(col, 'as_sql'):\n result.append(col.as_sql(qn))\n else:\n result.append('(%s)' % str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L486_C20", "label": "append()", "type": "expression", "loc": [486, 486], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16", "vector": [8, 6, 0.4944, 0.001, 6, 0.1, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(col.as_sql(qn))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L488_C20", "label": "append()", "type": "expression", "loc": [488, 488], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16", "vector": [8, 6, 0.4964, 0.001, 6, 0.1, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('(%s)' % str(col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L489_C8", "label": "return", "type": "return", "loc": [489, 489], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "vector": [13, 2, 0.4975, 0.001, 2, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result, params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "label": "fill_related_selections", "type": "function", "loc": [491, 657], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.5839, 0.1699, 1, 0.24, 0.7333, 684, 0, 10, 0, 0, 0, 0, 60], "semantic": {"name": "fill_related_selections", "arg_names": ["self", "opts", "root_alias", "cur_depth", "used", "requested", "restricted", "nullable", "dupe_set", "avoid_set"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fill_related_selections(self, opts=None, root_alias=None, cur_depth=1,\n used=None, requested=None, restricted=None, nullable=None,\n dupe_set=None, avoid_set=None):\n \"\"\"\n Fill in the information needed for a select_related query. The current\n depth is measured as the number of connections away from the root model\n (for example, cur_depth=1 means we are looking at models with direct\n connections to the root model)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L494_C8", "label": "expression", "type": "expression", "loc": [494, 499], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [8, 2, 0.5051, 0.0061, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Fill in the information needed for a select_related query. The current\n depth is measured as the number of connections away from the root model\n (for example, cur_depth=1 means we are looking at models with direct\n connections to the root model).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L500_C8", "label": "if", "type": "if", "loc": [500, 502], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5097, 0.0031, 2, 0.81, 0.1111, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not restricted and self.query.max_depth and cur_depth > self.query.max_depth:\n # We've recursed far enough; bail out.\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L502_C12", "label": "return", "type": "return", "loc": [502, 502], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L500_C8", "vector": [13, 3, 0.5107, 0.001, 3, 0.14, 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_99011:If_L504_C8", "label": "if", "type": "if", "loc": [504, 508], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5148, 0.0051, 2, 0.81, 0.2222, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not opts:\n opts = self.query.get_meta()\n root_alias = self.query.get_initial_alias()\n self.query.related_select_cols = []\n self.query.related_select_fields = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L505_C12", "label": "opts = get_meta()", "type": "assigned_variable", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "vector": [14, 3, 0.5137, 0.001, 3, 0.96, 0.0, 631, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "get_meta", "annotation": ""}, "snippet": " opts = self.query.get_meta()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L506_C12", "label": "root_alias = get_initial_alias()", "type": "assigned_variable", "loc": [506, 506], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "vector": [14, 3, 0.5148, 0.001, 3, 0.96, 0.3333, 482, 3, 0, 0, 0, 296, 10, 1], "semantic": {"name": "root_alias", "arg_names": [], "import_names": [], "rhs_call_name": "get_initial_alias", "annotation": ""}, "snippet": " root_alias = self.query.get_initial_alias()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L507_C12", "label": "self.query.related_select_cols =", "type": "assigned_variable", "loc": [507, 507], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "vector": [14, 3, 0.5158, 0.001, 3, 0.96, 0.6667, 19, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.query.related_select_cols", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.related_select_cols = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L508_C12", "label": "self.query.related_select_fields =", "type": "assigned_variable", "loc": [508, 508], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "vector": [14, 3, 0.5168, 0.001, 3, 0.96, 1.0, 692, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.query.related_select_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.related_select_fields = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L509_C8", "label": "if", "type": "if", "loc": [509, 510], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5183, 0.002, 2, 0.81, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not used:\n used = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L510_C12", "label": "used = set()", "type": "assigned_variable", "loc": [510, 510], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L509_C8", "vector": [14, 3, 0.5188, 0.001, 3, 0.65, 0.0, 898, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "used", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " used = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L511_C8", "label": "if", "type": "if", "loc": [511, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5203, 0.002, 2, 0.81, 0.4444, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dupe_set is None:\n dupe_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L512_C12", "label": "dupe_set = set()", "type": "assigned_variable", "loc": [512, 512], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L511_C8", "vector": [14, 3, 0.5209, 0.001, 3, 0.01, 0.0, 801, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "dupe_set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " dupe_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L513_C8", "label": "if", "type": "if", "loc": [513, 514], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5224, 0.002, 2, 0.81, 0.5556, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if avoid_set is None:\n avoid_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L514_C12", "label": "avoid_set = set()", "type": "assigned_variable", "loc": [514, 514], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L513_C8", "vector": [14, 3, 0.5229, 0.001, 3, 0.44, 0.0, 635, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "avoid_set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " avoid_set = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L515_C8", "label": "orig_dupe_set =", "type": "assigned_variable", "loc": [515, 515], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [14, 2, 0.5239, 0.001, 2, 0.81, 0.6667, 751, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "orig_dupe_set", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " orig_dupe_set = dupe_set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L519_C8", "label": "if", "type": "if", "loc": [519, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.5305, 0.0061, 2, 0.81, 0.7778, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if requested is None:\n if isinstance(self.query.select_related, dict):\n requested = self.query.select_related\n restricted = True\n else:\n restricted = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "label": "if", "type": "if", "loc": [520, 524], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L519_C8", "vector": [4, 3, 0.531, 0.0051, 3, 0.08, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.query.select_related, dict):\n requested = self.query.select_related\n restricted = True\n else:\n restricted = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L521_C16", "label": "requested =", "type": "assigned_variable", "loc": [521, 521], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "vector": [14, 4, 0.53, 0.001, 4, 0.64, 0.0, 454, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "requested", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " requested = self.query.select_related"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L522_C16", "label": "restricted =", "type": "assigned_variable", "loc": [522, 522], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "vector": [14, 4, 0.531, 0.001, 4, 0.64, 0.5, 844, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "restricted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " restricted = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L524_C16", "label": "restricted =", "type": "assigned_variable", "loc": [524, 524], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "vector": [14, 4, 0.5331, 0.001, 4, 0.64, 1.0, 844, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "restricted", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " restricted = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "label": "for f, model", "type": "for", "loc": [526, 591], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [6, 2, 0.5682, 0.0671, 2, 0.81, 0.8889, 760, 3, 0, 0, 0, 0, 0, 28], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in opts.get_fields_with_model():\n if not select_related_descend(f, restricted, requested):\n continue\n # The \"avoid\" set is aliases we want to avoid just for this\n # particular branch of the recursion. They aren't permanently\n # forbidden from reuse in the related selection tables (which is\n # what \"used\" specifies).\n avoid = avoid_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L527_C12", "label": "if", "type": "if", "loc": [527, 528], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [4, 3, 0.5366, 0.002, 3, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not select_related_descend(f, restricted, requested):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L533_C12", "label": "avoid = copy()", "type": "assigned_variable", "loc": [533, 533], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5422, 0.001, 3, 0.31, 0.0588, 880, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "avoid", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " avoid = avoid_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L534_C12", "label": "dupe_set = copy()", "type": "assigned_variable", "loc": [534, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5432, 0.001, 3, 0.31, 0.1176, 801, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "dupe_set", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " dupe_set = orig_dupe_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L535_C12", "label": "table =", "type": "assigned_variable", "loc": [535, 535], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5443, 0.001, 3, 0.31, 0.1765, 338, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = f.rel.to._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L536_C12", "label": "promote =", "type": "assigned_variable", "loc": [536, 536], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5453, 0.001, 3, 0.31, 0.2353, 137, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "promote", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " promote = nullable or f.null"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "label": "if", "type": "if", "loc": [537, 565], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [4, 3, 0.5605, 0.0295, 3, 0.31, 0.2941, 0, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model:\n int_opts = opts\n alias = root_alias\n alias_chain = []\n for int_model in opts.get_base_chain(model):\n # Proxy model have elements in base chain\n # with no parents, assign the new options\n # object and skip to the next base in that"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L538_C16", "label": "int_opts =", "type": "assigned_variable", "loc": [538, 538], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [14, 4, 0.5473, 0.001, 4, 0.64, 0.0, 167, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = opts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L539_C16", "label": "alias =", "type": "assigned_variable", "loc": [539, 539], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [14, 4, 0.5483, 0.001, 4, 0.64, 0.2, 657, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = root_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L540_C16", "label": "alias_chain =", "type": "assigned_variable", "loc": [540, 540], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [14, 4, 0.5493, 0.001, 4, 0.64, 0.4, 758, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alias_chain", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias_chain = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "label": "for int_model", "type": "for", "loc": [541, 561], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [6, 4, 0.5605, 0.0214, 4, 0.64, 0.6, 98, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "int_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for int_model in opts.get_base_chain(model):\n # Proxy model have elements in base chain\n # with no parents, assign the new options\n # object and skip to the next base in that\n # case\n if not int_opts.parents[int_model]:\n int_opts = int_model._meta\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L546_C20", "label": "if", "type": "if", "loc": [546, 548], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [4, 5, 0.5565, 0.0031, 5, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not int_opts.parents[int_model]:\n int_opts = int_model._meta\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L547_C24", "label": "int_opts =", "type": "assigned_variable", "loc": [547, 547], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L546_C20", "vector": [14, 6, 0.5565, 0.001, 6, 0.1, 0.0, 167, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = int_model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L549_C20", "label": "lhs_col =", "type": "assigned_variable", "loc": [549, 549], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [14, 5, 0.5585, 0.001, 5, 0.59, 0.1429, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lhs_col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lhs_col = int_opts.parents[int_model].column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L550_C20", "label": "dedupe =", "type": "assigned_variable", "loc": [550, 550], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [14, 5, 0.5595, 0.001, 5, 0.59, 0.2857, 822, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dedupe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dedupe = lhs_col in opts.duplicate_targets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20", "label": "if", "type": "if", "loc": [551, 554], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [4, 5, 0.5621, 0.0041, 5, 0.59, 0.4286, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dedupe:\n avoid.update(self.query.dupe_avoidance.get((id(opts), lhs_col),\n ()))\n dupe_set.add((opts, lhs_col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L552_C24", "label": "update()", "type": "expression", "loc": [552, 553], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20", "vector": [8, 6, 0.5621, 0.002, 6, 0.54, 0.0, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " avoid.update(self.query.dupe_avoidance.get((id(opts), lhs_col),\n ()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L554_C24", "label": "add()", "type": "expression", "loc": [554, 554], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20", "vector": [8, 6, 0.5636, 0.001, 6, 0.54, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " dupe_set.add((opts, lhs_col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L555_C20", "label": "int_opts =", "type": "assigned_variable", "loc": [555, 555], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [14, 5, 0.5646, 0.001, 5, 0.59, 0.5714, 167, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = int_model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L556_C20", "label": "alias = join()", "type": "assigned_variable", "loc": [556, 558], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [14, 5, 0.5666, 0.0031, 5, 0.59, 0.7143, 657, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " alias = self.query.join((alias, int_opts.db_table, lhs_col,\n int_opts.pk.column), exclusions=used,\n promote=promote)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L559_C20", "label": "append()", "type": "expression", "loc": [559, 559], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [8, 5, 0.5687, 0.001, 5, 0.59, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alias_chain.append(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L560_C20", "label": "for dupe_opts, dupe_col", "type": "for", "loc": [560, 561], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "vector": [6, 5, 0.5702, 0.002, 5, 0.59, 1.0, 786, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dupe_opts, dupe_col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for (dupe_opts, dupe_col) in dupe_set:\n self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L561_C24", "label": "update_dupe_avoidance()", "type": "expression", "loc": [561, 561], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L560_C20", "vector": [8, 6, 0.5707, 0.001, 6, 0.73, 0.0, 235, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "update_dupe_avoidance", "arg_names": [], "import_names": [], "rhs_call_name": "update_dupe_avoidance", "annotation": ""}, "snippet": " self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L562_C16", "label": "if", "type": "if", "loc": [562, 563], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [4, 4, 0.5722, 0.002, 4, 0.64, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.alias_map[root_alias][JOIN_TYPE] == self.query.LOUTER:\n self.query.promote_alias_chain(alias_chain, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L563_C20", "label": "promote_alias_chain()", "type": "expression", "loc": [563, 563], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L562_C16", "vector": [8, 5, 0.5727, 0.001, 5, 0.72, 0.0, 76, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "promote_alias_chain", "arg_names": [], "import_names": [], "rhs_call_name": "promote_alias_chain", "annotation": ""}, "snippet": " self.query.promote_alias_chain(alias_chain, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L565_C16", "label": "alias =", "type": "assigned_variable", "loc": [565, 565], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "vector": [14, 4, 0.5748, 0.001, 4, 0.64, 1.0, 657, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = root_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L567_C12", "label": "dedupe =", "type": "assigned_variable", "loc": [567, 567], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5768, 0.001, 3, 0.31, 0.3529, 822, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dedupe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dedupe = f.column in opts.duplicate_targets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12", "label": "if", "type": "if", "loc": [568, 571], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [4, 3, 0.5793, 0.0041, 3, 0.31, 0.4118, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dupe_set or dedupe:\n avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))\n if dedupe:\n dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L569_C16", "label": "update()", "type": "expression", "loc": [569, 569], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12", "vector": [8, 4, 0.5788, 0.001, 4, 0.0, 0.0, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L570_C16", "label": "if", "type": "if", "loc": [570, 571], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12", "vector": [4, 4, 0.5804, 0.002, 4, 0.0, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dedupe:\n dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L571_C20", "label": "add()", "type": "expression", "loc": [571, 571], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L570_C16", "vector": [8, 5, 0.5809, 0.001, 5, 0.99, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L573_C12", "label": "alias = join()", "type": "assigned_variable", "loc": [573, 575], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5839, 0.0031, 3, 0.31, 0.4706, 657, 3, 3, 0, 0, 933, 10, 3], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " alias = self.query.join((alias, table, f.column,\n f.rel.get_related_field().column),\n exclusions=used.union(avoid), promote=promote)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L576_C12", "label": "add()", "type": "expression", "loc": [576, 576], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [8, 3, 0.586, 0.001, 3, 0.31, 0.5294, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " used.add(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L577_C12", "label": "columns, aliases = get_default_columns()", "type": "assigned_variable", "loc": [577, 578], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5875, 0.002, 3, 0.31, 0.5882, 87, 3, 3, 0, 0, 149, 10, 1], "semantic": {"name": "columns, aliases", "arg_names": [], "import_names": [], "rhs_call_name": "get_default_columns", "annotation": ""}, "snippet": " columns, aliases = self.get_default_columns(start_alias=alias,\n opts=f.rel.to._meta, as_pairs=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L579_C12", "label": "extend()", "type": "expression", "loc": [579, 579], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [8, 3, 0.589, 0.001, 3, 0.31, 0.6471, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.query.related_select_cols.extend(columns)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L580_C12", "label": "if", "type": "if", "loc": [580, 581], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [4, 3, 0.5905, 0.002, 3, 0.31, 0.7059, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.alias_map[alias][JOIN_TYPE] == self.query.LOUTER:\n self.query.promote_alias_chain(aliases, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L581_C16", "label": "promote_alias_chain()", "type": "expression", "loc": [581, 581], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L580_C12", "vector": [8, 4, 0.591, 0.001, 4, 0.71, 0.0, 76, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "promote_alias_chain", "arg_names": [], "import_names": [], "rhs_call_name": "promote_alias_chain", "annotation": ""}, "snippet": " self.query.promote_alias_chain(aliases, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L582_C12", "label": "extend()", "type": "expression", "loc": [582, 582], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [8, 3, 0.5921, 0.001, 3, 0.31, 0.7647, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.query.related_select_fields.extend(f.rel.to._meta.fields)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12", "label": "if", "type": "if", "loc": [583, 586], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [4, 3, 0.5946, 0.0041, 3, 0.31, 0.8235, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if restricted:\n next = requested.get(f.name, {})\n else:\n next = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L584_C16", "label": "next = get()", "type": "assigned_variable", "loc": [584, 584], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12", "vector": [14, 4, 0.5941, 0.001, 4, 0.48, 0.0, 11, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "next", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " next = requested.get(f.name, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L586_C16", "label": "next =", "type": "assigned_variable", "loc": [586, 586], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12", "vector": [14, 4, 0.5961, 0.001, 4, 0.48, 1.0, 11, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "next", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " next = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L587_C12", "label": "new_nullable =", "type": "assigned_variable", "loc": [587, 587], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [14, 3, 0.5972, 0.001, 3, 0.31, 0.8824, 356, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_nullable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_nullable = f.null or promote"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L588_C12", "label": "for dupe_opts, dupe_col", "type": "for", "loc": [588, 589], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [6, 3, 0.5987, 0.002, 3, 0.31, 0.9412, 786, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dupe_opts, dupe_col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dupe_opts, dupe_col in dupe_set:\n self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L589_C16", "label": "update_dupe_avoidance()", "type": "expression", "loc": [589, 589], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L588_C12", "vector": [8, 4, 0.5992, 0.001, 4, 0.98, 0.0, 235, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "update_dupe_avoidance", "arg_names": [], "import_names": [], "rhs_call_name": "update_dupe_avoidance", "annotation": ""}, "snippet": " self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L590_C12", "label": "fill_related_selections()", "type": "expression", "loc": [590, 591], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "vector": [8, 3, 0.6007, 0.002, 3, 0.31, 1.0, 684, 3, 9, 0, 0, 0, 0, 1], "semantic": {"name": "fill_related_selections", "arg_names": [], "import_names": [], "rhs_call_name": "fill_related_selections", "annotation": ""}, "snippet": " self.fill_related_selections(f.rel.to._meta, alias, cur_depth + 1,\n used, next, restricted, new_nullable, dupe_set, avoid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8", "label": "if", "type": "if", "loc": [593, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "vector": [4, 2, 0.6358, 0.0661, 2, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if restricted:\n related_fields = [\n (o.field, o.model)\n for o in opts.get_all_related_objects()\n if o.field.unique\n ]\n for f, model in related_fields:\n if not select_related_descend(f, restricted, requested, reverse=True):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L594_C12", "label": "related_fields =", "type": "assigned_variable", "loc": [594, 598], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8", "vector": [14, 3, 0.6063, 0.0051, 3, 0.79, 0.0, 518, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "related_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " related_fields = [\n (o.field, o.model)\n for o in opts.get_all_related_objects()\n if o.field.unique\n ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "label": "for f, model", "type": "for", "loc": [599, 657], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8", "vector": [6, 3, 0.6389, 0.06, 3, 0.79, 1.0, 760, 2, 0, 0, 0, 0, 0, 25], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in related_fields:\n if not select_related_descend(f, restricted, requested, reverse=True):\n continue\n # The \"avoid\" set is aliases we want to avoid just for this\n # particular branch of the recursion. They aren't permanently\n # forbidden from reuse in the related selection tables (which is\n # what \"used\" specifies).\n avoid = avoid_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L600_C16", "label": "if", "type": "if", "loc": [600, 601], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [4, 4, 0.6109, 0.002, 4, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not select_related_descend(f, restricted, requested, reverse=True):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L606_C16", "label": "avoid = copy()", "type": "assigned_variable", "loc": [606, 606], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6165, 0.001, 4, 0.23, 0.0625, 880, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "avoid", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " avoid = avoid_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L607_C16", "label": "dupe_set = copy()", "type": "assigned_variable", "loc": [607, 607], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6175, 0.001, 4, 0.23, 0.125, 801, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "dupe_set", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " dupe_set = orig_dupe_set.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L608_C16", "label": "table =", "type": "assigned_variable", "loc": [608, 608], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6185, 0.001, 4, 0.23, 0.1875, 338, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = model._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L610_C16", "label": "int_opts =", "type": "assigned_variable", "loc": [610, 610], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6205, 0.001, 4, 0.23, 0.25, 167, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = opts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L611_C16", "label": "alias =", "type": "assigned_variable", "loc": [611, 611], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6216, 0.001, 4, 0.23, 0.3125, 657, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = root_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L612_C16", "label": "alias_chain =", "type": "assigned_variable", "loc": [612, 612], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6226, 0.001, 4, 0.23, 0.375, 758, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "alias_chain", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias_chain = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L613_C16", "label": "chain = get_base_chain()", "type": "assigned_variable", "loc": [613, 613], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6236, 0.001, 4, 0.23, 0.4375, 271, 3, 1, 0, 0, 291, 10, 1], "semantic": {"name": "chain", "arg_names": [], "import_names": [], "rhs_call_name": "get_base_chain", "annotation": ""}, "snippet": " chain = opts.get_base_chain(f.rel.to)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "label": "if", "type": "if", "loc": [614, 641], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [4, 4, 0.6384, 0.0285, 4, 0.23, 0.5, 0, 0, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if chain is not None:\n for int_model in chain:\n # Proxy model have elements in base chain\n # with no parents, assign the new options\n # object and skip to the next base in that\n # case\n if not int_opts.parents[int_model]:\n int_opts = int_model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "label": "for int_model", "type": "for", "loc": [615, 636], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "vector": [6, 5, 0.6363, 0.0224, 5, 0.38, 0.0, 98, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "int_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for int_model in chain:\n # Proxy model have elements in base chain\n # with no parents, assign the new options\n # object and skip to the next base in that\n # case\n if not int_opts.parents[int_model]:\n int_opts = int_model._meta\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L620_C24", "label": "if", "type": "if", "loc": [620, 622], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [4, 6, 0.6317, 0.0031, 6, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not int_opts.parents[int_model]:\n int_opts = int_model._meta\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L621_C28", "label": "int_opts =", "type": "assigned_variable", "loc": [621, 621], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L620_C24", "vector": [14, 7, 0.6317, 0.001, 7, 0.3, 0.0, 167, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = int_model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L623_C24", "label": "lhs_col =", "type": "assigned_variable", "loc": [623, 623], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [14, 6, 0.6338, 0.001, 6, 0.32, 0.1429, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lhs_col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lhs_col = int_opts.parents[int_model].column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L624_C24", "label": "dedupe =", "type": "assigned_variable", "loc": [624, 624], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [14, 6, 0.6348, 0.001, 6, 0.32, 0.2857, 822, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dedupe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dedupe = lhs_col in opts.duplicate_targets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24", "label": "if", "type": "if", "loc": [625, 628], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [4, 6, 0.6373, 0.0041, 6, 0.32, 0.4286, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dedupe:\n avoid.update((self.query.dupe_avoidance.get(id(opts), lhs_col),\n ()))\n dupe_set.add((opts, lhs_col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L626_C28", "label": "update()", "type": "expression", "loc": [626, 627], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24", "vector": [8, 7, 0.6373, 0.002, 7, 0.71, 0.0, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " avoid.update((self.query.dupe_avoidance.get(id(opts), lhs_col),\n ()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L628_C28", "label": "add()", "type": "expression", "loc": [628, 628], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24", "vector": [8, 7, 0.6389, 0.001, 7, 0.71, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " dupe_set.add((opts, lhs_col))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L629_C24", "label": "int_opts =", "type": "assigned_variable", "loc": [629, 629], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [14, 6, 0.6399, 0.001, 6, 0.32, 0.5714, 167, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "int_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " int_opts = int_model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L630_C24", "label": "alias = join()", "type": "assigned_variable", "loc": [630, 633], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [14, 6, 0.6424, 0.0041, 6, 0.32, 0.7143, 657, 3, 4, 0, 0, 933, 10, 1], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " alias = self.query.join(\n (alias, int_opts.db_table, lhs_col, int_opts.pk.column),\n exclusions=used, promote=True, reuse=used\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L634_C24", "label": "append()", "type": "expression", "loc": [634, 634], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [8, 6, 0.645, 0.001, 6, 0.32, 0.8571, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " alias_chain.append(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L635_C24", "label": "for dupe_opts, dupe_col", "type": "for", "loc": [635, 636], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "vector": [6, 6, 0.6465, 0.002, 6, 0.32, 1.0, 786, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "dupe_opts, dupe_col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dupe_opts, dupe_col in dupe_set:\n self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L636_C28", "label": "update_dupe_avoidance()", "type": "expression", "loc": [636, 636], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L635_C24", "vector": [8, 7, 0.647, 0.001, 7, 0.52, 0.0, 235, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "update_dupe_avoidance", "arg_names": [], "import_names": [], "rhs_call_name": "update_dupe_avoidance", "annotation": ""}, "snippet": " self.query.update_dupe_avoidance(dupe_opts, dupe_col, alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L637_C20", "label": "dedupe =", "type": "assigned_variable", "loc": [637, 637], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "vector": [14, 5, 0.648, 0.001, 5, 0.38, 0.5, 822, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "dedupe", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dedupe = f.column in opts.duplicate_targets"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20", "label": "if", "type": "if", "loc": [638, 641], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "vector": [4, 5, 0.6506, 0.0041, 5, 0.38, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dupe_set or dedupe:\n avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))\n if dedupe:\n dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L639_C24", "label": "update()", "type": "expression", "loc": [639, 639], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20", "vector": [8, 6, 0.6501, 0.001, 6, 0.73, 0.0, 637, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " avoid.update(self.query.dupe_avoidance.get((id(opts), f.column), ()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L640_C24", "label": "if", "type": "if", "loc": [640, 641], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20", "vector": [4, 6, 0.6516, 0.002, 6, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dedupe:\n dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L641_C28", "label": "add()", "type": "expression", "loc": [641, 641], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L640_C24", "vector": [8, 7, 0.6521, 0.001, 7, 0.62, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " dupe_set.add((opts, f.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L642_C16", "label": "alias = join()", "type": "assigned_variable", "loc": [642, 646], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6551, 0.0051, 4, 0.23, 0.5625, 657, 3, 3, 0, 0, 933, 10, 3], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " alias = self.query.join(\n (alias, table, f.rel.get_related_field().column, f.column),\n exclusions=used.union(avoid),\n promote=True\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L647_C16", "label": "add()", "type": "expression", "loc": [647, 647], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [8, 4, 0.6582, 0.001, 4, 0.23, 0.625, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " used.add(alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L648_C16", "label": "columns, aliases = get_default_columns()", "type": "assigned_variable", "loc": [648, 649], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6597, 0.002, 4, 0.23, 0.6875, 87, 3, 4, 0, 0, 149, 10, 1], "semantic": {"name": "columns, aliases", "arg_names": [], "import_names": [], "rhs_call_name": "get_default_columns", "annotation": ""}, "snippet": " columns, aliases = self.get_default_columns(start_alias=alias,\n opts=model._meta, as_pairs=True, local_only=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L650_C16", "label": "extend()", "type": "expression", "loc": [650, 650], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [8, 4, 0.6612, 0.001, 4, 0.23, 0.75, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.query.related_select_cols.extend(columns)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L651_C16", "label": "extend()", "type": "expression", "loc": [651, 651], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [8, 4, 0.6623, 0.001, 4, 0.23, 0.8125, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.query.related_select_fields.extend(model._meta.fields)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L653_C16", "label": "next = get()", "type": "assigned_variable", "loc": [653, 653], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6643, 0.001, 4, 0.23, 0.875, 11, 3, 2, 0, 0, 607, 10, 2], "semantic": {"name": "next", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " next = requested.get(f.related_query_name(), {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L654_C16", "label": "new_nullable =", "type": "assigned_variable", "loc": [654, 654], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [14, 4, 0.6653, 0.001, 4, 0.23, 0.9375, 356, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "new_nullable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_nullable = f.null or None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L656_C16", "label": "fill_related_selections()", "type": "expression", "loc": [656, 657], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "vector": [8, 4, 0.6679, 0.002, 4, 0.23, 1.0, 684, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "fill_related_selections", "arg_names": [], "import_names": [], "rhs_call_name": "fill_related_selections", "annotation": ""}, "snippet": " self.fill_related_selections(model._meta, table, cur_depth+1,\n used, next, restricted, new_nullable)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "label": "deferred_to_columns", "type": "function", "loc": [659, 667], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.6745, 0.0092, 1, 0.24, 0.8, 25, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "deferred_to_columns", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def deferred_to_columns(self):\n \"\"\"\n Converts the self.deferred_loading data structure to mapping of table\n names to sets of column names which are to be loaded. Returns the\n dictionary.\n \"\"\"\n columns = {}\n self.query.deferred_to_data(columns, self.query.deferred_to_columns_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L660_C8", "label": "expression", "type": "expression", "loc": [660, 664], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "vector": [8, 2, 0.6734, 0.0051, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Converts the self.deferred_loading data structure to mapping of table\n names to sets of column names which are to be loaded. Returns the\n dictionary.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L665_C8", "label": "columns =", "type": "assigned_variable", "loc": [665, 665], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "vector": [14, 2, 0.6765, 0.001, 2, 0.18, 0.3333, 225, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " columns = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L666_C8", "label": "deferred_to_data()", "type": "expression", "loc": [666, 666], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "vector": [8, 2, 0.6775, 0.001, 2, 0.18, 0.6667, 973, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "deferred_to_data", "arg_names": [], "import_names": [], "rhs_call_name": "deferred_to_data", "annotation": ""}, "snippet": " self.query.deferred_to_data(columns, self.query.deferred_to_columns_cb)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L667_C8", "label": "return", "type": "return", "loc": [667, 667], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "vector": [13, 2, 0.6785, 0.001, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return columns"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "label": "results_iter", "type": "function", "loc": [669, 704], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.6984, 0.0366, 1, 0.24, 0.8667, 352, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "results_iter", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def results_iter(self):\n \"\"\"\n Returns an iterator over the results from executing this query.\n \"\"\"\n resolve_columns = hasattr(self, 'resolve_columns')\n fields = None\n for rows in self.execute_sql(MULTI):\n for row in rows:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L670_C8", "label": "expression", "type": "expression", "loc": [670, 672], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "vector": [8, 2, 0.6826, 0.0031, 2, 0.38, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns an iterator over the results from executing this query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L673_C8", "label": "resolve_columns = hasattr()", "type": "assigned_variable", "loc": [673, 673], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "vector": [14, 2, 0.6846, 0.001, 2, 0.38, 0.3333, 224, 3, 2, 0, 0, 720, 10, 1], "semantic": {"name": "resolve_columns", "arg_names": [], "import_names": [], "rhs_call_name": "hasattr", "annotation": ""}, "snippet": " resolve_columns = hasattr(self, 'resolve_columns')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L674_C8", "label": "fields =", "type": "assigned_variable", "loc": [674, 674], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "vector": [14, 2, 0.6857, 0.001, 2, 0.38, 0.6667, 358, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fields = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L675_C8", "label": "for rows", "type": "for", "loc": [675, 704], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "vector": [6, 2, 0.7014, 0.0305, 2, 0.38, 1.0, 275, 3, 0, 0, 0, 0, 0, 13], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rows in self.execute_sql(MULTI):\n for row in rows:\n if resolve_columns:\n if fields is None:\n # We only set this up here because\n # related_select_fields isn't populated until\n # execute_sql() has been called.\n if self.query.select_fields:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "label": "for row", "type": "for", "loc": [676, 704], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L675_C8", "vector": [6, 3, 0.7019, 0.0295, 3, 0.92, 0.0, 767, 2, 0, 0, 0, 0, 0, 12], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in rows:\n if resolve_columns:\n if fields is None:\n # We only set this up here because\n # related_select_fields isn't populated until\n # execute_sql() has been called.\n if self.query.select_fields:\n fields = self.query.select_fields + self.query.related_select_fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16", "label": "if", "type": "if", "loc": [677, 693], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "vector": [4, 4, 0.6968, 0.0173, 4, 0.15, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resolve_columns:\n if fields is None:\n # We only set this up here because\n # related_select_fields isn't populated until\n # execute_sql() has been called.\n if self.query.select_fields:\n fields = self.query.select_fields + self.query.related_select_fields\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "label": "if", "type": "if", "loc": [678, 692], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16", "vector": [4, 5, 0.6968, 0.0153, 5, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fields is None:\n # We only set this up here because\n # related_select_fields isn't populated until\n # execute_sql() has been called.\n if self.query.select_fields:\n fields = self.query.select_fields + self.query.related_select_fields\n else:\n fields = self.query.model._meta.fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24", "label": "if", "type": "if", "loc": [682, 685], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "vector": [4, 6, 0.6953, 0.0041, 6, 0.6, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.select_fields:\n fields = self.query.select_fields + self.query.related_select_fields\n else:\n fields = self.query.model._meta.fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L683_C28", "label": "fields =", "type": "assigned_variable", "loc": [683, 683], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24", "vector": [14, 7, 0.6948, 0.001, 7, 0.87, 0.0, 358, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fields = self.query.select_fields + self.query.related_select_fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L685_C28", "label": "fields =", "type": "assigned_variable", "loc": [685, 685], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24", "vector": [14, 7, 0.6968, 0.001, 7, 0.87, 1.0, 358, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fields = self.query.model._meta.fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L688_C24", "label": "only_load = deferred_to_columns()", "type": "assigned_variable", "loc": [688, 688], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "vector": [14, 6, 0.6999, 0.001, 6, 0.6, 0.5, 982, 3, 0, 0, 0, 25, 10, 1], "semantic": {"name": "only_load", "arg_names": [], "import_names": [], "rhs_call_name": "deferred_to_columns", "annotation": ""}, "snippet": " only_load = self.deferred_to_columns()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24", "label": "if", "type": "if", "loc": [689, 692], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "vector": [4, 6, 0.7024, 0.0041, 6, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if only_load:\n db_table = self.query.model._meta.db_table\n fields = [f for f in fields if db_table in only_load and\n f.column in only_load[db_table]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L690_C28", "label": "db_table =", "type": "assigned_variable", "loc": [690, 690], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24", "vector": [14, 7, 0.7019, 0.001, 7, 0.65, 0.0, 111, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "db_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db_table = self.query.model._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L691_C28", "label": "fields =", "type": "assigned_variable", "loc": [691, 692], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24", "vector": [14, 7, 0.7035, 0.002, 7, 0.65, 1.0, 358, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fields = [f for f in fields if db_table in only_load and\n f.column in only_load[db_table]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L693_C20", "label": "row = resolve_columns()", "type": "assigned_variable", "loc": [693, 693], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16", "vector": [14, 5, 0.705, 0.001, 5, 0.09, 1.0, 767, 3, 2, 0, 0, 224, 10, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "resolve_columns", "annotation": ""}, "snippet": " row = self.resolve_columns(row, fields)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "label": "if", "type": "if", "loc": [695, 702], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "vector": [4, 4, 0.7106, 0.0081, 4, 0.15, 0.5, 0, 7, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.aggregate_select:\n aggregate_start = len(self.query.extra_select.keys()) + len(self.query.select)\n aggregate_end = aggregate_start + len(self.query.aggregate_select)\n row = tuple(row[:aggregate_start]) + tuple([\n self.query.resolve_aggregate(value, aggregate, self.connection)\n for (alias, aggregate), value\n in zip(self.query.aggregate_select.items(), row[aggregate_start:aggregate_end])\n ]) + tuple(row[aggregate_end:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L696_C20", "label": "aggregate_start =", "type": "assigned_variable", "loc": [696, 696], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "vector": [14, 5, 0.708, 0.001, 5, 0.59, 0.0, 668, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "aggregate_start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " aggregate_start = len(self.query.extra_select.keys()) + len(self.query.select)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L697_C20", "label": "aggregate_end =", "type": "assigned_variable", "loc": [697, 697], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "vector": [14, 5, 0.7091, 0.001, 5, 0.59, 0.5, 381, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "aggregate_end", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " aggregate_end = aggregate_start + len(self.query.aggregate_select)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L698_C20", "label": "row =", "type": "assigned_variable", "loc": [698, 702], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "vector": [14, 5, 0.7121, 0.0051, 5, 0.59, 1.0, 767, 4, 0, 0, 0, 0, 0, 6], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " row = tuple(row[:aggregate_start]) + tuple([\n self.query.resolve_aggregate(value, aggregate, self.connection)\n for (alias, aggregate), value\n in zip(self.query.aggregate_select.items(), row[aggregate_start:aggregate_end])\n ]) + tuple(row[aggregate_end:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L704_C16", "label": "expression", "type": "expression", "loc": [704, 704], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "vector": [8, 4, 0.7162, 0.001, 4, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield row"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "label": "has_results", "type": "function", "loc": [706, 710], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.7202, 0.0051, 1, 0.24, 0.9333, 457, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "has_results", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_results(self):\n # This is always executed on a query clone, so we can modify self.query\n self.query.add_extra({'a': 1}, None, None, None, None, None)\n self.query.set_extra_mask(('a',))\n return bool(self.execute_sql(SINGLE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L708_C8", "label": "add_extra()", "type": "expression", "loc": [708, 708], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "vector": [8, 2, 0.7202, 0.001, 2, 0.73, 0.0, 964, 3, 6, 0, 0, 0, 0, 1], "semantic": {"name": "add_extra", "arg_names": [], "import_names": [], "rhs_call_name": "add_extra", "annotation": ""}, "snippet": " self.query.add_extra({'a': 1}, None, None, None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L709_C8", "label": "set_extra_mask()", "type": "expression", "loc": [709, 709], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "vector": [8, 2, 0.7213, 0.001, 2, 0.73, 0.5, 286, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_extra_mask", "arg_names": [], "import_names": [], "rhs_call_name": "set_extra_mask", "annotation": ""}, "snippet": " self.query.set_extra_mask(('a',))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L710_C8", "label": "return", "type": "return", "loc": [710, 710], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "vector": [13, 2, 0.7223, 0.001, 2, 0.73, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.execute_sql(SINGLE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "label": "execute_sql", "type": "function", "loc": [712, 757], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "vector": [2, 1, 0.7472, 0.0468, 1, 0.24, 1.0, 834, 0, 2, 1, 0, 0, 0, 12], "semantic": {"name": "execute_sql", "arg_names": ["self", "result_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_sql(self, result_type=MULTI):\n \"\"\"\n Run the query against the database and returns the result(s). The\n return value is a single data item if result_type is SINGLE, or an\n iterator over the results if the result_type is MULTI.\n\n result_type is either MULTI (use fetchmany() to retrieve all rows),\n SINGLE (only retrieve a single row), or None. In this last case, the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L713_C8", "label": "expression", "type": "expression", "loc": [713, 724], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [8, 2, 0.7309, 0.0122, 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 Run the query against the database and returns the result(s). The\n return value is a single data item if result_type is SINGLE, or an\n iterator over the results if the result_type is MULTI.\n\n result_type is either MULTI (use fetchmany() to retrieve all rows),\n SINGLE (only retrieve a single row), or None. In this last case, the\n cursor is returned if any query is executed, since it's used by"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "label": "try", "type": "try", "loc": [725, 733], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [7, 2, 0.7416, 0.0092, 2, 0.07, 0.125, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n sql, params = self.as_sql()\n if not sql:\n raise EmptyResultSet\n except EmptyResultSet:\n if result_type == MULTI:\n return empty_iter()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L726_C12", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [726, 726], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "vector": [14, 3, 0.7386, 0.001, 3, 0.59, 0.0, 643, 3, 0, 0, 0, 122, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = self.as_sql()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L727_C12", "label": "if", "type": "if", "loc": [727, 728], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "vector": [4, 3, 0.7401, 0.002, 3, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sql:\n raise EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12", "label": "if", "type": "if", "loc": [730, 733], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "vector": [4, 3, 0.7442, 0.0041, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result_type == MULTI:\n return empty_iter()\n else:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L731_C16", "label": "return", "type": "return", "loc": [731, 731], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12", "vector": [13, 4, 0.7436, 0.001, 4, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return empty_iter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L733_C16", "label": "return", "type": "return", "loc": [733, 733], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12", "vector": [13, 4, 0.7457, 0.001, 4, 0.34, 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_99011:Assign_L735_C8", "label": "cursor = cursor()", "type": "assigned_variable", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [14, 2, 0.7477, 0.001, 2, 0.07, 0.25, 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_99011:Expr_L736_C8", "label": "execute()", "type": "expression", "loc": [736, 736], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [8, 2, 0.7487, 0.001, 2, 0.07, 0.375, 569, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "execute", "arg_names": [], "import_names": [], "rhs_call_name": "execute", "annotation": ""}, "snippet": " cursor.execute(sql, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L738_C8", "label": "if", "type": "if", "loc": [738, 739], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [4, 2, 0.7513, 0.002, 2, 0.07, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not result_type:\n return cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L739_C12", "label": "return", "type": "return", "loc": [739, 739], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L738_C8", "vector": [13, 3, 0.7518, 0.001, 3, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8", "label": "if", "type": "if", "loc": [740, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [4, 2, 0.7543, 0.0041, 2, 0.07, 0.625, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result_type == SINGLE:\n if self.query.ordering_aliases:\n return cursor.fetchone()[:-len(self.query.ordering_aliases)]\n return cursor.fetchone()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L741_C12", "label": "if", "type": "if", "loc": [741, 742], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8", "vector": [4, 3, 0.7543, 0.002, 3, 0.5, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.ordering_aliases:\n return cursor.fetchone()[:-len(self.query.ordering_aliases)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L742_C16", "label": "return", "type": "return", "loc": [742, 742], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L741_C12", "vector": [13, 4, 0.7548, 0.001, 4, 0.62, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.fetchone()[:-len(self.query.ordering_aliases)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L743_C12", "label": "return", "type": "return", "loc": [743, 743], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8", "vector": [13, 3, 0.7558, 0.001, 3, 0.5, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cursor.fetchone()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8", "label": "if", "type": "if", "loc": [746, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [4, 2, 0.7614, 0.0061, 2, 0.07, 0.75, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.ordering_aliases:\n result = order_modified_iter(cursor, len(self.query.ordering_aliases),\n self.connection.features.empty_fetchmany_value)\n else:\n result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),\n self.connection.features.empty_fetchmany_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L747_C12", "label": "result = order_modified_iter()", "type": "assigned_variable", "loc": [747, 748], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8", "vector": [14, 3, 0.7604, 0.002, 3, 0.54, 0.0, 51, 3, 3, 0, 0, 88, 10, 2], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "order_modified_iter", "annotation": ""}, "snippet": " result = order_modified_iter(cursor, len(self.query.ordering_aliases),\n self.connection.features.empty_fetchmany_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L750_C12", "label": "result = iter()", "type": "assigned_variable", "loc": [750, 751], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8", "vector": [14, 3, 0.7635, 0.002, 3, 0.54, 1.0, 51, 3, 2, 0, 0, 557, 10, 2], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "iter", "annotation": ""}, "snippet": " result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),\n self.connection.features.empty_fetchmany_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L752_C8", "label": "if", "type": "if", "loc": [752, 756], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [4, 2, 0.767, 0.0051, 2, 0.07, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.connection.features.can_use_chunked_reads:\n # If we are using non-chunked reads, we return the same data\n # structure as normally, but ensure it is all read into memory\n # before going any further.\n return list(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L756_C12", "label": "return", "type": "return", "loc": [756, 756], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L752_C8", "vector": [13, 3, 0.7691, 0.001, 3, 0.67, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return list(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L757_C8", "label": "return", "type": "return", "loc": [757, 757], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "vector": [13, 2, 0.7701, 0.001, 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 result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "label": "SQLInsertCompiler", "type": "class", "loc": [760, 798], "level": 0, "parent": null, "vector": [3, 0, 0.7925, 0.0397, 0, 0.66, 0.5714, 217, 0, 3, 0, 0, 718, 0, 18], "semantic": {"name": "SQLInsertCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLInsertCompiler(SQLCompiler):\n def placeholder(self, field, val):\n if field is None:\n # A field value of None means the value is raw.\n return val\n elif hasattr(field, 'get_placeholder'):\n # Some fields (e.g. geo fields) need special munging before\n # they can be inserted."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L761_C4", "label": "placeholder", "type": "function", "loc": [761, 771], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "vector": [2, 1, 0.7792, 0.0112, 1, 0.83, 0.0, 847, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "placeholder", "arg_names": ["self", "field", "val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def placeholder(self, field, val):\n if field is None:\n # A field value of None means the value is raw.\n return val\n elif hasattr(field, 'get_placeholder'):\n # Some fields (e.g. geo fields) need special munging before\n # they can be inserted.\n return field.get_placeholder(val, self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8", "label": "if", "type": "if", "loc": [762, 771], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L761_C4", "vector": [4, 2, 0.7798, 0.0102, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field is None:\n # A field value of None means the value is raw.\n return val\n elif hasattr(field, 'get_placeholder'):\n # Some fields (e.g. geo fields) need special munging before\n # they can be inserted.\n return field.get_placeholder(val, self.connection)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L764_C12", "label": "return", "type": "return", "loc": [764, 764], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8", "vector": [13, 3, 0.7772, 0.001, 3, 0.07, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8", "label": "if", "type": "if", "loc": [765, 771], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8", "vector": [4, 3, 0.7813, 0.0071, 3, 0.07, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(field, 'get_placeholder'):\n # Some fields (e.g. geo fields) need special munging before\n # they can be inserted.\n return field.get_placeholder(val, self.connection)\n else:\n # Return the common case for the placeholder\n return '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L768_C12", "label": "return", "type": "return", "loc": [768, 768], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8", "vector": [13, 4, 0.7813, 0.001, 4, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return field.get_placeholder(val, self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L771_C12", "label": "return", "type": "return", "loc": [771, 771], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8", "vector": [13, 4, 0.7843, 0.001, 4, 0.47, 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_99011:FunctionDef_L773_C4", "label": "as_sql", "type": "function", "loc": [773, 788], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "vector": [2, 1, 0.794, 0.0163, 1, 0.83, 0.5, 122, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "as_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self):\n # We don't need quote_name_unless_alias() here, since these are all\n # going to be column names (so we can avoid the extra overhead).\n qn = self.connection.ops.quote_name\n opts = self.query.model._meta\n result = ['INSERT INTO %s' % qn(opts.db_table)]\n result.append('(%s)' % ', '.join([qn(c) for c in self.query.columns]))\n values = [self.placeholder(*v) for v in self.query.values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L776_C8", "label": "qn =", "type": "assigned_variable", "loc": [776, 776], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [14, 2, 0.7894, 0.001, 2, 0.17, 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_99011:Assign_L777_C8", "label": "opts =", "type": "assigned_variable", "loc": [777, 777], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [14, 2, 0.7904, 0.001, 2, 0.17, 0.125, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = self.query.model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L778_C8", "label": "result =", "type": "assigned_variable", "loc": [778, 778], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [14, 2, 0.7915, 0.001, 2, 0.17, 0.25, 51, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = ['INSERT INTO %s' % qn(opts.db_table)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L779_C8", "label": "append()", "type": "expression", "loc": [779, 779], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [8, 2, 0.7925, 0.001, 2, 0.17, 0.375, 243, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('(%s)' % ', '.join([qn(c) for c in self.query.columns]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L780_C8", "label": "values =", "type": "assigned_variable", "loc": [780, 780], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [14, 2, 0.7935, 0.001, 2, 0.17, 0.5, 721, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = [self.placeholder(*v) for v in self.query.values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L781_C8", "label": "append()", "type": "expression", "loc": [781, 781], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [8, 2, 0.7945, 0.001, 2, 0.17, 0.625, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('VALUES (%s)' % ', '.join(values))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L782_C8", "label": "params =", "type": "assigned_variable", "loc": [782, 782], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [14, 2, 0.7955, 0.001, 2, 0.17, 0.75, 206, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = self.query.params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "label": "if", "type": "if", "loc": [783, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [4, 2, 0.7986, 0.0051, 2, 0.17, 0.875, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.return_id and self.connection.features.can_return_id_from_insert:\n col = \"%s.%s\" % (qn(opts.db_table), qn(opts.pk.column))\n r_fmt, r_params = self.connection.ops.return_insert_id()\n result.append(r_fmt % col)\n params = params + r_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L784_C12", "label": "col =", "type": "assigned_variable", "loc": [784, 784], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "vector": [14, 3, 0.7976, 0.001, 3, 0.86, 0.0, 157, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = \"%s.%s\" % (qn(opts.db_table), qn(opts.pk.column))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L785_C12", "label": "r_fmt, r_params = return_insert_id()", "type": "assigned_variable", "loc": [785, 785], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "vector": [14, 3, 0.7986, 0.001, 3, 0.86, 0.3333, 583, 3, 0, 0, 0, 195, 10, 1], "semantic": {"name": "r_fmt, r_params", "arg_names": [], "import_names": [], "rhs_call_name": "return_insert_id", "annotation": ""}, "snippet": " r_fmt, r_params = self.connection.ops.return_insert_id()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L786_C12", "label": "append()", "type": "expression", "loc": [786, 786], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "vector": [8, 3, 0.7996, 0.001, 3, 0.86, 0.6667, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(r_fmt % col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L787_C12", "label": "params =", "type": "assigned_variable", "loc": [787, 787], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "vector": [14, 3, 0.8006, 0.001, 3, 0.86, 1.0, 206, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = params + r_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L788_C8", "label": "return", "type": "return", "loc": [788, 788], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "vector": [13, 2, 0.8016, 0.001, 2, 0.17, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(result), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "label": "execute_sql", "type": "function", "loc": [790, 798], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "vector": [2, 1, 0.8077, 0.0092, 1, 0.83, 1.0, 834, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "execute_sql", "arg_names": ["self", "return_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_sql(self, return_id=False):\n self.return_id = return_id\n cursor = super(SQLInsertCompiler, self).execute_sql(None)\n if not (return_id and cursor):\n return\n if self.connection.features.can_return_id_from_insert:\n return self.connection.ops.fetch_returned_insert_id(cursor)\n return self.connection.ops.last_insert_id(cursor,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L791_C8", "label": "self.return_id =", "type": "assigned_variable", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "vector": [14, 2, 0.8047, 0.001, 2, 0.96, 0.0, 393, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.return_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.return_id = return_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L792_C8", "label": "cursor = execute_sql()", "type": "assigned_variable", "loc": [792, 792], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "vector": [14, 2, 0.8057, 0.001, 2, 0.96, 0.25, 231, 3, 1, 0, 0, 834, 10, 2], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "execute_sql", "annotation": ""}, "snippet": " cursor = super(SQLInsertCompiler, self).execute_sql(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L793_C8", "label": "if", "type": "if", "loc": [793, 794], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "vector": [4, 2, 0.8072, 0.002, 2, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (return_id and cursor):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L794_C12", "label": "return", "type": "return", "loc": [794, 794], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L793_C8", "vector": [13, 3, 0.8077, 0.001, 3, 0.46, 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_99011:If_L795_C8", "label": "if", "type": "if", "loc": [795, 796], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "vector": [4, 2, 0.8093, 0.002, 2, 0.96, 0.75, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connection.features.can_return_id_from_insert:\n return self.connection.ops.fetch_returned_insert_id(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L796_C12", "label": "return", "type": "return", "loc": [796, 796], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L795_C8", "vector": [13, 3, 0.8098, 0.001, 3, 0.19, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.connection.ops.fetch_returned_insert_id(cursor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L797_C8", "label": "return", "type": "return", "loc": [797, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "vector": [13, 2, 0.8113, 0.002, 2, 0.96, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.connection.ops.last_insert_id(cursor,\n self.query.model._meta.db_table, self.query.model._meta.pk.column)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L801_C0", "label": "SQLDeleteCompiler", "type": "class", "loc": [801, 813], "level": 0, "parent": null, "vector": [3, 0, 0.821, 0.0132, 0, 0.66, 0.6429, 715, 0, 1, 0, 0, 718, 0, 6], "semantic": {"name": "SQLDeleteCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDeleteCompiler(SQLCompiler):\n def as_sql(self):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n assert len(self.query.tables) == 1, \\\n \"Can only delete from one table at a time.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "label": "as_sql", "type": "function", "loc": [802, 813], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L801_C0", "vector": [2, 1, 0.8215, 0.0122, 1, 0.88, 0.0, 122, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "as_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n assert len(self.query.tables) == 1, \\\n \"Can only delete from one table at a time.\"\n qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L803_C8", "label": "expression", "type": "expression", "loc": [803, 806], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [8, 2, 0.8184, 0.0041, 2, 0.29, 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 of\n parameters.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L809_C8", "label": "qn =", "type": "assigned_variable", "loc": [809, 809], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [14, 2, 0.823, 0.001, 2, 0.29, 0.2, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L810_C8", "label": "result =", "type": "assigned_variable", "loc": [810, 810], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [14, 2, 0.824, 0.001, 2, 0.29, 0.4, 51, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = ['DELETE FROM %s' % qn(self.query.tables[0])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L811_C8", "label": "where, params = as_sql()", "type": "assigned_variable", "loc": [811, 811], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [14, 2, 0.825, 0.001, 2, 0.29, 0.6, 533, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "where, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " where, params = self.query.where.as_sql(qn=qn, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L812_C8", "label": "append()", "type": "expression", "loc": [812, 812], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [8, 2, 0.826, 0.001, 2, 0.29, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('WHERE %s' % where)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L813_C8", "label": "return", "type": "return", "loc": [813, 813], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "vector": [13, 2, 0.8271, 0.001, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(result), tuple(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "label": "SQLUpdateCompiler", "type": "class", "loc": [815, 923], "level": 0, "parent": null, "vector": [3, 0, 0.884, 0.1109, 0, 0.66, 0.7143, 756, 0, 3, 0, 0, 718, 0, 44], "semantic": {"name": "SQLUpdateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLUpdateCompiler(SQLCompiler):\n def as_sql(self):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n from django.db.models.base import Model\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "label": "as_sql", "type": "function", "loc": [816, 861], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "vector": [2, 1, 0.853, 0.0468, 1, 0.32, 0.0, 122, 0, 1, 1, 0, 0, 0, 26], "semantic": {"name": "as_sql", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n from django.db.models.base import Model\n\n self.pre_sql_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L817_C8", "label": "expression", "type": "expression", "loc": [817, 820], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [8, 2, 0.8327, 0.0041, 2, 0.77, 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 of\n parameters.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L821_C8", "label": "from django.db.models.base import Model", "type": "import", "loc": [821, 821], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [1, 2, 0.8352, 0.001, 2, 0.77, 0.0714, 465, 0, 1, 0, 0, 465, 0, 0], "semantic": {"name": "django.db.models.base", "arg_names": [], "import_names": ["Model"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.models.base import Model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L823_C8", "label": "pre_sql_setup()", "type": "expression", "loc": [823, 823], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [8, 2, 0.8372, 0.001, 2, 0.77, 0.1429, 451, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pre_sql_setup", "arg_names": [], "import_names": [], "rhs_call_name": "pre_sql_setup", "annotation": ""}, "snippet": " self.pre_sql_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L824_C8", "label": "if", "type": "if", "loc": [824, 825], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [4, 2, 0.8388, 0.002, 2, 0.77, 0.2143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.query.values:\n return '', ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L825_C12", "label": "return", "type": "return", "loc": [825, 825], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L824_C8", "vector": [13, 3, 0.8393, 0.001, 3, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '', ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L826_C8", "label": "table =", "type": "assigned_variable", "loc": [826, 826], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [14, 2, 0.8403, 0.001, 2, 0.77, 0.2857, 338, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table = self.query.tables[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L827_C8", "label": "qn =", "type": "assigned_variable", "loc": [827, 827], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [14, 2, 0.8413, 0.001, 2, 0.77, 0.3571, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L828_C8", "label": "result =", "type": "assigned_variable", "loc": [828, 828], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [14, 2, 0.8423, 0.001, 2, 0.77, 0.4286, 51, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = ['UPDATE %s' % qn(table)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L829_C8", "label": "append()", "type": "expression", "loc": [829, 829], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [8, 2, 0.8433, 0.001, 2, 0.77, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('SET')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L830_C8", "label": "values, update_params =", "type": "assigned_variable", "loc": [830, 830], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [14, 2, 0.8444, 0.001, 2, 0.77, 0.5714, 432, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "values, update_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values, update_params = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "label": "for field, model, val", "type": "for", "loc": [831, 854], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [6, 2, 0.8571, 0.0244, 2, 0.77, 0.6429, 317, 7, 0, 0, 0, 0, 0, 17], "semantic": {"name": "field, model, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, model, val in self.query.values:\n if hasattr(val, 'prepare_database_save'):\n val = val.prepare_database_save(field)\n else:\n val = field.get_db_prep_save(val, connection=self.connection)\n\n # Getting the placeholder for the field.\n if hasattr(field, 'get_placeholder'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12", "label": "if", "type": "if", "loc": [832, 835], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "vector": [4, 3, 0.8479, 0.0041, 3, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(val, 'prepare_database_save'):\n val = val.prepare_database_save(field)\n else:\n val = field.get_db_prep_save(val, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L833_C16", "label": "val = prepare_database_save()", "type": "assigned_variable", "loc": [833, 833], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12", "vector": [14, 4, 0.8474, 0.001, 4, 0.74, 0.0, 618, 3, 1, 0, 0, 536, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "prepare_database_save", "annotation": ""}, "snippet": " val = val.prepare_database_save(field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L835_C16", "label": "val = get_db_prep_save()", "type": "assigned_variable", "loc": [835, 835], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12", "vector": [14, 4, 0.8494, 0.001, 4, 0.74, 1.0, 618, 3, 2, 0, 0, 337, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "get_db_prep_save", "annotation": ""}, "snippet": " val = field.get_db_prep_save(val, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12", "label": "if", "type": "if", "loc": [838, 841], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "vector": [4, 3, 0.854, 0.0041, 3, 0.69, 0.25, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(field, 'get_placeholder'):\n placeholder = field.get_placeholder(val, self.connection)\n else:\n placeholder = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L839_C16", "label": "placeholder = get_placeholder()", "type": "assigned_variable", "loc": [839, 839], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12", "vector": [14, 4, 0.8535, 0.001, 4, 0.32, 0.0, 847, 3, 2, 0, 0, 571, 10, 1], "semantic": {"name": "placeholder", "arg_names": [], "import_names": [], "rhs_call_name": "get_placeholder", "annotation": ""}, "snippet": " placeholder = field.get_placeholder(val, self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L841_C16", "label": "placeholder =", "type": "assigned_variable", "loc": [841, 841], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12", "vector": [14, 4, 0.8555, 0.001, 4, 0.32, 1.0, 847, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "placeholder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " placeholder = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L843_C12", "label": "if", "type": "if", "loc": [843, 844], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "vector": [4, 3, 0.8581, 0.002, 3, 0.69, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(val, 'evaluate'):\n val = SQLEvaluator(val, self.query, allow_joins=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L844_C16", "label": "val = SQLEvaluator()", "type": "assigned_variable", "loc": [844, 844], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L843_C12", "vector": [14, 4, 0.8586, 0.001, 4, 0.71, 0.0, 618, 3, 3, 0, 0, 825, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "SQLEvaluator", "annotation": ""}, "snippet": " val = SQLEvaluator(val, self.query, allow_joins=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L845_C12", "label": "name =", "type": "assigned_variable", "loc": [845, 845], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "vector": [14, 3, 0.8596, 0.001, 3, 0.69, 0.75, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = field.column"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "label": "if", "type": "if", "loc": [846, 854], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "vector": [4, 3, 0.8647, 0.0092, 3, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(val, 'as_sql'):\n sql, params = val.as_sql(qn, self.connection)\n values.append('%s = %s' % (qn(name), sql))\n update_params.extend(params)\n elif val is not None:\n values.append('%s = %s' % (qn(name), placeholder))\n update_params.append(val)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L847_C16", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [847, 847], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "vector": [14, 4, 0.8616, 0.001, 4, 0.34, 0.0, 643, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = val.as_sql(qn, self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L848_C16", "label": "append()", "type": "expression", "loc": [848, 848], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "vector": [8, 4, 0.8627, 0.001, 4, 0.34, 0.3333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " values.append('%s = %s' % (qn(name), sql))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L849_C16", "label": "extend()", "type": "expression", "loc": [849, 849], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "vector": [8, 4, 0.8637, 0.001, 4, 0.34, 0.6667, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " update_params.extend(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "label": "if", "type": "if", "loc": [850, 854], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "vector": [4, 4, 0.8667, 0.0051, 4, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif val is not None:\n values.append('%s = %s' % (qn(name), placeholder))\n update_params.append(val)\n else:\n values.append('%s = NULL' % qn(name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L851_C16", "label": "append()", "type": "expression", "loc": [851, 851], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "vector": [8, 5, 0.8657, 0.001, 5, 0.76, 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('%s = %s' % (qn(name), placeholder))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L852_C16", "label": "append()", "type": "expression", "loc": [852, 852], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "vector": [8, 5, 0.8667, 0.001, 5, 0.76, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " update_params.append(val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L854_C16", "label": "append()", "type": "expression", "loc": [854, 854], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "vector": [8, 5, 0.8688, 0.001, 5, 0.76, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " values.append('%s = NULL' % qn(name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L855_C8", "label": "if", "type": "if", "loc": [855, 856], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [4, 2, 0.8703, 0.002, 2, 0.77, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not values:\n return '', ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L856_C12", "label": "return", "type": "return", "loc": [856, 856], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L855_C8", "vector": [13, 3, 0.8708, 0.001, 3, 0.3, 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_99011:Expr_L857_C8", "label": "append()", "type": "expression", "loc": [857, 857], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [8, 2, 0.8718, 0.001, 2, 0.77, 0.7857, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(', '.join(values))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L858_C8", "label": "where, params = as_sql()", "type": "assigned_variable", "loc": [858, 858], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [14, 2, 0.8728, 0.001, 2, 0.77, 0.8571, 533, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "where, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " where, params = self.query.where.as_sql(qn=qn, connection=self.connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L859_C8", "label": "if", "type": "if", "loc": [859, 860], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [4, 2, 0.8744, 0.002, 2, 0.77, 0.9286, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if where:\n result.append('WHERE %s' % where)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L860_C12", "label": "append()", "type": "expression", "loc": [860, 860], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L859_C8", "vector": [8, 3, 0.8749, 0.001, 3, 0.66, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append('WHERE %s' % where)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L861_C8", "label": "return", "type": "return", "loc": [861, 861], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "vector": [13, 2, 0.8759, 0.001, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(result), tuple(update_params + params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "label": "execute_sql", "type": "function", "loc": [863, 879], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "vector": [2, 1, 0.8861, 0.0173, 1, 0.32, 0.5, 834, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "execute_sql", "arg_names": ["self", "result_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def execute_sql(self, result_type):\n \"\"\"\n Execute the specified update. Returns the number of rows affected by\n the primary update query. The \"primary update query\" is the first\n non-empty query that is executed. Row counts for any subsequent,\n related queries are not available.\n \"\"\"\n cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L864_C8", "label": "expression", "type": "expression", "loc": [864, 869], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [8, 2, 0.8815, 0.0061, 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 Execute the specified update. Returns the number of rows affected by\n the primary update query. The \"primary update query\" is the first\n non-empty query that is executed. Row counts for any subsequent,\n related queries are not available.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L870_C8", "label": "cursor = execute_sql()", "type": "assigned_variable", "loc": [870, 870], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [14, 2, 0.885, 0.001, 2, 0.46, 0.2, 231, 3, 1, 0, 0, 834, 10, 2], "semantic": {"name": "cursor", "arg_names": [], "import_names": [], "rhs_call_name": "execute_sql", "annotation": ""}, "snippet": " cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L871_C8", "label": "rows =", "type": "assigned_variable", "loc": [871, 871], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [14, 2, 0.8861, 0.001, 2, 0.46, 0.4, 275, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rows = cursor and cursor.rowcount or 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L872_C8", "label": "is_empty =", "type": "assigned_variable", "loc": [872, 872], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [14, 2, 0.8871, 0.001, 2, 0.46, 0.6, 623, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "is_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_empty = cursor is None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8", "label": "for query", "type": "for", "loc": [874, 878], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [6, 2, 0.8911, 0.0051, 2, 0.46, 0.8, 546, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for query in self.query.get_related_updates():\n aux_rows = query.get_compiler(self.using).execute_sql(result_type)\n if is_empty:\n rows = aux_rows\n is_empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L875_C12", "label": "aux_rows = execute_sql()", "type": "assigned_variable", "loc": [875, 875], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8", "vector": [14, 3, 0.8901, 0.001, 3, 0.28, 0.0, 334, 3, 1, 0, 0, 834, 10, 2], "semantic": {"name": "aux_rows", "arg_names": [], "import_names": [], "rhs_call_name": "execute_sql", "annotation": ""}, "snippet": " aux_rows = query.get_compiler(self.using).execute_sql(result_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12", "label": "if", "type": "if", "loc": [876, 878], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8", "vector": [4, 3, 0.8922, 0.0031, 3, 0.28, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_empty:\n rows = aux_rows\n is_empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L877_C16", "label": "rows =", "type": "assigned_variable", "loc": [877, 877], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12", "vector": [14, 4, 0.8922, 0.001, 4, 0.21, 0.0, 275, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rows = aux_rows"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L878_C16", "label": "is_empty =", "type": "assigned_variable", "loc": [878, 878], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12", "vector": [14, 4, 0.8932, 0.001, 4, 0.21, 1.0, 623, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L879_C8", "label": "return", "type": "return", "loc": [879, 879], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "vector": [13, 2, 0.8942, 0.001, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rows"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "label": "pre_sql_setup", "type": "function", "loc": [881, 923], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "vector": [2, 1, 0.9176, 0.0437, 1, 0.32, 1.0, 451, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "pre_sql_setup", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pre_sql_setup(self):\n \"\"\"\n If the update depends on results from other tables, we need to do some\n munging of the \"where\" conditions to match the format required for\n (portable) SQL updates. That is done here.\n\n Further, if we are going to be running multiple updates, we pull out\n the id values to update at this point so that they don't change as a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L882_C8", "label": "expression", "type": "expression", "loc": [882, 890], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [8, 2, 0.9013, 0.0092, 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 If the update depends on results from other tables, we need to do some\n munging of the \"where\" conditions to match the format required for\n (portable) SQL updates. That is done here.\n\n Further, if we are going to be running multiple updates, we pull out\n the id values to update at this point so that they don't change as a\n result of the progressive updates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L891_C8", "label": "self.query.select_related =", "type": "assigned_variable", "loc": [891, 891], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9064, 0.001, 2, 0.16, 0.0714, 475, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.query.select_related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.select_related = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L892_C8", "label": "clear_ordering()", "type": "expression", "loc": [892, 892], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [8, 2, 0.9074, 0.001, 2, 0.16, 0.1429, 382, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_ordering", "arg_names": [], "import_names": [], "rhs_call_name": "clear_ordering", "annotation": ""}, "snippet": " self.query.clear_ordering(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L893_C8", "label": "pre_sql_setup()", "type": "expression", "loc": [893, 893], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [8, 2, 0.9084, 0.001, 2, 0.16, 0.2143, 451, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pre_sql_setup", "arg_names": [], "import_names": [], "rhs_call_name": "pre_sql_setup", "annotation": ""}, "snippet": " super(SQLUpdateCompiler, self).pre_sql_setup()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L894_C8", "label": "count = count_active_tables()", "type": "assigned_variable", "loc": [894, 894], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9095, 0.001, 2, 0.16, 0.2857, 778, 3, 0, 0, 0, 415, 10, 1], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "count_active_tables", "annotation": ""}, "snippet": " count = self.query.count_active_tables()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L895_C8", "label": "if", "type": "if", "loc": [895, 896], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [4, 2, 0.911, 0.002, 2, 0.16, 0.3571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.query.related_updates and count == 1:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L896_C12", "label": "return", "type": "return", "loc": [896, 896], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L895_C8", "vector": [13, 3, 0.9115, 0.001, 3, 0.76, 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_99011:Assign_L900_C8", "label": "query = clone()", "type": "assigned_variable", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9156, 0.001, 2, 0.16, 0.4286, 546, 3, 1, 0, 0, 911, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "clone", "annotation": ""}, "snippet": " query = self.query.clone(klass=Query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L901_C8", "label": "bump_prefix()", "type": "expression", "loc": [901, 901], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [8, 2, 0.9166, 0.001, 2, 0.16, 0.5, 180, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "bump_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "bump_prefix", "annotation": ""}, "snippet": " query.bump_prefix()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L902_C8", "label": "query.extra =", "type": "assigned_variable", "loc": [902, 902], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9176, 0.001, 2, 0.16, 0.5714, 65, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "query.extra", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query.extra = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L903_C8", "label": "query.select =", "type": "assigned_variable", "loc": [903, 903], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9186, 0.001, 2, 0.16, 0.6429, 424, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "query.select", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query.select = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L904_C8", "label": "add_fields()", "type": "expression", "loc": [904, 904], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [8, 2, 0.9196, 0.001, 2, 0.16, 0.7143, 943, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_fields", "arg_names": [], "import_names": [], "rhs_call_name": "add_fields", "annotation": ""}, "snippet": " query.add_fields([query.model._meta.pk.name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L905_C8", "label": "must_pre_select =", "type": "assigned_variable", "loc": [905, 905], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9207, 0.001, 2, 0.16, 0.7857, 423, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "must_pre_select", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " must_pre_select = count > 1 and not self.connection.features.update_can_self_select"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L909_C8", "label": "self.query.where = where_class()", "type": "assigned_variable", "loc": [909, 909], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [14, 2, 0.9247, 0.001, 2, 0.16, 0.8571, 320, 3, 0, 0, 0, 374, 10, 1], "semantic": {"name": "self.query.where", "arg_names": [], "import_names": [], "rhs_call_name": "where_class", "annotation": ""}, "snippet": " self.query.where = self.query.where_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "label": "if", "type": "if", "loc": [910, 921], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [4, 2, 0.9313, 0.0122, 2, 0.16, 0.9286, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.query.related_updates or must_pre_select:\n # Either we're using the idents in multiple update queries (so\n # don't want them to change), or the db backend doesn't support\n # selecting from the updating table (e.g. MySQL).\n idents = []\n for rows in query.get_compiler(self.using).execute_sql(MULTI):\n idents.extend([r[0] for r in rows])\n self.query.add_filter(('pk__in', idents))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L914_C12", "label": "idents =", "type": "assigned_variable", "loc": [914, 914], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "vector": [14, 3, 0.9298, 0.001, 3, 0.72, 0.0, 831, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "idents", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " idents = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L915_C12", "label": "for rows", "type": "for", "loc": [915, 916], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "vector": [6, 3, 0.9313, 0.002, 3, 0.72, 0.25, 275, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rows in query.get_compiler(self.using).execute_sql(MULTI):\n idents.extend([r[0] for r in rows])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L916_C16", "label": "extend()", "type": "expression", "loc": [916, 916], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L915_C12", "vector": [8, 4, 0.9318, 0.001, 4, 0.01, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " idents.extend([r[0] for r in rows])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L917_C12", "label": "add_filter()", "type": "expression", "loc": [917, 917], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "vector": [8, 3, 0.9329, 0.001, 3, 0.72, 0.5, 783, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_filter", "arg_names": [], "import_names": [], "rhs_call_name": "add_filter", "annotation": ""}, "snippet": " self.query.add_filter(('pk__in', idents))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L918_C12", "label": "self.query.related_ids =", "type": "assigned_variable", "loc": [918, 918], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "vector": [14, 3, 0.9339, 0.001, 3, 0.72, 0.75, 597, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query.related_ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.related_ids = idents"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L921_C12", "label": "add_filter()", "type": "expression", "loc": [921, 921], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "vector": [8, 3, 0.9369, 0.001, 3, 0.72, 1.0, 783, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_filter", "arg_names": [], "import_names": [], "rhs_call_name": "add_filter", "annotation": ""}, "snippet": " self.query.add_filter(('pk__in', query))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L922_C8", "label": "for alias", "type": "for", "loc": [922, 923], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "vector": [6, 2, 0.9385, 0.002, 2, 0.16, 1.0, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for alias in self.query.tables[1:]:\n self.query.alias_refcount[alias] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L923_C12", "label": "assign", "type": "assigned_variable", "loc": [923, 923], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L922_C8", "vector": [14, 3, 0.939, 0.001, 3, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.query.alias_refcount[alias] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L925_C0", "label": "SQLAggregateCompiler", "type": "class", "loc": [925, 941], "level": 0, "parent": null, "vector": [3, 0, 0.9491, 0.0173, 0, 0.66, 0.7857, 216, 0, 1, 0, 0, 718, 0, 3], "semantic": {"name": "SQLAggregateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLAggregateCompiler(SQLCompiler):\n def as_sql(self, qn=None):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n if qn is None:\n qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "label": "as_sql", "type": "function", "loc": [926, 941], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L925_C0", "vector": [2, 1, 0.9496, 0.0163, 1, 0.06, 0.0, 122, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "as_sql", "arg_names": ["self", "qn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn=None):\n \"\"\"\n Creates the SQL for this query. Returns the SQL string and list of\n parameters.\n \"\"\"\n if qn is None:\n qn = self.quote_name_unless_alias\n sql = ('SELECT %s FROM (%s) subquery' % ("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L927_C8", "label": "expression", "type": "expression", "loc": [927, 930], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "vector": [8, 2, 0.9446, 0.0041, 2, 0.0, 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 of\n parameters.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L931_C8", "label": "if", "type": "if", "loc": [931, 932], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "vector": [4, 2, 0.9476, 0.002, 2, 0.0, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if qn is None:\n qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L932_C12", "label": "qn =", "type": "assigned_variable", "loc": [932, 932], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L931_C8", "vector": [14, 3, 0.9481, 0.001, 3, 0.69, 0.0, 514, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qn = self.quote_name_unless_alias"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L933_C8", "label": "sql =", "type": "assigned_variable", "loc": [933, 939], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "vector": [14, 2, 0.9522, 0.0071, 2, 0.0, 0.5, 736, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql = ('SELECT %s FROM (%s) subquery' % (\n ', '.join([\n aggregate.as_sql(qn, self.connection)\n for aggregate in self.query.aggregate_select.values()\n ]),\n self.query.subquery)\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L940_C8", "label": "params =", "type": "assigned_variable", "loc": [940, 940], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "vector": [14, 2, 0.9563, 0.001, 2, 0.0, 0.75, 206, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = self.query.sub_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L941_C8", "label": "return", "type": "return", "loc": [941, 941], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "vector": [13, 2, 0.9573, 0.001, 2, 0.0, 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_99011:ClassDef_L943_C0", "label": "SQLDateCompiler", "type": "class", "loc": [943, 964], "level": 0, "parent": null, "vector": [3, 0, 0.97, 0.0224, 0, 0.66, 0.8571, 583, 0, 1, 0, 0, 718, 0, 7], "semantic": {"name": "SQLDateCompiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLDateCompiler(SQLCompiler):\n def results_iter(self):\n \"\"\"\n Returns an iterator over the results from executing this query.\n \"\"\"\n resolve_columns = hasattr(self, 'resolve_columns')\n if resolve_columns:\n from django.db.models.fields import DateTimeField"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "label": "results_iter", "type": "function", "loc": [944, 964], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L943_C0", "vector": [2, 1, 0.9705, 0.0214, 1, 0.41, 0.0, 352, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "results_iter", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def results_iter(self):\n \"\"\"\n Returns an iterator over the results from executing this query.\n \"\"\"\n resolve_columns = hasattr(self, 'resolve_columns')\n if resolve_columns:\n from django.db.models.fields import DateTimeField\n fields = [DateTimeField()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L945_C8", "label": "expression", "type": "expression", "loc": [945, 947], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "vector": [8, 2, 0.9624, 0.0031, 2, 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 an iterator over the results from executing this query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L948_C8", "label": "resolve_columns = hasattr()", "type": "assigned_variable", "loc": [948, 948], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "vector": [14, 2, 0.9644, 0.001, 2, 0.34, 0.25, 224, 3, 2, 0, 0, 720, 10, 1], "semantic": {"name": "resolve_columns", "arg_names": [], "import_names": [], "rhs_call_name": "hasattr", "annotation": ""}, "snippet": " resolve_columns = hasattr(self, 'resolve_columns')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "label": "if", "type": "if", "loc": [949, 954], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "vector": [4, 2, 0.968, 0.0061, 2, 0.34, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resolve_columns:\n from django.db.models.fields import DateTimeField\n fields = [DateTimeField()]\n else:\n from django.db.backends.util import typecast_timestamp\n needs_string_cast = self.connection.features.needs_datetime_string_cast"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L950_C12", "label": "from django.db.models.fields import DateTimeField", "type": "import", "loc": [950, 950], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "vector": [1, 3, 0.9664, 0.001, 3, 0.35, 0.0, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["DateTimeField"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.models.fields import DateTimeField"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L951_C12", "label": "fields =", "type": "assigned_variable", "loc": [951, 951], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "vector": [14, 3, 0.9674, 0.001, 3, 0.35, 0.3333, 358, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " fields = [DateTimeField()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L953_C12", "label": "from django.db.backends.util import typecast_timestamp", "type": "import", "loc": [953, 953], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "vector": [1, 3, 0.9695, 0.001, 3, 0.35, 0.6667, 446, 0, 1, 0, 0, 446, 0, 0], "semantic": {"name": "django.db.backends.util", "arg_names": [], "import_names": ["typecast_timestamp"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.backends.util import typecast_timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L954_C12", "label": "needs_string_cast =", "type": "assigned_variable", "loc": [954, 954], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "vector": [14, 3, 0.9705, 0.001, 3, 0.35, 1.0, 15, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "needs_string_cast", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " needs_string_cast = self.connection.features.needs_datetime_string_cast"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L956_C8", "label": "offset = len()", "type": "assigned_variable", "loc": [956, 956], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "vector": [14, 2, 0.9725, 0.001, 2, 0.34, 0.75, 132, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " offset = len(self.query.extra_select)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L957_C8", "label": "for rows", "type": "for", "loc": [957, 964], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "vector": [6, 2, 0.9771, 0.0081, 2, 0.34, 1.0, 275, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rows in self.execute_sql(MULTI):\n for row in rows:\n date = row[offset]\n if resolve_columns:\n date = self.resolve_columns(row, fields)[offset]\n elif needs_string_cast:\n date = typecast_timestamp(str(date))\n yield date"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "label": "for row", "type": "for", "loc": [958, 964], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L957_C8", "vector": [6, 3, 0.9776, 0.0071, 3, 0.9, 0.0, 767, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in rows:\n date = row[offset]\n if resolve_columns:\n date = self.resolve_columns(row, fields)[offset]\n elif needs_string_cast:\n date = typecast_timestamp(str(date))\n yield date"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L959_C16", "label": "date =", "type": "assigned_variable", "loc": [959, 959], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "vector": [14, 4, 0.9756, 0.001, 4, 0.65, 0.0, 56, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " date = row[offset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16", "label": "if", "type": "if", "loc": [960, 963], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "vector": [4, 4, 0.9781, 0.0041, 4, 0.65, 0.5, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if resolve_columns:\n date = self.resolve_columns(row, fields)[offset]\n elif needs_string_cast:\n date = typecast_timestamp(str(date))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L961_C20", "label": "date =", "type": "assigned_variable", "loc": [961, 961], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16", "vector": [14, 5, 0.9776, 0.001, 5, 0.03, 0.0, 56, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " date = self.resolve_columns(row, fields)[offset]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L962_C16", "label": "if", "type": "if", "loc": [962, 963], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16", "vector": [4, 5, 0.9791, 0.002, 5, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif needs_string_cast:\n date = typecast_timestamp(str(date))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L963_C20", "label": "date = typecast_timestamp()", "type": "assigned_variable", "loc": [963, 963], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L962_C16", "vector": [14, 6, 0.9797, 0.001, 6, 0.55, 0.0, 56, 3, 1, 0, 0, 983, 10, 2], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "typecast_timestamp", "annotation": ""}, "snippet": " date = typecast_timestamp(str(date))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L964_C16", "label": "expression", "type": "expression", "loc": [964, 964], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "vector": [8, 4, 0.9807, 0.001, 4, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield date"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L967_C0", "label": "empty_iter", "type": "function", "loc": [967, 971], "level": 0, "parent": null, "vector": [2, 0, 0.9858, 0.0051, 0, 0.66, 0.9286, 982, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "empty_iter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def empty_iter():\n \"\"\"\n Returns an iterator containing no results.\n \"\"\"\n yield iter([]).next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L968_C4", "label": "expression", "type": "expression", "loc": [968, 970], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L967_C0", "vector": [8, 1, 0.9858, 0.0031, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns an iterator containing no results.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L971_C4", "label": "expression", "type": "expression", "loc": [971, 971], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L967_C0", "vector": [8, 1, 0.9878, 0.001, 1, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield iter([]).next()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L974_C0", "label": "order_modified_iter", "type": "function", "loc": [974, 983], "level": 0, "parent": null, "vector": [2, 0, 0.9954, 0.0102, 0, 0.66, 1.0, 88, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "order_modified_iter", "arg_names": ["cursor", "trim", "sentinel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def order_modified_iter(cursor, trim, sentinel):\n \"\"\"\n Yields blocks of rows from a cursor. We use this iterator in the special\n case when extra output columns have been added to support ordering\n requirements. We must trim those extra columns before anything else can use\n the results, since they're only needed to make the SQL valid.\n \"\"\"\n for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L975_C4", "label": "expression", "type": "expression", "loc": [975, 980], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L974_C0", "vector": [8, 1, 0.9944, 0.0061, 1, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Yields blocks of rows from a cursor. We use this iterator in the special\n case when extra output columns have been added to support ordering\n requirements. We must trim those extra columns before anything else can use\n the results, since they're only needed to make the SQL valid.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L981_C4", "label": "for rows", "type": "for", "loc": [981, 983], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L974_C0", "vector": [6, 1, 0.999, 0.0031, 1, 0.08, 1.0, 275, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "rows", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),\n sentinel):\n yield [r[:-trim] for r in rows]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L983_C8", "label": "expression", "type": "expression", "loc": [983, 983], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L981_C4", "vector": [8, 2, 1.0, 0.001, 2, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield [r[:-trim] for r in rows]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L28_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L29_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L93_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L94_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L94_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L96_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L95_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L97_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L89_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L111_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L115_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L114_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L116_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L116_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L117_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L113_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L158_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L160_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L161_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L162_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L164_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L167_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L168_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L169_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L170_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L172_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L173_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L166_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L174_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L176_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L177_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L165_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L178_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L180_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L159_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L183_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L182_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L184_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L203_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L206_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L208_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L209_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L211_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L205_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L213_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L231_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L232_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L233_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L234_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L248_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L251_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L253_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L250_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L254_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L247_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L256_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L246_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L261_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L263_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L266_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L265_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L267_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L243_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L270_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L271_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L273_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L274_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L276_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L277_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L278_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L269_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L279_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L279_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L280_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L218_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L284_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L296_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L295_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L309_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L308_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L311_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L319_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L319_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L320_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L324_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L325_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L323_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L327_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L328_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L329_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L332_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L332_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L333_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L318_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L338_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L340_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L341_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L339_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L343_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L342_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L344_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L335_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L348_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L351_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L352_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L353_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L353_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L354_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L355_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L350_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L356_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L358_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L359_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L359_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L360_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L361_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L345_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L362_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L374_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L375_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L375_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L376_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L377_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L385_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L395_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L396_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L397_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L398_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L402_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L403_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L404_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L393_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L408_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L413_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L414_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L416_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L417_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:While_L412_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L418_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L366_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L422_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L434_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L439_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L439_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L440_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L445_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L447_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L451_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L446_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L452_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L436_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L453_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L455_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L454_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L460_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L461_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L459_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L462_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L421_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L466_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L469_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L472_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L474_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L478_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L480_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L479_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L481_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L482_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L482_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L484_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L483_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L486_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L485_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L488_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L465_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L489_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L494_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L500_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L500_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L502_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L505_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L506_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L507_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L504_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L508_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L509_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L509_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L510_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L511_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L511_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L512_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L513_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L514_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L519_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L519_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L521_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L522_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L520_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L524_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L527_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L533_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L534_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L536_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L538_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L539_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L540_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L546_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L546_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L547_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L549_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L550_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L552_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L551_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L554_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L555_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L556_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L559_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L541_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L560_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L560_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L561_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L562_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L562_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L563_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L537_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L565_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L567_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L569_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L568_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L570_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L570_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L571_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L573_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L576_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L577_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L579_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L580_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L580_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L581_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L582_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L584_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L583_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L586_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L587_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L588_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L588_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L589_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L526_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L590_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L491_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L594_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L593_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L600_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L606_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L607_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L608_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L610_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L611_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L612_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L613_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L620_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L620_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L621_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L623_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L624_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L626_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L625_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L628_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L629_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L630_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L634_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L615_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L635_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L635_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L636_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L637_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L614_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L639_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L638_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L640_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L640_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L641_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L642_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L647_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L648_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L650_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L651_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L653_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L654_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L599_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L656_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L660_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L665_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L666_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L659_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L667_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L670_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L673_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L669_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L675_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L675_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L683_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L682_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L685_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L688_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L678_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L690_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L689_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L691_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L677_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L693_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L696_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L697_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L695_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L698_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L676_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L704_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L708_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L709_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L706_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L710_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L713_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L726_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L727_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:Try_L725_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L731_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L730_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L733_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L736_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L738_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L738_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L739_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L741_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L741_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L742_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L740_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L743_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L747_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L746_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L750_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L752_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L752_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L756_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L712_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L757_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L761_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L761_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L764_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L762_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L768_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L765_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L771_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L776_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L777_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L778_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L779_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L782_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L784_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L785_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L786_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L783_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L787_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L773_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L788_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L760_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L792_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L793_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L793_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L794_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L795_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L795_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L796_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L790_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L797_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L803_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L809_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L810_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L811_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L812_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L802_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L813_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L817_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L821_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L823_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L824_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L824_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L825_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L826_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L827_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L828_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L830_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L833_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L832_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L835_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L839_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L838_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L841_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L843_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L843_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L844_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L845_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L831_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L847_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L848_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L849_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L846_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L851_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L852_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L850_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L854_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L855_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L855_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L856_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L857_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L858_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L859_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L859_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L860_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L816_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L861_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L864_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L870_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L871_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L872_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L875_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L874_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L877_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L876_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L878_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L863_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L879_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L815_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L882_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L891_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L892_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L893_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L894_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L895_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L895_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L896_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L902_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L903_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L904_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L905_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L909_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L914_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L915_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L915_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L916_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L917_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L918_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L910_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L921_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L881_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L922_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L922_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L923_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L925_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L927_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L931_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L931_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L932_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L933_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L940_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L926_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Return_L941_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:ClassDef_L943_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L945_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L948_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L950_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L951_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:ImportFrom_L953_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L949_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L954_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L956_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L944_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L957_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L957_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L959_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L961_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L960_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L962_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:If_L962_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Assign_L963_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L958_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L964_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L968_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L967_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L971_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L974_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L975_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:FunctionDef_L974_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L981_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99011:For_L981_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99011:Expr_L983_C8"}] |
"""
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.query import Query
from django.db.models.sql.where import AND, Constraint
__all__ = ['DeleteQuery', 'UpdateQuery', 'InsertQuery', 'DateQuery',
'AggregateQuery']
class DeleteQuery(Query):
"""
Delete queries are done through this class, since they are more constrained
than general queries.
"""
compiler = 'SQLDeleteCompiler'
def do_query(self, table, where, using):
self.tables = [table]
self.where = where
self.get_compiler(using).execute_sql(None)
def delete_batch(self, pk_list, using, field=None):
"""
Set up and execute delete queries for all the objects in pk_list.
More than one physical query may be executed if there are a
lot of values in pk_list.
"""
if not field:
field = self.model._meta.pk
for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):
where = self.where_class()
where.add((Constraint(None, field.column, field), 'in',
pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]), AND)
self.do_query(self.model._meta.db_table, where, using=using)
class UpdateQuery(Query):
"""
Represents an "update" SQL query.
"""
compiler = 'SQLUpdateCompiler'
def __init__(self, *args, **kwargs):
super(UpdateQuery, self).__init__(*args, **kwargs)
self._setup_query()
def _setup_query(self):
"""
Runs on initialization and after cloning. Any attributes that would
normally be set in __init__ should go in here, instead, so that they
are also set up after a clone() call.
"""
self.values = []
self.related_ids = None
if not hasattr(self, 'related_updates'):
self.related_updates = {}
def clone(self, klass=None, **kwargs):
return super(UpdateQuery, self).clone(klass,
related_updates=self.related_updates.copy(), **kwargs)
def update_batch(self, pk_list, values, using):
pk_field = self.model._meta.pk
self.add_update_values(values)
for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):
self.where = self.where_class()
self.where.add((Constraint(None, pk_field.column, pk_field), 'in',
pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]),
AND)
self.get_compiler(using).execute_sql(None)
def add_update_values(self, values):
"""
Convert a dictionary of field name to value mappings into an update
query. This is the entry point for the public update() method on
querysets.
"""
values_seq = []
for name, val in values.iteritems():
field, model, direct, m2m = self.model._meta.get_field_by_name(name)
if not direct or m2m:
raise FieldError('Cannot update model field %r (only non-relations and foreign keys permitted).' % field)
if model:
self.add_related_update(model, field, val)
continue
values_seq.append((field, model, val))
return self.add_update_fields(values_seq)
def add_update_fields(self, values_seq):
"""
Turn a sequence of (field, model, value) triples into an update query.
Used by add_update_values() as well as the "fast" update path when
saving models.
"""
self.values.extend(values_seq)
def add_related_update(self, model, field, value):
"""
Adds (name, value) to an update query for an ancestor model.
Updates are coalesced so that we only run one update query per ancestor.
"""
try:
self.related_updates[model].append((field, None, value))
except KeyError:
self.related_updates[model] = [(field, None, value)]
def get_related_updates(self):
"""
Returns a list of query objects: one for each update required to an
ancestor model. Each query will have the same filtering conditions as
the current query but will only update a single table.
"""
if not self.related_updates:
return []
result = []
for model, values in self.related_updates.iteritems():
query = UpdateQuery(model)
query.values = values
if self.related_ids is not None:
query.add_filter(('pk__in', self.related_ids))
result.append(query)
return result
class InsertQuery(Query):
compiler = 'SQLInsertCompiler'
def __init__(self, *args, **kwargs):
super(InsertQuery, self).__init__(*args, **kwargs)
self.columns = []
self.values = []
self.params = ()
def clone(self, klass=None, **kwargs):
extras = {
'columns': self.columns[:],
'values': self.values[:],
'params': self.params
}
extras.update(kwargs)
return super(InsertQuery, self).clone(klass, **extras)
def insert_values(self, insert_values, raw_values=False):
"""
Set up the insert query from the 'insert_values' dictionary. The
dictionary gives the model field names and their target values.
If 'raw_values' is True, the values in the 'insert_values' dictionary
are inserted directly into the query, rather than passed as SQL
parameters. This provides a way to insert NULL and DEFAULT keywords
into the query, for example.
"""
placeholders, values = [], []
for field, val in insert_values:
placeholders.append((field, val))
self.columns.append(field.column)
values.append(val)
if raw_values:
self.values.extend([(None, v) for v in values])
else:
self.params += tuple(values)
self.values.extend(placeholders)
class DateQuery(Query):
"""
A DateQuery is a normal query, except that it specifically selects a single
date field. This requires some special handling when converting the results
back to Python objects, so we put it in a separate class.
"""
compiler = 'SQLDateCompiler'
def add_date_select(self, field_name, lookup_type, order='ASC'):
"""
Converts the query into a date extraction query.
"""
try:
result = self.setup_joins(
field_name.split(LOOKUP_SEP),
self.get_meta(),
self.get_initial_alias(),
False
)
except FieldError:
raise FieldDoesNotExist("%s has no field named '%s'" % (
self.model._meta.object_name, field_name
))
field = result[0]
assert isinstance(field, DateField), "%r isn't a DateField." \
% field.name
alias = result[3][-1]
select = Date((alias, field.column), lookup_type)
self.select = [select]
self.select_fields = [None]
self.select_related = False # See #7097.
self.set_extra_mask([])
self.distinct = True
self.order_by = order == 'ASC' and [1] or [-1]
if field.null:
self.add_filter(("%s__isnull" % field_name, False))
class AggregateQuery(Query):
"""
An AggregateQuery takes another query as a parameter to the FROM
clause and only selects the elements in the provided list.
"""
compiler = 'SQLAggregateCompiler'
def add_subquery(self, query, using):
self.subquery, self.sub_params = query.get_compiler(using).as_sql(with_col_aliases=True)
| ajibawa-2023/Python-Code-Large/train/row_99012 | 120 | 222 | 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_99012:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.009, 0.0135, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nQuery subclasses which provide extra functionality beyond simple data retrieval.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L5_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0225, 0.0045, 0, 0.66, 0.0714, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["FieldError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import FieldError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L6_C0", "label": "from django.db import connections", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.0045, 0, 0.66, 0.1429, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connections"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L7_C0", "label": "from django.db.models.fields import DateField, FieldDoesNotExist", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0315, 0.0045, 0, 0.66, 0.2143, 5, 0, 2, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["DateField", "FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import DateField, FieldDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L8_C0", "label": "from django.db.models.sql.constants import *", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.036, 0.0045, 0, 0.66, 0.2857, 971, 0, 1, 0, 0, 971, 0, 0], "semantic": {"name": "django.db.models.sql.constants", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.constants import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L9_C0", "label": "from django.db.models.sql.datastructures import Date", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0405, 0.0045, 0, 0.66, 0.3571, 945, 0, 1, 0, 0, 945, 0, 0], "semantic": {"name": "django.db.models.sql.datastructures", "arg_names": [], "import_names": ["Date"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.datastructures import Date"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L10_C0", "label": "from django.db.models.sql.expressions import SQLEvaluator", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.045, 0.0045, 0, 0.66, 0.4286, 438, 0, 1, 0, 0, 438, 0, 0], "semantic": {"name": "django.db.models.sql.expressions", "arg_names": [], "import_names": ["SQLEvaluator"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.expressions import SQLEvaluator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L11_C0", "label": "from django.db.models.sql.query import Query", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0495, 0.0045, 0, 0.66, 0.5, 656, 0, 1, 0, 0, 656, 0, 0], "semantic": {"name": "django.db.models.sql.query", "arg_names": [], "import_names": ["Query"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.query import Query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ImportFrom_L12_C0", "label": "from django.db.models.sql.where import AND, Constraint", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.0045, 0, 0.66, 0.5714, 737, 0, 2, 0, 0, 737, 0, 0], "semantic": {"name": "django.db.models.sql.where", "arg_names": [], "import_names": ["AND", "Constraint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.where import AND, Constraint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L14_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [14, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0653, 0.009, 0, 0.66, 0.6429, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ['DeleteQuery', 'UpdateQuery', 'InsertQuery', 'DateQuery',\n 'AggregateQuery']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "label": "DeleteQuery", "type": "class", "loc": [17, 43], "level": 0, "parent": null, "vector": [3, 0, 0.1351, 0.1216, 0, 0.66, 0.7143, 398, 0, 2, 0, 0, 279, 0, 8], "semantic": {"name": "DeleteQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DeleteQuery(Query):\n \"\"\"\n Delete queries are done through this class, since they are more constrained\n than general queries.\n \"\"\"\n\n compiler = 'SQLDeleteCompiler'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L18_C4", "label": "expression", "type": "expression", "loc": [18, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "vector": [8, 1, 0.0878, 0.018, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Delete queries are done through this class, since they are more constrained\n than general queries.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L23_C4", "label": "compiler =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "vector": [14, 1, 0.1036, 0.0045, 1, 0.69, 0.3333, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler = 'SQLDeleteCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "label": "do_query", "type": "function", "loc": [25, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "vector": [2, 1, 0.1194, 0.018, 1, 0.69, 0.6667, 989, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "do_query", "arg_names": ["self", "table", "where", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_query(self, table, where, using):\n self.tables = [table]\n self.where = where\n self.get_compiler(using).execute_sql(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L26_C8", "label": "self.tables =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "vector": [14, 2, 0.1171, 0.0045, 2, 0.78, 0.0, 140, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tables", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tables = [table]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L27_C8", "label": "self.where =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "vector": [14, 2, 0.1216, 0.0045, 2, 0.78, 0.5, 236, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.where", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.where = where"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L28_C8", "label": "execute_sql()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "vector": [8, 2, 0.1261, 0.0045, 2, 0.78, 1.0, 834, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute_sql", "arg_names": [], "import_names": [], "rhs_call_name": "execute_sql", "annotation": ""}, "snippet": " self.get_compiler(using).execute_sql(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "label": "delete_batch", "type": "function", "loc": [30, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "vector": [2, 1, 0.1644, 0.0631, 1, 0.69, 1.0, 133, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "delete_batch", "arg_names": ["self", "pk_list", "using", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_batch(self, pk_list, using, field=None):\n \"\"\"\n Set up and execute delete queries for all the objects in pk_list.\n\n More than one physical query may be executed if there are a\n lot of values in pk_list.\n \"\"\"\n if not field:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L31_C8", "label": "expression", "type": "expression", "loc": [31, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "vector": [8, 2, 0.1509, 0.027, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Set up and execute delete queries for all the objects in pk_list.\n\n More than one physical query may be executed if there are a\n lot of values in pk_list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L37_C8", "label": "if", "type": "if", "loc": [37, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "vector": [4, 2, 0.1689, 0.009, 2, 0.61, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not field:\n field = self.model._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L38_C12", "label": "field =", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L37_C8", "vector": [14, 3, 0.1712, 0.0045, 3, 0.47, 0.0, 480, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = self.model._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "label": "for offset", "type": "for", "loc": [39, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "vector": [6, 2, 0.1847, 0.0225, 2, 0.61, 1.0, 132, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):\n where = self.where_class()\n where.add((Constraint(None, field.column, field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]), AND)\n self.do_query(self.model._meta.db_table, where, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L40_C12", "label": "where = where_class()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "vector": [14, 3, 0.1802, 0.0045, 3, 0.04, 0.0, 169, 3, 0, 0, 0, 374, 10, 1], "semantic": {"name": "where", "arg_names": [], "import_names": [], "rhs_call_name": "where_class", "annotation": ""}, "snippet": " where = self.where_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L41_C12", "label": "add()", "type": "expression", "loc": [41, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "vector": [8, 3, 0.1869, 0.009, 3, 0.04, 0.5, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " where.add((Constraint(None, field.column, field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]), AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L43_C12", "label": "do_query()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "vector": [8, 3, 0.1937, 0.0045, 3, 0.04, 1.0, 989, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "do_query", "arg_names": [], "import_names": [], "rhs_call_name": "do_query", "annotation": ""}, "snippet": " self.do_query(self.model._meta.db_table, where, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "label": "UpdateQuery", "type": "class", "loc": [45, 133], "level": 0, "parent": null, "vector": [3, 0, 0.4009, 0.4009, 0, 0.66, 0.7857, 921, 0, 8, 0, 0, 279, 0, 27], "semantic": {"name": "UpdateQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UpdateQuery(Query):\n \"\"\"\n Represents an \"update\" SQL query.\n \"\"\"\n\n compiler = 'SQLUpdateCompiler'\n\n def __init__(self, *args, **kwargs):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L46_C4", "label": "expression", "type": "expression", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [8, 1, 0.2117, 0.0135, 1, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Represents an \"update\" SQL query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L50_C4", "label": "compiler =", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [14, 1, 0.2252, 0.0045, 1, 0.24, 0.1111, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler = 'SQLUpdateCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4", "label": "__init__", "type": "function", "loc": [52, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.2387, 0.0135, 1, 0.24, 0.2222, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n super(UpdateQuery, self).__init__(*args, **kwargs)\n self._setup_query()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L53_C8", "label": "__init__()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4", "vector": [8, 2, 0.2387, 0.0045, 2, 0.21, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(UpdateQuery, self).__init__(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L54_C8", "label": "_setup_query()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4", "vector": [8, 2, 0.2432, 0.0045, 2, 0.21, 1.0, 431, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_setup_query", "arg_names": [], "import_names": [], "rhs_call_name": "_setup_query", "annotation": ""}, "snippet": " self._setup_query()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "label": "_setup_query", "type": "function", "loc": [56, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.2725, 0.045, 1, 0.24, 0.3333, 431, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_setup_query", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _setup_query(self):\n \"\"\"\n Runs on initialization and after cloning. Any attributes that would\n normally be set in __init__ should go in here, instead, so that they\n are also set up after a clone() call.\n \"\"\"\n self.values = []\n self.related_ids = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L57_C8", "label": "expression", "type": "expression", "loc": [57, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "vector": [8, 2, 0.2658, 0.0225, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Runs on initialization and after cloning. Any attributes that would\n normally be set in __init__ should go in here, instead, so that they\n are also set up after a clone() call.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L62_C8", "label": "self.values =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "vector": [14, 2, 0.2793, 0.0045, 2, 0.56, 0.3333, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L63_C8", "label": "self.related_ids =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "vector": [14, 2, 0.2838, 0.0045, 2, 0.56, 0.6667, 401, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.related_ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related_ids = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L64_C8", "label": "if", "type": "if", "loc": [64, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "vector": [4, 2, 0.2905, 0.009, 2, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, 'related_updates'):\n self.related_updates = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L65_C12", "label": "self.related_updates =", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L64_C8", "vector": [14, 3, 0.2928, 0.0045, 3, 0.56, 0.0, 592, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.related_updates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related_updates = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L67_C4", "label": "clone", "type": "function", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.3063, 0.0135, 1, 0.24, 0.4444, 911, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "clone", "arg_names": ["self", "klass", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clone(self, klass=None, **kwargs):\n return super(UpdateQuery, self).clone(klass,\n related_updates=self.related_updates.copy(), **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L68_C8", "label": "return", "type": "return", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L67_C4", "vector": [13, 2, 0.3086, 0.009, 2, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(UpdateQuery, self).clone(klass,\n related_updates=self.related_updates.copy(), **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "label": "update_batch", "type": "function", "loc": [72, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.3423, 0.0405, 1, 0.24, 0.5556, 590, 0, 4, 0, 0, 0, 0, 8], "semantic": {"name": "update_batch", "arg_names": ["self", "pk_list", "values", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_batch(self, pk_list, values, using):\n pk_field = self.model._meta.pk\n self.add_update_values(values)\n for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):\n self.where = self.where_class()\n self.where.add((Constraint(None, pk_field.column, pk_field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]),\n AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L73_C8", "label": "pk_field =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "vector": [14, 2, 0.3288, 0.0045, 2, 0.98, 0.0, 871, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pk_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pk_field = self.model._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L74_C8", "label": "add_update_values()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "vector": [8, 2, 0.3333, 0.0045, 2, 0.98, 0.5, 329, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_update_values", "arg_names": [], "import_names": [], "rhs_call_name": "add_update_values", "annotation": ""}, "snippet": " self.add_update_values(values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "label": "for offset", "type": "for", "loc": [75, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "vector": [6, 2, 0.3491, 0.027, 2, 0.98, 1.0, 132, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):\n self.where = self.where_class()\n self.where.add((Constraint(None, pk_field.column, pk_field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]),\n AND)\n self.get_compiler(using).execute_sql(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L76_C12", "label": "self.where = where_class()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "vector": [14, 3, 0.3423, 0.0045, 3, 0.13, 0.0, 236, 3, 0, 0, 0, 374, 10, 1], "semantic": {"name": "self.where", "arg_names": [], "import_names": [], "rhs_call_name": "where_class", "annotation": ""}, "snippet": " self.where = self.where_class()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L77_C12", "label": "add()", "type": "expression", "loc": [77, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "vector": [8, 3, 0.3514, 0.0135, 3, 0.13, 0.5, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.where.add((Constraint(None, pk_field.column, pk_field), 'in',\n pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]),\n AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L80_C12", "label": "execute_sql()", "type": "expression", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "vector": [8, 3, 0.3604, 0.0045, 3, 0.13, 1.0, 834, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "execute_sql", "arg_names": [], "import_names": [], "rhs_call_name": "execute_sql", "annotation": ""}, "snippet": " self.get_compiler(using).execute_sql(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "label": "add_update_values", "type": "function", "loc": [82, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.4032, 0.0721, 1, 0.24, 0.6667, 329, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "add_update_values", "arg_names": ["self", "values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_update_values(self, values):\n \"\"\"\n Convert a dictionary of field name to value mappings into an update\n query. This is the entry point for the public update() method on\n querysets.\n \"\"\"\n values_seq = []\n for name, val in values.iteritems():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L83_C8", "label": "expression", "type": "expression", "loc": [83, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "vector": [8, 2, 0.3829, 0.0225, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Convert a dictionary of field name to value mappings into an update\n query. This is the entry point for the public update() method on\n querysets.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L88_C8", "label": "values_seq =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "vector": [14, 2, 0.3964, 0.0045, 2, 0.4, 0.3333, 148, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "values_seq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values_seq = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "label": "for name, val", "type": "for", "loc": [89, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "vector": [6, 2, 0.4167, 0.036, 2, 0.4, 0.6667, 762, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "name, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, val in values.iteritems():\n field, model, direct, m2m = self.model._meta.get_field_by_name(name)\n if not direct or m2m:\n raise FieldError('Cannot update model field %r (only non-relations and foreign keys permitted).' % field)\n if model:\n self.add_related_update(model, field, val)\n continue\n values_seq.append((field, model, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L90_C12", "label": "field, model, direct, m2m = get_field_by_name()", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "vector": [14, 3, 0.4054, 0.0045, 3, 0.45, 0.0, 283, 3, 1, 0, 0, 779, 10, 1], "semantic": {"name": "field, model, direct, m2m", "arg_names": [], "import_names": [], "rhs_call_name": "get_field_by_name", "annotation": ""}, "snippet": " field, model, direct, m2m = self.model._meta.get_field_by_name(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L91_C12", "label": "if", "type": "if", "loc": [91, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "vector": [4, 3, 0.4122, 0.009, 3, 0.45, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not direct or m2m:\n raise FieldError('Cannot update model field %r (only non-relations and foreign keys permitted).' % field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L93_C12", "label": "if", "type": "if", "loc": [93, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "vector": [4, 3, 0.4234, 0.0135, 3, 0.45, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model:\n self.add_related_update(model, field, val)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L94_C16", "label": "add_related_update()", "type": "expression", "loc": [94, 94], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L93_C12", "vector": [8, 4, 0.4234, 0.0045, 4, 0.63, 0.0, 204, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_related_update", "arg_names": [], "import_names": [], "rhs_call_name": "add_related_update", "annotation": ""}, "snippet": " self.add_related_update(model, field, val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L96_C12", "label": "append()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "vector": [8, 3, 0.4324, 0.0045, 3, 0.45, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " values_seq.append((field, model, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "vector": [13, 2, 0.4369, 0.0045, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.add_update_fields(values_seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4", "label": "add_update_fields", "type": "function", "loc": [99, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.4595, 0.0315, 1, 0.24, 0.7778, 421, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_update_fields", "arg_names": ["self", "values_seq"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_update_fields(self, values_seq):\n \"\"\"\n Turn a sequence of (field, model, value) triples into an update query.\n Used by add_update_values() as well as the \"fast\" update path when\n saving models.\n \"\"\"\n self.values.extend(values_seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L100_C8", "label": "expression", "type": "expression", "loc": [100, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4", "vector": [8, 2, 0.4595, 0.0225, 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 Turn a sequence of (field, model, value) triples into an update query.\n Used by add_update_values() as well as the \"fast\" update path when\n saving models.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L105_C8", "label": "extend()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4", "vector": [8, 2, 0.473, 0.0045, 2, 0.24, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.values.extend(values_seq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4", "label": "add_related_update", "type": "function", "loc": [107, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.5023, 0.045, 1, 0.24, 0.8889, 204, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_related_update", "arg_names": ["self", "model", "field", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_related_update(self, model, field, value):\n \"\"\"\n Adds (name, value) to an update query for an ancestor model.\n\n Updates are coalesced so that we only run one update query per ancestor.\n \"\"\"\n try:\n self.related_updates[model].append((field, None, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L108_C8", "label": "expression", "type": "expression", "loc": [108, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4", "vector": [8, 2, 0.4955, 0.0225, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Adds (name, value) to an update query for an ancestor model.\n\n Updates are coalesced so that we only run one update query per ancestor.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8", "label": "try", "type": "try", "loc": [113, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4", "vector": [7, 2, 0.5158, 0.018, 2, 0.34, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.related_updates[model].append((field, None, value))\n except KeyError:\n self.related_updates[model] = [(field, None, value)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L114_C12", "label": "append()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8", "vector": [8, 3, 0.5135, 0.0045, 3, 0.32, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.related_updates[model].append((field, None, value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L116_C12", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8", "vector": [14, 3, 0.5225, 0.0045, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related_updates[model] = [(field, None, value)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "label": "get_related_updates", "type": "function", "loc": [118, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "vector": [2, 1, 0.5653, 0.0721, 1, 0.24, 1.0, 679, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_related_updates", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_related_updates(self):\n \"\"\"\n Returns a list of query objects: one for each update required to an\n ancestor model. Each query will have the same filtering conditions as\n the current query but will only update a single table.\n \"\"\"\n if not self.related_updates:\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L119_C8", "label": "expression", "type": "expression", "loc": [119, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "vector": [8, 2, 0.545, 0.0225, 2, 0.7, 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 query objects: one for each update required to an\n ancestor model. Each query will have the same filtering conditions as\n the current query but will only update a single table.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L124_C8", "label": "if", "type": "if", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "vector": [4, 2, 0.5608, 0.009, 2, 0.7, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.related_updates:\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L125_C12", "label": "return", "type": "return", "loc": [125, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L124_C8", "vector": [13, 3, 0.5631, 0.0045, 3, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L126_C8", "label": "result =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "vector": [14, 2, 0.5676, 0.0045, 2, 0.7, 0.5, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "label": "for model, values", "type": "for", "loc": [127, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "vector": [6, 2, 0.5833, 0.027, 2, 0.7, 0.75, 173, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "model, values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model, values in self.related_updates.iteritems():\n query = UpdateQuery(model)\n query.values = values\n if self.related_ids is not None:\n query.add_filter(('pk__in', self.related_ids))\n result.append(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L128_C12", "label": "query = UpdateQuery()", "type": "assigned_variable", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "vector": [14, 3, 0.5766, 0.0045, 3, 0.52, 0.0, 546, 3, 1, 0, 0, 921, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "UpdateQuery", "annotation": ""}, "snippet": " query = UpdateQuery(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L129_C12", "label": "query.values =", "type": "assigned_variable", "loc": [129, 129], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "vector": [14, 3, 0.5811, 0.0045, 3, 0.52, 0.3333, 628, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "query.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query.values = values"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L130_C12", "label": "if", "type": "if", "loc": [130, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "vector": [4, 3, 0.5878, 0.009, 3, 0.52, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.related_ids is not None:\n query.add_filter(('pk__in', self.related_ids))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L131_C16", "label": "add_filter()", "type": "expression", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L130_C12", "vector": [8, 4, 0.5901, 0.0045, 4, 0.99, 0.0, 783, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_filter", "arg_names": [], "import_names": [], "rhs_call_name": "add_filter", "annotation": ""}, "snippet": " query.add_filter(('pk__in', self.related_ids))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L132_C12", "label": "append()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "vector": [8, 3, 0.5946, 0.0045, 3, 0.52, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "vector": [13, 2, 0.5991, 0.0045, 2, 0.7, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "label": "InsertQuery", "type": "class", "loc": [135, 172], "level": 0, "parent": null, "vector": [3, 0, 0.6914, 0.1712, 0, 0.66, 0.8571, 137, 0, 3, 0, 0, 279, 0, 11], "semantic": {"name": "InsertQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InsertQuery(Query):\n compiler = 'SQLInsertCompiler'\n\n def __init__(self, *args, **kwargs):\n super(InsertQuery, self).__init__(*args, **kwargs)\n self.columns = []\n self.values = []\n self.params = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L136_C4", "label": "compiler =", "type": "assigned_variable", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "vector": [14, 1, 0.6126, 0.0045, 1, 0.52, 0.0, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler = 'SQLInsertCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "label": "__init__", "type": "function", "loc": [138, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "vector": [2, 1, 0.6306, 0.0225, 1, 0.52, 0.3333, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n super(InsertQuery, self).__init__(*args, **kwargs)\n self.columns = []\n self.values = []\n self.params = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L139_C8", "label": "__init__()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "vector": [8, 2, 0.6261, 0.0045, 2, 0.0, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(InsertQuery, self).__init__(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L140_C8", "label": "self.columns =", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "vector": [14, 2, 0.6306, 0.0045, 2, 0.0, 0.3333, 776, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.columns = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L141_C8", "label": "self.values =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "vector": [14, 2, 0.6351, 0.0045, 2, 0.0, 0.6667, 397, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.values = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L142_C8", "label": "self.params =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "vector": [14, 2, 0.6396, 0.0045, 2, 0.0, 1.0, 402, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "label": "clone", "type": "function", "loc": [144, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "vector": [2, 1, 0.6644, 0.036, 1, 0.52, 0.6667, 911, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "clone", "arg_names": ["self", "klass", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clone(self, klass=None, **kwargs):\n extras = {\n 'columns': self.columns[:],\n 'values': self.values[:],\n 'params': self.params\n }\n extras.update(kwargs)\n return super(InsertQuery, self).clone(klass, **extras)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L145_C8", "label": "extras =", "type": "assigned_variable", "loc": [145, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "vector": [14, 2, 0.6622, 0.0225, 2, 0.36, 0.0, 755, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "extras", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extras = {\n 'columns': self.columns[:],\n 'values': self.values[:],\n 'params': self.params\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L150_C8", "label": "update()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "vector": [8, 2, 0.6757, 0.0045, 2, 0.36, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " extras.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "vector": [13, 2, 0.6802, 0.0045, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(InsertQuery, self).clone(klass, **extras)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "label": "insert_values", "type": "function", "loc": [153, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "vector": [2, 1, 0.732, 0.0901, 1, 0.52, 1.0, 128, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "insert_values", "arg_names": ["self", "insert_values", "raw_values"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def insert_values(self, insert_values, raw_values=False):\n \"\"\"\n Set up the insert query from the 'insert_values' dictionary. The\n dictionary gives the model field names and their target values.\n\n If 'raw_values' is True, the values in the 'insert_values' dictionary\n are inserted directly into the query, rather than passed as SQL\n parameters. This provides a way to insert NULL and DEFAULT keywords"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L154_C8", "label": "expression", "type": "expression", "loc": [154, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "vector": [8, 2, 0.7117, 0.0405, 2, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Set up the insert query from the 'insert_values' dictionary. The\n dictionary gives the model field names and their target values.\n\n If 'raw_values' is True, the values in the 'insert_values' dictionary\n are inserted directly into the query, rather than passed as SQL\n parameters. This provides a way to insert NULL and DEFAULT keywords\n into the query, for example."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L163_C8", "label": "placeholders, values =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "vector": [14, 2, 0.7342, 0.0045, 2, 0.49, 0.3333, 492, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "placeholders, values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " placeholders, values = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "label": "for field, val", "type": "for", "loc": [164, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "vector": [6, 2, 0.7455, 0.018, 2, 0.49, 0.6667, 343, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "field, val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, val in insert_values:\n placeholders.append((field, val))\n self.columns.append(field.column)\n values.append(val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L165_C12", "label": "append()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "vector": [8, 3, 0.7432, 0.0045, 3, 0.86, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " placeholders.append((field, val))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L166_C12", "label": "append()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "vector": [8, 3, 0.7477, 0.0045, 3, 0.86, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.columns.append(field.column)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L167_C12", "label": "append()", "type": "expression", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "vector": [8, 3, 0.7523, 0.0045, 3, 0.86, 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(val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8", "label": "if", "type": "if", "loc": [168, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "vector": [4, 2, 0.7658, 0.0225, 2, 0.49, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if raw_values:\n self.values.extend([(None, v) for v in values])\n else:\n self.params += tuple(values)\n self.values.extend(placeholders)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L169_C12", "label": "extend()", "type": "expression", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8", "vector": [8, 3, 0.7613, 0.0045, 3, 0.45, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.values.extend([(None, v) for v in values])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L172_C12", "label": "extend()", "type": "expression", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8", "vector": [8, 3, 0.7748, 0.0045, 3, 0.45, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self.values.extend(placeholders)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "label": "DateQuery", "type": "class", "loc": [174, 211], "level": 0, "parent": null, "vector": [3, 0, 0.8671, 0.1712, 0, 0.66, 0.9286, 6, 0, 1, 0, 0, 279, 0, 9], "semantic": {"name": "DateQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DateQuery(Query):\n \"\"\"\n A DateQuery is a normal query, except that it specifically selects a single\n date field. This requires some special handling when converting the results\n back to Python objects, so we put it in a separate class.\n \"\"\"\n\n compiler = 'SQLDateCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L175_C4", "label": "expression", "type": "expression", "loc": [175, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "vector": [8, 1, 0.7973, 0.0225, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A DateQuery is a normal query, except that it specifically selects a single\n date field. This requires some special handling when converting the results\n back to Python objects, so we put it in a separate class.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L181_C4", "label": "compiler =", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "vector": [14, 1, 0.8153, 0.0045, 1, 0.65, 0.5, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler = 'SQLDateCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "label": "add_date_select", "type": "function", "loc": [183, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "vector": [2, 1, 0.8874, 0.1306, 1, 0.65, 1.0, 813, 0, 4, 0, 0, 0, 0, 9], "semantic": {"name": "add_date_select", "arg_names": ["self", "field_name", "lookup_type", "order"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_date_select(self, field_name, lookup_type, order='ASC'):\n \"\"\"\n Converts the query into a date extraction query.\n \"\"\"\n try:\n result = self.setup_joins(\n field_name.split(LOOKUP_SEP),\n self.get_meta(),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L184_C8", "label": "expression", "type": "expression", "loc": [184, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [8, 2, 0.8333, 0.0135, 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 Converts the query into a date extraction query.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L187_C8", "label": "try", "type": "try", "loc": [187, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [7, 2, 0.8649, 0.0495, 2, 0.79, 0.0909, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n result = self.setup_joins(\n field_name.split(LOOKUP_SEP),\n self.get_meta(),\n self.get_initial_alias(),\n False\n )\n except FieldError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L188_C12", "label": "result = setup_joins()", "type": "assigned_variable", "loc": [188, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L187_C8", "vector": [14, 3, 0.8581, 0.027, 3, 0.96, 0.0, 51, 3, 4, 0, 0, 955, 10, 4], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "setup_joins", "annotation": ""}, "snippet": " result = self.setup_joins(\n field_name.split(LOOKUP_SEP),\n self.get_meta(),\n self.get_initial_alias(),\n False\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L198_C8", "label": "field =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.8919, 0.0045, 2, 0.79, 0.1818, 480, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = result[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L201_C8", "label": "alias =", "type": "assigned_variable", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9054, 0.0045, 2, 0.79, 0.2727, 657, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " alias = result[3][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L202_C8", "label": "select = Date()", "type": "assigned_variable", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9099, 0.0045, 2, 0.79, 0.3636, 438, 3, 2, 0, 0, 929, 10, 1], "semantic": {"name": "select", "arg_names": [], "import_names": [], "rhs_call_name": "Date", "annotation": ""}, "snippet": " select = Date((alias, field.column), lookup_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L203_C8", "label": "self.select =", "type": "assigned_variable", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9144, 0.0045, 2, 0.79, 0.4545, 801, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.select", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.select = [select]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L204_C8", "label": "self.select_fields =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9189, 0.0045, 2, 0.79, 0.5455, 196, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.select_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.select_fields = [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L205_C8", "label": "self.select_related =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9234, 0.0045, 2, 0.79, 0.6364, 466, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.select_related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.select_related = False # See #7097."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L206_C8", "label": "set_extra_mask()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [8, 2, 0.9279, 0.0045, 2, 0.79, 0.7273, 286, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_extra_mask", "arg_names": [], "import_names": [], "rhs_call_name": "set_extra_mask", "annotation": ""}, "snippet": " self.set_extra_mask([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L207_C8", "label": "self.distinct =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9324, 0.0045, 2, 0.79, 0.8182, 761, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.distinct", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.distinct = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L208_C8", "label": "self.order_by =", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [14, 2, 0.9369, 0.0045, 2, 0.79, 0.9091, 842, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.order_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.order_by = order == 'ASC' and [1] or [-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L210_C8", "label": "if", "type": "if", "loc": [210, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "vector": [4, 2, 0.9482, 0.009, 2, 0.79, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.null:\n self.add_filter((\"%s__isnull\" % field_name, False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L211_C12", "label": "add_filter()", "type": "expression", "loc": [211, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L210_C8", "vector": [8, 3, 0.9505, 0.0045, 3, 0.6, 0.0, 783, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_filter", "arg_names": [], "import_names": [], "rhs_call_name": "add_filter", "annotation": ""}, "snippet": " self.add_filter((\"%s__isnull\" % field_name, False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "label": "AggregateQuery", "type": "class", "loc": [213, 222], "level": 0, "parent": null, "vector": [3, 0, 0.9797, 0.045, 0, 0.66, 1.0, 592, 0, 1, 0, 0, 279, 0, 2], "semantic": {"name": "AggregateQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AggregateQuery(Query):\n \"\"\"\n An AggregateQuery takes another query as a parameter to the FROM\n clause and only selects the elements in the provided list.\n \"\"\"\n\n compiler = 'SQLAggregateCompiler'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L214_C4", "label": "expression", "type": "expression", "loc": [214, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "vector": [8, 1, 0.9707, 0.018, 1, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An AggregateQuery takes another query as a parameter to the FROM\n clause and only selects the elements in the provided list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L219_C4", "label": "compiler =", "type": "assigned_variable", "loc": [219, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "vector": [14, 1, 0.9865, 0.0045, 1, 0.19, 0.5, 738, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "compiler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " compiler = 'SQLAggregateCompiler'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L221_C4", "label": "add_subquery", "type": "function", "loc": [221, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "vector": [2, 1, 0.9977, 0.009, 1, 0.19, 1.0, 505, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_subquery", "arg_names": ["self", "query", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_subquery(self, query, using):\n self.subquery, self.sub_params = query.get_compiler(using).as_sql(with_col_aliases=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L222_C8", "label": " = as_sql()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L221_C4", "vector": [14, 2, 1.0, 0.0045, 2, 0.79, 0.0, 0, 3, 1, 0, 0, 122, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " self.subquery, self.sub_params = query.get_compiler(using).as_sql(with_col_aliases=True)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L39_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L64_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L93_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L94_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L130_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L131_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L135_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L174_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:Try_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:ClassDef_L213_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99012:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99012:Assign_L222_C8"}] |
from django.core.exceptions import FieldError
from django.db.models.fields import FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP
class SQLEvaluator(object):
def __init__(self, expression, query, allow_joins=True):
self.expression = expression
self.opts = query.get_meta()
self.cols = {}
self.contains_aggregate = False
self.expression.prepare(self, query, allow_joins)
def prepare(self):
return self
def as_sql(self, qn, connection):
return self.expression.evaluate(self, qn, connection)
def relabel_aliases(self, change_map):
for node, col in self.cols.items():
self.cols[node] = (change_map.get(col[0], col[0]), col[1])
#####################################################
# Vistor methods for initial expression preparation #
#####################################################
def prepare_node(self, node, query, allow_joins):
for child in node.children:
if hasattr(child, 'prepare'):
child.prepare(self, query, allow_joins)
def prepare_leaf(self, node, query, allow_joins):
if not allow_joins and LOOKUP_SEP in node.name:
raise FieldError("Joined field references are not permitted in this query")
field_list = node.name.split(LOOKUP_SEP)
if (len(field_list) == 1 and
node.name in query.aggregate_select.keys()):
self.contains_aggregate = True
self.cols[node] = query.aggregate_select[node.name]
else:
try:
field, source, opts, join_list, last, _ = query.setup_joins(
field_list, query.get_meta(),
query.get_initial_alias(), False)
col, _, join_list = query.trim_joins(source, join_list, last, False)
self.cols[node] = (join_list[-1], col)
except FieldDoesNotExist:
raise FieldError("Cannot resolve keyword %r into field. "
"Choices are: %s" % (self.name,
[f.name for f in self.opts.fields]))
##################################################
# Vistor methods for final expression evaluation #
##################################################
def evaluate_node(self, node, qn, connection):
expressions = []
expression_params = []
for child in node.children:
if hasattr(child, 'evaluate'):
sql, params = child.evaluate(self, qn, connection)
else:
sql, params = '%s', (child,)
if len(getattr(child, 'children', [])) > 1:
format = '(%s)'
else:
format = '%s'
if sql:
expressions.append(format % sql)
expression_params.extend(params)
return connection.ops.combine_expression(node.connector, expressions), expression_params
def evaluate_leaf(self, node, qn, connection):
col = self.cols[node]
if hasattr(col, 'as_sql'):
return col.as_sql(qn, connection), ()
else:
return '%s.%s' % (qn(col[0]), qn(col[1])), ()
| ajibawa-2023/Python-Code-Large/train/row_99013 | 50 | 84 | 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_99013:ImportFrom_L1_C0", "label": "from django.core.exceptions import FieldError", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0119, 0.0119, 0, 0.66, 0.0, 160, 0, 1, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["FieldError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import FieldError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:ImportFrom_L2_C0", "label": "from django.db.models.fields import FieldDoesNotExist", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0238, 0.0119, 0, 0.66, 0.3333, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import FieldDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:ImportFrom_L3_C0", "label": "from django.db.models.sql.constants import LOOKUP_SEP", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0357, 0.0119, 0, 0.66, 0.6667, 971, 0, 1, 0, 0, 971, 0, 0], "semantic": {"name": "django.db.models.sql.constants", "arg_names": [], "import_names": ["LOOKUP_SEP"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.sql.constants import LOOKUP_SEP"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "label": "SQLEvaluator", "type": "class", "loc": [5, 84], "level": 0, "parent": null, "vector": [3, 0, 0.5298, 0.9524, 0, 0.66, 1.0, 825, 0, 8, 0, 0, 186, 0, 27], "semantic": {"name": "SQLEvaluator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SQLEvaluator(object):\n def __init__(self, expression, query, allow_joins=True):\n self.expression = expression\n self.opts = query.get_meta()\n self.cols = {}\n\n self.contains_aggregate = False\n self.expression.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "label": "__init__", "type": "function", "loc": [6, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.1071, 0.0833, 1, 0.71, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "expression", "query", "allow_joins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, expression, query, allow_joins=True):\n self.expression = expression\n self.opts = query.get_meta()\n self.cols = {}\n\n self.contains_aggregate = False\n self.expression.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L7_C8", "label": "self.expression =", "type": "assigned_variable", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "vector": [14, 2, 0.0833, 0.0119, 2, 0.45, 0.0, 749, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.expression", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.expression = expression"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L8_C8", "label": "self.opts = get_meta()", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "vector": [14, 2, 0.0952, 0.0119, 2, 0.45, 0.25, 26, 3, 0, 0, 0, 671, 10, 1], "semantic": {"name": "self.opts", "arg_names": [], "import_names": [], "rhs_call_name": "get_meta", "annotation": ""}, "snippet": " self.opts = query.get_meta()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L9_C8", "label": "self.cols =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "vector": [14, 2, 0.1071, 0.0119, 2, 0.45, 0.5, 465, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.cols", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cols = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L11_C8", "label": "self.contains_aggregate =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "vector": [14, 2, 0.131, 0.0119, 2, 0.45, 0.75, 465, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contains_aggregate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contains_aggregate = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L12_C8", "label": "prepare()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "vector": [8, 2, 0.1429, 0.0119, 2, 0.45, 1.0, 556, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "prepare", "arg_names": [], "import_names": [], "rhs_call_name": "prepare", "annotation": ""}, "snippet": " self.expression.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L14_C4", "label": "prepare", "type": "function", "loc": [14, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.1726, 0.0238, 1, 0.71, 0.1429, 556, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "prepare", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self):\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L15_C8", "label": "return", "type": "return", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L14_C4", "vector": [13, 2, 0.1786, 0.0119, 2, 0.53, 0.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_99013:FunctionDef_L17_C4", "label": "as_sql", "type": "function", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.2083, 0.0238, 1, 0.71, 0.2857, 122, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn, connection):\n return self.expression.evaluate(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L17_C4", "vector": [13, 2, 0.2143, 0.0119, 2, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.expression.evaluate(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L20_C4", "label": "relabel_aliases", "type": "function", "loc": [20, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.25, 0.0357, 1, 0.71, 0.4286, 905, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map):\n for node, col in self.cols.items():\n self.cols[node] = (change_map.get(col[0], col[0]), col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L21_C8", "label": "for node, col", "type": "for", "loc": [21, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L20_C4", "vector": [6, 2, 0.256, 0.0238, 2, 0.09, 0.0, 161, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "node, col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for node, col in self.cols.items():\n self.cols[node] = (change_map.get(col[0], col[0]), col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L22_C12", "label": "assign", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L21_C8", "vector": [14, 3, 0.2619, 0.0119, 3, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cols[node] = (change_map.get(col[0], col[0]), col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L28_C4", "label": "prepare_node", "type": "function", "loc": [28, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.3512, 0.0476, 1, 0.71, 0.5714, 356, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "prepare_node", "arg_names": ["self", "node", "query", "allow_joins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare_node(self, node, query, allow_joins):\n for child in node.children:\n if hasattr(child, 'prepare'):\n child.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L29_C8", "label": "for child", "type": "for", "loc": [29, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L28_C4", "vector": [6, 2, 0.3571, 0.0357, 2, 0.04, 0.0, 967, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in node.children:\n if hasattr(child, 'prepare'):\n child.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L30_C12", "label": "if", "type": "if", "loc": [30, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L29_C8", "vector": [4, 3, 0.3631, 0.0238, 3, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(child, 'prepare'):\n child.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L31_C16", "label": "prepare()", "type": "expression", "loc": [31, 31], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L30_C12", "vector": [8, 4, 0.369, 0.0119, 4, 0.0, 0.0, 556, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "prepare", "arg_names": [], "import_names": [], "rhs_call_name": "prepare", "annotation": ""}, "snippet": " child.prepare(self, query, allow_joins)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "label": "prepare_leaf", "type": "function", "loc": [33, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.5119, 0.25, 1, 0.71, 0.7143, 415, 0, 4, 0, 0, 0, 0, 9], "semantic": {"name": "prepare_leaf", "arg_names": ["self", "node", "query", "allow_joins"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare_leaf(self, node, query, allow_joins):\n if not allow_joins and LOOKUP_SEP in node.name:\n raise FieldError(\"Joined field references are not permitted in this query\")\n\n field_list = node.name.split(LOOKUP_SEP)\n if (len(field_list) == 1 and\n node.name in query.aggregate_select.keys()):\n self.contains_aggregate = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L34_C8", "label": "if", "type": "if", "loc": [34, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "vector": [4, 2, 0.4107, 0.0238, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not allow_joins and LOOKUP_SEP in node.name:\n raise FieldError(\"Joined field references are not permitted in this query\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L37_C8", "label": "field_list = split()", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "vector": [14, 2, 0.4405, 0.0119, 2, 0.66, 0.5, 97, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "field_list", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " field_list = node.name.split(LOOKUP_SEP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "label": "if", "type": "if", "loc": [38, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "vector": [4, 2, 0.5417, 0.1905, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(field_list) == 1 and\n node.name in query.aggregate_select.keys()):\n self.contains_aggregate = True\n self.cols[node] = query.aggregate_select[node.name]\n else:\n try:\n field, source, opts, join_list, last, _ = query.setup_joins(\n field_list, query.get_meta(),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L40_C12", "label": "self.contains_aggregate =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "vector": [14, 3, 0.4762, 0.0119, 3, 0.91, 0.0, 465, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.contains_aggregate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.contains_aggregate = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L41_C12", "label": "assign", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "vector": [14, 3, 0.4881, 0.0119, 3, 0.91, 0.5, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cols[node] = query.aggregate_select[node.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "label": "try", "type": "try", "loc": [43, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "vector": [7, 3, 0.5714, 0.131, 3, 0.91, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n field, source, opts, join_list, last, _ = query.setup_joins(\n field_list, query.get_meta(),\n query.get_initial_alias(), False)\n col, _, join_list = query.trim_joins(source, join_list, last, False)\n\n self.cols[node] = (join_list[-1], col)\n except FieldDoesNotExist:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L44_C16", "label": "field, source, opts, join_list, last, _ = setup_joins()", "type": "assigned_variable", "loc": [44, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "vector": [14, 4, 0.5357, 0.0357, 4, 0.03, 0.0, 480, 3, 4, 0, 0, 955, 10, 3], "semantic": {"name": "field, source, opts, join_list, last, _", "arg_names": [], "import_names": [], "rhs_call_name": "setup_joins", "annotation": ""}, "snippet": " field, source, opts, join_list, last, _ = query.setup_joins(\n field_list, query.get_meta(),\n query.get_initial_alias(), False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L47_C16", "label": "col, _, join_list = trim_joins()", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "vector": [14, 4, 0.5595, 0.0119, 4, 0.03, 0.5, 776, 3, 4, 0, 0, 49, 10, 1], "semantic": {"name": "col, _, join_list", "arg_names": [], "import_names": [], "rhs_call_name": "trim_joins", "annotation": ""}, "snippet": " col, _, join_list = query.trim_joins(source, join_list, last, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L49_C16", "label": "assign", "type": "assigned_variable", "loc": [49, 49], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "vector": [14, 4, 0.5833, 0.0119, 4, 0.03, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cols[node] = (join_list[-1], col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "label": "evaluate_node", "type": "function", "loc": [59, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.8095, 0.2262, 1, 0.71, 0.8571, 356, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "evaluate_node", "arg_names": ["self", "node", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def evaluate_node(self, node, qn, connection):\n expressions = []\n expression_params = []\n for child in node.children:\n if hasattr(child, 'evaluate'):\n sql, params = child.evaluate(self, qn, connection)\n else:\n sql, params = '%s', (child,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L60_C8", "label": "expressions =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "vector": [14, 2, 0.7143, 0.0119, 2, 0.39, 0.0, 860, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "expressions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expressions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L61_C8", "label": "expression_params =", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "vector": [14, 2, 0.7262, 0.0119, 2, 0.39, 0.3333, 70, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "expression_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " expression_params = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "label": "for child", "type": "for", "loc": [62, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "vector": [6, 2, 0.8155, 0.1667, 2, 0.39, 0.6667, 967, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in node.children:\n if hasattr(child, 'evaluate'):\n sql, params = child.evaluate(self, qn, connection)\n else:\n sql, params = '%s', (child,)\n\n if len(getattr(child, 'children', [])) > 1:\n format = '(%s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12", "label": "if", "type": "if", "loc": [63, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "vector": [4, 3, 0.7679, 0.0476, 3, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(child, 'evaluate'):\n sql, params = child.evaluate(self, qn, connection)\n else:\n sql, params = '%s', (child,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L64_C16", "label": "sql, params = evaluate()", "type": "assigned_variable", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12", "vector": [14, 4, 0.7619, 0.0119, 4, 0.07, 0.0, 643, 3, 3, 0, 0, 528, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "evaluate", "annotation": ""}, "snippet": " sql, params = child.evaluate(self, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L66_C16", "label": "sql, params =", "type": "assigned_variable", "loc": [66, 66], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12", "vector": [14, 4, 0.7857, 0.0119, 4, 0.07, 1.0, 643, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql, params = '%s', (child,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12", "label": "if", "type": "if", "loc": [68, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "vector": [4, 3, 0.8274, 0.0476, 3, 0.55, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(getattr(child, 'children', [])) > 1:\n format = '(%s)'\n else:\n format = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L69_C16", "label": "format =", "type": "assigned_variable", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12", "vector": [14, 4, 0.8214, 0.0119, 4, 0.92, 0.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = '(%s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L71_C16", "label": "format =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12", "vector": [14, 4, 0.8452, 0.0119, 4, 0.92, 1.0, 293, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12", "label": "if", "type": "if", "loc": [73, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "vector": [4, 3, 0.881, 0.0357, 3, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sql:\n expressions.append(format % sql)\n expression_params.extend(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L74_C16", "label": "append()", "type": "expression", "loc": [74, 74], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12", "vector": [8, 4, 0.881, 0.0119, 4, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " expressions.append(format % sql)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L75_C16", "label": "extend()", "type": "expression", "loc": [75, 75], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12", "vector": [8, 4, 0.8929, 0.0119, 4, 0.27, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " expression_params.extend(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L77_C8", "label": "return", "type": "return", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "vector": [13, 2, 0.9167, 0.0119, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return connection.ops.combine_expression(node.connector, expressions), expression_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4", "label": "evaluate_leaf", "type": "function", "loc": [79, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "vector": [2, 1, 0.9702, 0.0714, 1, 0.71, 1.0, 236, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "evaluate_leaf", "arg_names": ["self", "node", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def evaluate_leaf(self, node, qn, connection):\n col = self.cols[node]\n if hasattr(col, 'as_sql'):\n return col.as_sql(qn, connection), ()\n else:\n return '%s.%s' % (qn(col[0]), qn(col[1])), ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L80_C8", "label": "col =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4", "vector": [14, 2, 0.9524, 0.0119, 2, 0.72, 0.0, 157, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = self.cols[node]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8", "label": "if", "type": "if", "loc": [81, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4", "vector": [4, 2, 0.9821, 0.0476, 2, 0.72, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(col, 'as_sql'):\n return col.as_sql(qn, connection), ()\n else:\n return '%s.%s' % (qn(col[0]), qn(col[1])), ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8", "vector": [13, 3, 0.9762, 0.0119, 3, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return col.as_sql(qn, connection), ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L84_C12", "label": "return", "type": "return", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8", "vector": [13, 3, 1.0, 0.0119, 3, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s.%s' % (qn(col[0]), qn(col[1])), ()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L30_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L31_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L64_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L63_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L66_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L69_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L68_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:For_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L74_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L73_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Expr_L75_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99013:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99013:Return_L84_C12"}] |
import re
# Valid query types (a dictionary is used for speedy lookups).
QUERY_TERMS = dict([(x, None) for x in (
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
)])
# Size of each "chunk" for get_iterator calls.
# Larger values are slightly faster at the expense of more storage space.
GET_ITERATOR_CHUNK_SIZE = 100
# Separator used to split filter strings apart.
LOOKUP_SEP = '__'
# Constants to make looking up tuple values clearer.
# Join lists (indexes into the tuples that are values in the alias_map
# dictionary in the Query class).
TABLE_NAME = 0
RHS_ALIAS = 1
JOIN_TYPE = 2
LHS_ALIAS = 3
LHS_JOIN_COL = 4
RHS_JOIN_COL = 5
NULLABLE = 6
# How many results to expect from a cursor.execute call
MULTI = 'multi'
SINGLE = 'single'
ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$')
ORDER_DIR = {
'ASC': ('ASC', 'DESC'),
'DESC': ('DESC', 'ASC')}
| ajibawa-2023/Python-Code-Large/train/row_99014 | 15 | 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_99014:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 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_99014:Assign_L4_C0", "label": "QUERY_TERMS = dict()", "type": "assigned_variable", "loc": [4, 8], "level": 0, "parent": null, "vector": [14, 0, 0.1622, 0.1351, 0, 0.66, 0.0714, 857, 3, 1, 0, 0, 827, 10, 1], "semantic": {"name": "QUERY_TERMS", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": "QUERY_TERMS = dict([(x, None) for x in (\n 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',\n 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',\n 'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',\n )])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L12_C0", "label": "GET_ITERATOR_CHUNK_SIZE =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.3243, 0.027, 0, 0.66, 0.1429, 724, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "GET_ITERATOR_CHUNK_SIZE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GET_ITERATOR_CHUNK_SIZE = 100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L15_C0", "label": "LOOKUP_SEP =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.4054, 0.027, 0, 0.66, 0.2143, 512, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "LOOKUP_SEP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LOOKUP_SEP = '__'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L20_C0", "label": "TABLE_NAME =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.5405, 0.027, 0, 0.66, 0.2857, 642, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TABLE_NAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TABLE_NAME = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L21_C0", "label": "RHS_ALIAS =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.5676, 0.027, 0, 0.66, 0.3571, 979, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "RHS_ALIAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RHS_ALIAS = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L22_C0", "label": "JOIN_TYPE =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.5946, 0.027, 0, 0.66, 0.4286, 638, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "JOIN_TYPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JOIN_TYPE = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L23_C0", "label": "LHS_ALIAS =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.6216, 0.027, 0, 0.66, 0.5, 570, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LHS_ALIAS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LHS_ALIAS = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L24_C0", "label": "LHS_JOIN_COL =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.6486, 0.027, 0, 0.66, 0.5714, 246, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "LHS_JOIN_COL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LHS_JOIN_COL = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L25_C0", "label": "RHS_JOIN_COL =", "type": "assigned_variable", "loc": [25, 25], "level": 0, "parent": null, "vector": [14, 0, 0.6757, 0.027, 0, 0.66, 0.6429, 777, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "RHS_JOIN_COL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RHS_JOIN_COL = 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L26_C0", "label": "NULLABLE =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.7027, 0.027, 0, 0.66, 0.7143, 318, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "NULLABLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NULLABLE = 6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L29_C0", "label": "MULTI =", "type": "assigned_variable", "loc": [29, 29], "level": 0, "parent": null, "vector": [14, 0, 0.7838, 0.027, 0, 0.66, 0.7857, 320, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "MULTI", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "MULTI = 'multi'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L30_C0", "label": "SINGLE =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.8108, 0.027, 0, 0.66, 0.8571, 376, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SINGLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SINGLE = 'single'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L32_C0", "label": "ORDER_PATTERN = compile()", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 0.8649, 0.027, 0, 0.66, 0.9286, 697, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "ORDER_PATTERN", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "ORDER_PATTERN = re.compile(r'\\?|[-+]?[.\\w]+$')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99014:Assign_L33_C0", "label": "ORDER_DIR =", "type": "assigned_variable", "loc": [33, 35], "level": 0, "parent": null, "vector": [14, 0, 0.9189, 0.0811, 0, 0.66, 1.0, 597, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "ORDER_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ORDER_DIR = {\n 'ASC': ('ASC', 'DESC'),\n 'DESC': ('DESC', 'ASC')}"}] | [] |
"""
Classes to represent the default SQL aggregate functions
"""
class AggregateField(object):
"""An internal field mockup used to identify aggregates in the
data-conversion parts of the database backend.
"""
def __init__(self, internal_type):
self.internal_type = internal_type
def get_internal_type(self):
return self.internal_type
ordinal_aggregate_field = AggregateField('IntegerField')
computed_aggregate_field = AggregateField('FloatField')
class Aggregate(object):
"""
Default SQL Aggregate.
"""
is_ordinal = False
is_computed = False
sql_template = '%(function)s(%(field)s)'
def __init__(self, col, source=None, is_summary=False, **extra):
"""Instantiate an SQL aggregate
* col is a column reference describing the subject field
of the aggregate. It can be an alias, or a tuple describing
a table and column name.
* source is the underlying field or aggregate definition for
the column reference. If the aggregate is not an ordinal or
computed type, this reference is used to determine the coerced
output type of the aggregate.
* extra is a dictionary of additional data to provide for the
aggregate definition
Also utilizes the class variables:
* sql_function, the name of the SQL function that implements the
aggregate.
* sql_template, a template string that is used to render the
aggregate into SQL.
* is_ordinal, a boolean indicating if the output of this aggregate
is an integer (e.g., a count)
* is_computed, a boolean indicating if this output of this aggregate
is a computed float (e.g., an average), regardless of the input
type.
"""
self.col = col
self.source = source
self.is_summary = is_summary
self.extra = extra
# Follow the chain of aggregate sources back until you find an
# actual field, or an aggregate that forces a particular output
# type. This type of this field will be used to coerce values
# retrieved from the database.
tmp = self
while tmp and isinstance(tmp, Aggregate):
if getattr(tmp, 'is_ordinal', False):
tmp = ordinal_aggregate_field
elif getattr(tmp, 'is_computed', False):
tmp = computed_aggregate_field
else:
tmp = tmp.source
self.field = tmp
def relabel_aliases(self, change_map):
if isinstance(self.col, (list, tuple)):
self.col = (change_map.get(self.col[0], self.col[0]), self.col[1])
def as_sql(self, qn, connection):
"Return the aggregate, rendered as SQL."
if hasattr(self.col, 'as_sql'):
field_name = self.col.as_sql(qn, connection)
elif isinstance(self.col, (list, tuple)):
field_name = '.'.join([qn(c) for c in self.col])
else:
field_name = self.col
params = {
'function': self.sql_function,
'field': field_name
}
params.update(self.extra)
return self.sql_template % params
class Avg(Aggregate):
is_computed = True
sql_function = 'AVG'
class Count(Aggregate):
is_ordinal = True
sql_function = 'COUNT'
sql_template = '%(function)s(%(distinct)s%(field)s)'
def __init__(self, col, distinct=False, **extra):
super(Count, self).__init__(col, distinct=distinct and 'DISTINCT ' or '', **extra)
class Max(Aggregate):
sql_function = 'MAX'
class Min(Aggregate):
sql_function = 'MIN'
class StdDev(Aggregate):
is_computed = True
def __init__(self, col, sample=False, **extra):
super(StdDev, self).__init__(col, **extra)
self.sql_function = sample and 'STDDEV_SAMP' or 'STDDEV_POP'
class Sum(Aggregate):
sql_function = 'SUM'
class Variance(Aggregate):
is_computed = True
def __init__(self, col, sample=False, **extra):
super(Variance, self).__init__(col, **extra)
self.sql_function = sample and 'VAR_SAMP' or 'VAR_POP'
| ajibawa-2023/Python-Code-Large/train/row_99015 | 66 | 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_99015:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0157, 0.0236, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nClasses to represent the default SQL aggregate functions\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "label": "AggregateField", "type": "class", "loc": [5, 12], "level": 0, "parent": null, "vector": [3, 0, 0.0669, 0.063, 0, 0.66, 0.0909, 733, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "AggregateField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AggregateField(object):\n \"\"\"An internal field mockup used to identify aggregates in the\n data-conversion parts of the database backend.\n \"\"\"\n def __init__(self, internal_type):\n self.internal_type = internal_type\n def get_internal_type(self):\n return self.internal_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L6_C4", "label": "expression", "type": "expression", "loc": [6, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "vector": [8, 1, 0.0551, 0.0236, 1, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"An internal field mockup used to identify aggregates in the\n data-conversion parts of the database backend.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "vector": [2, 1, 0.0748, 0.0157, 1, 0.07, 0.5, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "internal_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, internal_type):\n self.internal_type = internal_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L10_C8", "label": "self.internal_type =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L9_C4", "vector": [14, 2, 0.0787, 0.0079, 2, 0.5, 0.0, 855, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.internal_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.internal_type = internal_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L11_C4", "label": "get_internal_type", "type": "function", "loc": [11, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "vector": [2, 1, 0.0906, 0.0157, 1, 0.07, 1.0, 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 self.internal_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Return_L12_C8", "label": "return", "type": "return", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L11_C4", "vector": [13, 2, 0.0945, 0.0079, 2, 0.15, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.internal_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L14_C0", "label": "ordinal_aggregate_field = AggregateField()", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1102, 0.0079, 0, 0.66, 0.1818, 625, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "ordinal_aggregate_field", "arg_names": [], "import_names": [], "rhs_call_name": "AggregateField", "annotation": ""}, "snippet": "ordinal_aggregate_field = AggregateField('IntegerField')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L15_C0", "label": "computed_aggregate_field = AggregateField()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1181, 0.0079, 0, 0.66, 0.2727, 21, 3, 1, 0, 0, 733, 10, 1], "semantic": {"name": "computed_aggregate_field", "arg_names": [], "import_names": [], "rhs_call_name": "AggregateField", "annotation": ""}, "snippet": "computed_aggregate_field = AggregateField('FloatField')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "label": "Aggregate", "type": "class", "loc": [17, 91], "level": 0, "parent": null, "vector": [3, 0, 0.4252, 0.5906, 0, 0.66, 0.3636, 451, 0, 3, 0, 0, 186, 0, 11], "semantic": {"name": "Aggregate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Aggregate(object):\n \"\"\"\n Default SQL Aggregate.\n \"\"\"\n is_ordinal = False\n is_computed = False\n sql_template = '%(function)s(%(field)s)'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L18_C4", "label": "expression", "type": "expression", "loc": [18, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [8, 1, 0.1496, 0.0236, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Default SQL Aggregate.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L21_C4", "label": "is_ordinal =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [14, 1, 0.1654, 0.0079, 1, 0.44, 0.1667, 468, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_ordinal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_ordinal = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L22_C4", "label": "is_computed =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [14, 1, 0.1732, 0.0079, 1, 0.44, 0.3333, 176, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_computed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_computed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L23_C4", "label": "sql_template =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [14, 1, 0.1811, 0.0079, 1, 0.44, 0.5, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql_template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_template = '%(function)s(%(field)s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [2, 1, 0.3701, 0.3543, 1, 0.44, 0.6667, 555, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "col", "source", "is_summary", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, col, source=None, is_summary=False, **extra):\n \"\"\"Instantiate an SQL aggregate\n\n * col is a column reference describing the subject field\n of the aggregate. It can be an alias, or a tuple describing\n a table and column name.\n * source is the underlying field or aggregate definition for\n the column reference. If the aggregate is not an ordinal or"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L26_C8", "label": "expression", "type": "expression", "loc": [26, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [8, 2, 0.2953, 0.189, 2, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Instantiate an SQL aggregate\n\n * col is a column reference describing the subject field\n of the aggregate. It can be an alias, or a tuple describing\n a table and column name.\n * source is the underlying field or aggregate definition for\n the column reference. If the aggregate is not an ordinal or\n computed type, this reference is used to determine the coerced"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L50_C8", "label": "self.col =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.3937, 0.0079, 2, 0.57, 0.1429, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.col = col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L51_C8", "label": "self.source =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.4016, 0.0079, 2, 0.57, 0.2857, 848, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source = source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L52_C8", "label": "self.is_summary =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.4094, 0.0079, 2, 0.57, 0.4286, 389, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.is_summary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_summary = is_summary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L53_C8", "label": "self.extra =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.4173, 0.0079, 2, 0.57, 0.5714, 921, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.extra", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.extra = extra"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L59_C8", "label": "tmp =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.4646, 0.0079, 2, 0.57, 0.7143, 517, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:While_L61_C8", "label": "while", "type": "while", "loc": [61, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [5, 2, 0.5039, 0.0551, 2, 0.57, 0.8571, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while tmp and isinstance(tmp, Aggregate):\n if getattr(tmp, 'is_ordinal', False):\n tmp = ordinal_aggregate_field\n elif getattr(tmp, 'is_computed', False):\n tmp = computed_aggregate_field\n else:\n tmp = tmp.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12", "label": "if", "type": "if", "loc": [62, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:While_L61_C8", "vector": [4, 3, 0.5079, 0.0472, 3, 0.99, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(tmp, 'is_ordinal', False):\n tmp = ordinal_aggregate_field\n elif getattr(tmp, 'is_computed', False):\n tmp = computed_aggregate_field\n else:\n tmp = tmp.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L63_C16", "label": "tmp =", "type": "assigned_variable", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12", "vector": [14, 4, 0.4961, 0.0079, 4, 0.91, 0.0, 517, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = ordinal_aggregate_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12", "label": "if", "type": "if", "loc": [64, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12", "vector": [4, 4, 0.5157, 0.0315, 4, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif getattr(tmp, 'is_computed', False):\n tmp = computed_aggregate_field\n else:\n tmp = tmp.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L65_C16", "label": "tmp =", "type": "assigned_variable", "loc": [65, 65], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12", "vector": [14, 5, 0.5118, 0.0079, 5, 0.57, 0.0, 517, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = computed_aggregate_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L67_C16", "label": "tmp =", "type": "assigned_variable", "loc": [67, 67], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12", "vector": [14, 5, 0.5276, 0.0079, 5, 0.57, 1.0, 517, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tmp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tmp = tmp.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L69_C8", "label": "self.field =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "vector": [14, 2, 0.5433, 0.0079, 2, 0.57, 1.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = tmp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L71_C4", "label": "relabel_aliases", "type": "function", "loc": [71, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [2, 1, 0.5669, 0.0236, 1, 0.44, 0.8333, 905, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map):\n if isinstance(self.col, (list, tuple)):\n self.col = (change_map.get(self.col[0], self.col[0]), self.col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L72_C8", "label": "if", "type": "if", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L71_C4", "vector": [4, 2, 0.5709, 0.0157, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.col, (list, tuple)):\n self.col = (change_map.get(self.col[0], self.col[0]), self.col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L73_C12", "label": "self.col =", "type": "assigned_variable", "loc": [73, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L72_C8", "vector": [14, 3, 0.5748, 0.0079, 3, 0.44, 0.0, 11, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.col = (change_map.get(self.col[0], self.col[0]), self.col[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "label": "as_sql", "type": "function", "loc": [75, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "vector": [2, 1, 0.6535, 0.1339, 1, 0.44, 1.0, 122, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn, connection):\n \"Return the aggregate, rendered as SQL.\"\n\n if hasattr(self.col, 'as_sql'):\n field_name = self.col.as_sql(qn, connection)\n elif isinstance(self.col, (list, tuple)):\n field_name = '.'.join([qn(c) for c in self.col])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L76_C8", "label": "expression", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "vector": [8, 2, 0.5984, 0.0079, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Return the aggregate, rendered as SQL.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8", "label": "if", "type": "if", "loc": [78, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "vector": [4, 2, 0.6339, 0.0472, 2, 0.68, 0.25, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self.col, 'as_sql'):\n field_name = self.col.as_sql(qn, connection)\n elif isinstance(self.col, (list, tuple)):\n field_name = '.'.join([qn(c) for c in self.col])\n else:\n field_name = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L79_C12", "label": "field_name = as_sql()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8", "vector": [14, 3, 0.622, 0.0079, 3, 0.58, 0.0, 918, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "field_name", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " field_name = self.col.as_sql(qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8", "label": "if", "type": "if", "loc": [80, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8", "vector": [4, 3, 0.6417, 0.0315, 3, 0.58, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(self.col, (list, tuple)):\n field_name = '.'.join([qn(c) for c in self.col])\n else:\n field_name = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L81_C12", "label": "field_name = join()", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8", "vector": [14, 4, 0.6378, 0.0079, 4, 0.69, 0.0, 918, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "field_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " field_name = '.'.join([qn(c) for c in self.col])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L83_C12", "label": "field_name =", "type": "assigned_variable", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8", "vector": [14, 4, 0.6535, 0.0079, 4, 0.69, 1.0, 918, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field_name = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L85_C8", "label": "params =", "type": "assigned_variable", "loc": [85, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "vector": [14, 2, 0.6811, 0.0315, 2, 0.68, 0.5, 206, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = {\n 'function': self.sql_function,\n 'field': field_name\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L89_C8", "label": "update()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "vector": [8, 2, 0.7008, 0.0079, 2, 0.68, 0.75, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " params.update(self.extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Return_L91_C8", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "vector": [13, 2, 0.7165, 0.0079, 2, 0.68, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.sql_template % params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L94_C0", "label": "Avg", "type": "class", "loc": [94, 96], "level": 0, "parent": null, "vector": [3, 0, 0.748, 0.0236, 0, 0.66, 0.4545, 50, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Avg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Avg(Aggregate):\n is_computed = True\n sql_function = 'AVG'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L95_C4", "label": "is_computed =", "type": "assigned_variable", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L94_C0", "vector": [14, 1, 0.748, 0.0079, 1, 0.78, 0.0, 176, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_computed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_computed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L96_C4", "label": "sql_function =", "type": "assigned_variable", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L94_C0", "vector": [14, 1, 0.7559, 0.0079, 1, 0.78, 1.0, 586, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_function = 'AVG'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "label": "Count", "type": "class", "loc": [98, 104], "level": 0, "parent": null, "vector": [3, 0, 0.7953, 0.0551, 0, 0.66, 0.5455, 783, 0, 1, 0, 0, 451, 0, 2], "semantic": {"name": "Count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Count(Aggregate):\n is_ordinal = True\n sql_function = 'COUNT'\n sql_template = '%(function)s(%(distinct)s%(field)s)'\n\n def __init__(self, col, distinct=False, **extra):\n super(Count, self).__init__(col, distinct=distinct and 'DISTINCT ' or '', **extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L99_C4", "label": "is_ordinal =", "type": "assigned_variable", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "vector": [14, 1, 0.7795, 0.0079, 1, 0.65, 0.0, 468, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_ordinal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_ordinal = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L100_C4", "label": "sql_function =", "type": "assigned_variable", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "vector": [14, 1, 0.7874, 0.0079, 1, 0.65, 0.3333, 586, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_function = 'COUNT'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L101_C4", "label": "sql_template =", "type": "assigned_variable", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "vector": [14, 1, 0.7953, 0.0079, 1, 0.65, 0.6667, 765, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sql_template", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_template = '%(function)s(%(distinct)s%(field)s)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L103_C4", "label": "__init__", "type": "function", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "vector": [2, 1, 0.815, 0.0157, 1, 0.65, 1.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "col", "distinct", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, col, distinct=False, **extra):\n super(Count, self).__init__(col, distinct=distinct and 'DISTINCT ' or '', **extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L104_C8", "label": "__init__()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L103_C4", "vector": [8, 2, 0.8189, 0.0079, 2, 0.77, 0.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Count, self).__init__(col, distinct=distinct and 'DISTINCT ' or '', **extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L106_C0", "label": "Max", "type": "class", "loc": [106, 107], "level": 0, "parent": null, "vector": [3, 0, 0.8386, 0.0157, 0, 0.66, 0.6364, 264, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Max(Aggregate):\n sql_function = 'MAX'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L107_C4", "label": "sql_function =", "type": "assigned_variable", "loc": [107, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L106_C0", "vector": [14, 1, 0.8425, 0.0079, 1, 0.23, 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 = 'MAX'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L109_C0", "label": "Min", "type": "class", "loc": [109, 110], "level": 0, "parent": null, "vector": [3, 0, 0.8622, 0.0157, 0, 0.66, 0.7273, 261, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Min(Aggregate):\n sql_function = 'MIN'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L110_C4", "label": "sql_function =", "type": "assigned_variable", "loc": [110, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L109_C0", "vector": [14, 1, 0.8661, 0.0079, 1, 0.93, 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 = 'MIN'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L112_C0", "label": "StdDev", "type": "class", "loc": [112, 117], "level": 0, "parent": null, "vector": [3, 0, 0.9016, 0.0472, 0, 0.66, 0.8182, 413, 0, 1, 0, 0, 451, 0, 2], "semantic": {"name": "StdDev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StdDev(Aggregate):\n is_computed = True\n\n def __init__(self, col, sample=False, **extra):\n super(StdDev, self).__init__(col, **extra)\n self.sql_function = sample and 'STDDEV_SAMP' or 'STDDEV_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L113_C4", "label": "is_computed =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L112_C0", "vector": [14, 1, 0.8898, 0.0079, 1, 0.92, 0.0, 176, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_computed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_computed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4", "label": "__init__", "type": "function", "loc": [115, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L112_C0", "vector": [2, 1, 0.9134, 0.0236, 1, 0.92, 1.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "col", "sample", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, col, sample=False, **extra):\n super(StdDev, self).__init__(col, **extra)\n self.sql_function = sample and 'STDDEV_SAMP' or 'STDDEV_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L116_C8", "label": "__init__()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4", "vector": [8, 2, 0.9134, 0.0079, 2, 0.28, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(StdDev, self).__init__(col, **extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L117_C8", "label": "self.sql_function =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4", "vector": [14, 2, 0.9213, 0.0079, 2, 0.28, 1.0, 383, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sql_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sql_function = sample and 'STDDEV_SAMP' or 'STDDEV_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L119_C0", "label": "Sum", "type": "class", "loc": [119, 120], "level": 0, "parent": null, "vector": [3, 0, 0.9409, 0.0157, 0, 0.66, 0.9091, 719, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Sum(Aggregate):\n sql_function = 'SUM'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L120_C4", "label": "sql_function =", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L119_C0", "vector": [14, 1, 0.9449, 0.0079, 1, 0.29, 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 = 'SUM'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L122_C0", "label": "Variance", "type": "class", "loc": [122, 127], "level": 0, "parent": null, "vector": [3, 0, 0.9803, 0.0472, 0, 0.66, 1.0, 771, 0, 1, 0, 0, 451, 0, 2], "semantic": {"name": "Variance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Variance(Aggregate):\n is_computed = True\n\n def __init__(self, col, sample=False, **extra):\n super(Variance, self).__init__(col, **extra)\n self.sql_function = sample and 'VAR_SAMP' or 'VAR_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L123_C4", "label": "is_computed =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L122_C0", "vector": [14, 1, 0.9685, 0.0079, 1, 0.7, 0.0, 176, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "is_computed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " is_computed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4", "label": "__init__", "type": "function", "loc": [125, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L122_C0", "vector": [2, 1, 0.9921, 0.0236, 1, 0.7, 1.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "col", "sample", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, col, sample=False, **extra):\n super(Variance, self).__init__(col, **extra)\n self.sql_function = sample and 'VAR_SAMP' or 'VAR_POP'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L126_C8", "label": "__init__()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4", "vector": [8, 2, 0.9921, 0.0079, 2, 0.69, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Variance, self).__init__(col, **extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L127_C8", "label": "self.sql_function =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4", "vector": [14, 2, 1.0, 0.0079, 2, 0.69, 1.0, 383, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sql_function", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sql_function = sample and 'VAR_SAMP' or 'VAR_POP'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L11_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Return_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:While_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:While_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L65_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L64_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L72_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L73_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Return_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L94_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L109_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99015:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99015:Assign_L127_C8"}] |
"""
Code to manage the creation and SQL rendering of 'where' constraints.
"""
import datetime
from itertools import repeat
from django.utils import tree
from django.db.models.fields import Field
from django.db.models.query_utils import QueryWrapper
from datastructures import EmptyResultSet, FullResultSet
# Connection types
AND = 'AND'
OR = 'OR'
class EmptyShortCircuit(Exception):
"""
Internal exception used to indicate that a "matches nothing" node should be
added to the where-clause.
"""
pass
class WhereNode(tree.Node):
"""
Used to represent the SQL where-clause.
The class is tied to the Query class that created it (in order to create
the correct SQL).
The children in this tree are usually either Q-like objects or lists of
[table_alias, field_name, db_type, lookup_type, value_annotation,
params]. However, a child could also be any class with as_sql() and
relabel_aliases() methods.
"""
default = AND
def add(self, data, connector):
"""
Add a node to the where-tree. If the data is a list or tuple, it is
expected to be of the form (obj, lookup_type, value), where obj is
a Constraint object, and is then slightly munged before being stored
(to avoid storing any reference to field objects). Otherwise, the 'data'
is stored unchanged and can be any class with an 'as_sql()' method.
"""
if not isinstance(data, (list, tuple)):
super(WhereNode, self).add(data, connector)
return
obj, lookup_type, value = data
if hasattr(value, '__iter__') and hasattr(value, 'next'):
# Consume any generators immediately, so that we can determine
# emptiness and transform any non-empty values correctly.
value = list(value)
# The "annotation" parameter is used to pass auxilliary information
# about the value(s) to the query construction. Specifically, datetime
# and empty values need special handling. Other types could be used
# here in the future (using Python types is suggested for consistency).
if isinstance(value, datetime.datetime):
annotation = datetime.datetime
elif hasattr(value, 'value_annotation'):
annotation = value.value_annotation
else:
annotation = bool(value)
if hasattr(obj, "prepare"):
value = obj.prepare(lookup_type, value)
super(WhereNode, self).add((obj, lookup_type, annotation, value),
connector)
return
super(WhereNode, self).add((obj, lookup_type, annotation, value),
connector)
def as_sql(self, qn, connection):
"""
Returns the SQL version of the where clause and the value to be
substituted in. Returns None, None if this node is empty.
If 'node' is provided, that is the root of the SQL generation
(generally not needed except by the internal implementation for
recursion).
"""
if not self.children:
return None, []
result = []
result_params = []
empty = True
for child in self.children:
try:
if hasattr(child, 'as_sql'):
sql, params = child.as_sql(qn=qn, connection=connection)
else:
# A leaf node in the tree.
sql, params = self.make_atom(child, qn, connection)
except EmptyResultSet:
if self.connector == AND and not self.negated:
# We can bail out early in this particular case (only).
raise
elif self.negated:
empty = False
continue
except FullResultSet:
if self.connector == OR:
if self.negated:
empty = True
break
# We match everything. No need for any constraints.
return '', []
if self.negated:
empty = True
continue
empty = False
if sql:
result.append(sql)
result_params.extend(params)
if empty:
raise EmptyResultSet
conn = ' %s ' % self.connector
sql_string = conn.join(result)
if sql_string:
if self.negated:
sql_string = 'NOT (%s)' % sql_string
elif len(self.children) != 1:
sql_string = '(%s)' % sql_string
return sql_string, result_params
def make_atom(self, child, qn, connection):
"""
Turn a tuple (table_alias, column_name, db_type, lookup_type,
value_annot, params) into valid SQL.
Returns the string for the SQL fragment and the parameters to use for
it.
"""
lvalue, lookup_type, value_annot, params_or_value = child
if hasattr(lvalue, 'process'):
try:
lvalue, params = lvalue.process(lookup_type, params_or_value, connection)
except EmptyShortCircuit:
raise EmptyResultSet
else:
params = Field().get_db_prep_lookup(lookup_type, params_or_value,
connection=connection, prepared=True)
if isinstance(lvalue, tuple):
# A direct database column lookup.
field_sql = self.sql_for_columns(lvalue, qn, connection)
else:
# A smart object with an as_sql() method.
field_sql = lvalue.as_sql(qn, connection)
if value_annot is datetime.datetime:
cast_sql = connection.ops.datetime_cast_sql()
else:
cast_sql = '%s'
if hasattr(params, 'as_sql'):
extra, params = params.as_sql(qn, connection)
cast_sql = ''
else:
extra = ''
if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'
and connection.features.interprets_empty_strings_as_nulls):
lookup_type = 'isnull'
value_annot = True
if lookup_type in connection.operators:
format = "%s %%s %%s" % (connection.ops.lookup_cast(lookup_type),)
return (format % (field_sql,
connection.operators[lookup_type] % cast_sql,
extra), params)
if lookup_type == 'in':
if not value_annot:
raise EmptyResultSet
if extra:
return ('%s IN %s' % (field_sql, extra), params)
max_in_list_size = connection.ops.max_in_list_size()
if max_in_list_size and len(params) > max_in_list_size:
# Break up the params list into an OR of manageable chunks.
in_clause_elements = ['(']
for offset in xrange(0, len(params), max_in_list_size):
if offset > 0:
in_clause_elements.append(' OR ')
in_clause_elements.append('%s IN (' % field_sql)
group_size = min(len(params) - offset, max_in_list_size)
param_group = ', '.join(repeat('%s', group_size))
in_clause_elements.append(param_group)
in_clause_elements.append(')')
in_clause_elements.append(')')
return ''.join(in_clause_elements), params
else:
return ('%s IN (%s)' % (field_sql,
', '.join(repeat('%s', len(params)))),
params)
elif lookup_type in ('range', 'year'):
return ('%s BETWEEN %%s and %%s' % field_sql, params)
elif lookup_type in ('month', 'day', 'week_day'):
return ('%s = %%s' % connection.ops.date_extract_sql(lookup_type, field_sql),
params)
elif lookup_type == 'isnull':
return ('%s IS %sNULL' % (field_sql,
(not value_annot and 'NOT ' or '')), ())
elif lookup_type == 'search':
return (connection.ops.fulltext_search_sql(field_sql), params)
elif lookup_type in ('regex', 'iregex'):
return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params
raise TypeError('Invalid lookup_type: %r' % lookup_type)
def sql_for_columns(self, data, qn, connection):
"""
Returns the SQL fragment used for the left-hand side of a column
constraint (for example, the "T1.foo" portion in the clause
"WHERE ... T1.foo = 6").
"""
table_alias, name, db_type = data
if table_alias:
lhs = '%s.%s' % (qn(table_alias), qn(name))
else:
lhs = qn(name)
return connection.ops.field_cast_sql(db_type) % lhs
def relabel_aliases(self, change_map, node=None):
"""
Relabels the alias values of any children. 'change_map' is a dictionary
mapping old (current) alias values to the new values.
"""
if not node:
node = self
for pos, child in enumerate(node.children):
if hasattr(child, 'relabel_aliases'):
child.relabel_aliases(change_map)
elif isinstance(child, tree.Node):
self.relabel_aliases(change_map, child)
elif isinstance(child, (list, tuple)):
if isinstance(child[0], (list, tuple)):
elt = list(child[0])
if elt[0] in change_map:
elt[0] = change_map[elt[0]]
node.children[pos] = (tuple(elt),) + child[1:]
else:
child[0].relabel_aliases(change_map)
# Check if the query value also requires relabelling
if hasattr(child[3], 'relabel_aliases'):
child[3].relabel_aliases(change_map)
class EverythingNode(object):
"""
A node that matches everything.
"""
def as_sql(self, qn=None, connection=None):
raise FullResultSet
def relabel_aliases(self, change_map, node=None):
return
class NothingNode(object):
"""
A node that matches nothing.
"""
def as_sql(self, qn=None, connection=None):
raise EmptyResultSet
def relabel_aliases(self, change_map, node=None):
return
class ExtraWhere(object):
def __init__(self, sqls, params):
self.sqls = sqls
self.params = params
def as_sql(self, qn=None, connection=None):
return " AND ".join(self.sqls), tuple(self.params or ())
class Constraint(object):
"""
An object that can be passed to WhereNode.add() and knows how to
pre-process itself prior to including in the WhereNode.
"""
def __init__(self, alias, col, field):
self.alias, self.col, self.field = alias, col, field
def __getstate__(self):
"""Save the state of the Constraint for pickling.
Fields aren't necessarily pickleable, because they can have
callable default values. So, instead of pickling the field
store a reference so we can restore it manually
"""
obj_dict = self.__dict__.copy()
if self.field:
obj_dict['model'] = self.field.model
obj_dict['field_name'] = self.field.name
del obj_dict['field']
return obj_dict
def __setstate__(self, data):
"""Restore the constraint """
model = data.pop('model', None)
field_name = data.pop('field_name', None)
self.__dict__.update(data)
if model is not None:
self.field = model._meta.get_field(field_name)
else:
self.field = None
def prepare(self, lookup_type, value):
if self.field:
return self.field.get_prep_lookup(lookup_type, value)
return value
def process(self, lookup_type, value, connection):
"""
Returns a tuple of data suitable for inclusion in a WhereNode
instance.
"""
# Because of circular imports, we need to import this here.
from django.db.models.base import ObjectDoesNotExist
try:
if self.field:
params = self.field.get_db_prep_lookup(lookup_type, value,
connection=connection, prepared=True)
db_type = self.field.db_type(connection=connection)
else:
# This branch is used at times when we add a comparison to NULL
# (we don't really want to waste time looking up the associated
# field object at the calling location).
params = Field().get_db_prep_lookup(lookup_type, value,
connection=connection, prepared=True)
db_type = None
except ObjectDoesNotExist:
raise EmptyShortCircuit
return (self.alias, self.col, db_type), params
def relabel_aliases(self, change_map):
if self.alias in change_map:
self.alias = change_map[self.alias]
| ajibawa-2023/Python-Code-Large/train/row_99016 | 194 | 345 | 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_99016:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0058, 0.0087, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nCode to manage the creation and SQL rendering of 'where' constraints.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Import_L4_C0", "label": "datetime import datetime", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0116, 0.0029, 0, 0.66, 0.0714, 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_99016:ImportFrom_L5_C0", "label": "from itertools import repeat", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0145, 0.0029, 0, 0.66, 0.1429, 808, 0, 1, 0, 0, 808, 0, 0], "semantic": {"name": "itertools", "arg_names": [], "import_names": ["repeat"], "rhs_call_name": "", "annotation": ""}, "snippet": "from itertools import repeat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L7_C0", "label": "from django.utils import tree", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0203, 0.0029, 0, 0.66, 0.2143, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["tree"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L8_C0", "label": "from django.db.models.fields import Field", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0232, 0.0029, 0, 0.66, 0.2857, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["Field"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import Field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L9_C0", "label": "from django.db.models.query_utils import QueryWrapper", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0261, 0.0029, 0, 0.66, 0.3571, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "django.db.models.query_utils", "arg_names": [], "import_names": ["QueryWrapper"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.query_utils import QueryWrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L10_C0", "label": "from datastructures import EmptyResultSet, FullResultSet", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.029, 0.0029, 0, 0.66, 0.4286, 215, 0, 2, 0, 0, 215, 0, 0], "semantic": {"name": "datastructures", "arg_names": [], "import_names": ["EmptyResultSet", "FullResultSet"], "rhs_call_name": "", "annotation": ""}, "snippet": "from datastructures import EmptyResultSet, FullResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L13_C0", "label": "AND =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0377, 0.0029, 0, 0.66, 0.5, 436, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "AND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "AND = 'AND'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L14_C0", "label": "OR =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.0406, 0.0029, 0, 0.66, 0.5714, 762, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OR = 'OR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L16_C0", "label": "EmptyShortCircuit", "type": "class", "loc": [16, 21], "level": 0, "parent": null, "vector": [3, 0, 0.0536, 0.0174, 0, 0.66, 0.6429, 774, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "EmptyShortCircuit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmptyShortCircuit(Exception):\n \"\"\"\n Internal exception used to indicate that a \"matches nothing\" node should be\n added to the where-clause.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L17_C4", "label": "expression", "type": "expression", "loc": [17, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L16_C0", "vector": [8, 1, 0.0536, 0.0116, 1, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Internal exception used to indicate that a \"matches nothing\" node should be\n added to the where-clause.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "label": "WhereNode", "type": "class", "loc": [23, 251], "level": 0, "parent": null, "vector": [3, 0, 0.3971, 0.6638, 0, 0.66, 0.7143, 202, 0, 5, 0, 0, 668, 0, 71], "semantic": {"name": "WhereNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class WhereNode(tree.Node):\n \"\"\"\n Used to represent the SQL where-clause.\n\n The class is tied to the Query class that created it (in order to create\n the correct SQL).\n\n The children in this tree are usually either Q-like objects or lists of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L24_C4", "label": "expression", "type": "expression", "loc": [24, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [8, 1, 0.0841, 0.0319, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Used to represent the SQL where-clause.\n\n The class is tied to the Query class that created it (in order to create\n the correct SQL).\n\n The children in this tree are usually either Q-like objects or lists of\n [table_alias, field_name, db_type, lookup_type, value_annotation,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L35_C4", "label": "default =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [14, 1, 0.1014, 0.0029, 1, 0.85, 0.1667, 977, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default = AND"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "label": "add", "type": "function", "loc": [37, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [2, 1, 0.1594, 0.1072, 1, 0.85, 0.3333, 241, 0, 3, 0, 0, 0, 0, 15], "semantic": {"name": "add", "arg_names": ["self", "data", "connector"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, data, connector):\n \"\"\"\n Add a node to the where-tree. If the data is a list or tuple, it is\n expected to be of the form (obj, lookup_type, value), where obj is\n a Constraint object, and is then slightly munged before being stored\n (to avoid storing any reference to field objects). Otherwise, the 'data'\n is stored unchanged and can be any class with an 'as_sql()' method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L38_C8", "label": "expression", "type": "expression", "loc": [38, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [8, 2, 0.1188, 0.0203, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Add a node to the where-tree. If the data is a list or tuple, it is\n expected to be of the form (obj, lookup_type, value), where obj is\n a Constraint object, and is then slightly munged before being stored\n (to avoid storing any reference to field objects). Otherwise, the 'data'\n is stored unchanged and can be any class with an 'as_sql()' method.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8", "label": "if", "type": "if", "loc": [45, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [4, 2, 0.1333, 0.0087, 2, 0.6, 0.1667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(data, (list, tuple)):\n super(WhereNode, self).add(data, connector)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L46_C12", "label": "add()", "type": "expression", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8", "vector": [8, 3, 0.1333, 0.0029, 3, 0.11, 0.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " super(WhereNode, self).add(data, connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L47_C12", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8", "vector": [13, 3, 0.1362, 0.0029, 3, 0.11, 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_99016:Assign_L49_C8", "label": "obj, lookup_type, value =", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [14, 2, 0.142, 0.0029, 2, 0.6, 0.3333, 157, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj, lookup_type, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj, lookup_type, value = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L50_C8", "label": "if", "type": "if", "loc": [50, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [4, 2, 0.1493, 0.0116, 2, 0.6, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, '__iter__') and hasattr(value, 'next'):\n # Consume any generators immediately, so that we can determine\n # emptiness and transform any non-empty values correctly.\n value = list(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L53_C12", "label": "value = list()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L50_C8", "vector": [14, 3, 0.1536, 0.0029, 3, 0.03, 0.0, 441, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " value = list(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8", "label": "if", "type": "if", "loc": [59, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [4, 2, 0.1783, 0.0174, 2, 0.6, 0.6667, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, datetime.datetime):\n annotation = datetime.datetime\n elif hasattr(value, 'value_annotation'):\n annotation = value.value_annotation\n else:\n annotation = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L60_C12", "label": "annotation =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8", "vector": [14, 3, 0.1739, 0.0029, 3, 0.75, 0.0, 792, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "annotation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " annotation = datetime.datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8", "label": "if", "type": "if", "loc": [61, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8", "vector": [4, 3, 0.1812, 0.0116, 3, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(value, 'value_annotation'):\n annotation = value.value_annotation\n else:\n annotation = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L62_C12", "label": "annotation =", "type": "assigned_variable", "loc": [62, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8", "vector": [14, 4, 0.1797, 0.0029, 4, 0.36, 0.0, 792, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "annotation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " annotation = value.value_annotation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L64_C12", "label": "annotation = bool()", "type": "assigned_variable", "loc": [64, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8", "vector": [14, 4, 0.1855, 0.0029, 4, 0.36, 1.0, 792, 3, 1, 0, 0, 337, 10, 1], "semantic": {"name": "annotation", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " annotation = bool(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "label": "if", "type": "if", "loc": [66, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [4, 2, 0.1971, 0.0145, 2, 0.6, 0.8333, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(obj, \"prepare\"):\n value = obj.prepare(lookup_type, value)\n super(WhereNode, self).add((obj, lookup_type, annotation, value),\n connector)\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L67_C12", "label": "value = prepare()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "vector": [14, 3, 0.1942, 0.0029, 3, 0.12, 0.0, 441, 3, 2, 0, 0, 556, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "prepare", "annotation": ""}, "snippet": " value = obj.prepare(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L68_C12", "label": "add()", "type": "expression", "loc": [68, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "vector": [8, 3, 0.1986, 0.0058, 3, 0.12, 0.5, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " super(WhereNode, self).add((obj, lookup_type, annotation, value),\n connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L70_C12", "label": "return", "type": "return", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "vector": [13, 3, 0.2029, 0.0029, 3, 0.12, 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_99016:Expr_L72_C8", "label": "add()", "type": "expression", "loc": [72, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "vector": [8, 2, 0.2101, 0.0058, 2, 0.6, 1.0, 241, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " super(WhereNode, self).add((obj, lookup_type, annotation, value),\n connector)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "label": "as_sql", "type": "function", "loc": [75, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [2, 1, 0.2957, 0.1594, 1, 0.85, 0.5, 122, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn, connection):\n \"\"\"\n Returns the SQL version of the where clause and the value to be\n substituted in. Returns None, None if this node is empty.\n\n If 'node' is provided, that is the root of the SQL generation\n (generally not needed except by the internal implementation for\n recursion)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L76_C8", "label": "expression", "type": "expression", "loc": [76, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [8, 2, 0.2304, 0.0232, 2, 0.82, 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 version of the where clause and the value to be\n substituted in. Returns None, None if this node is empty.\n\n If 'node' is provided, that is the root of the SQL generation\n (generally not needed except by the internal implementation for\n recursion).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L84_C8", "label": "if", "type": "if", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [4, 2, 0.2449, 0.0058, 2, 0.82, 0.1, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.children:\n return None, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L85_C12", "label": "return", "type": "return", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L84_C8", "vector": [13, 3, 0.2464, 0.0029, 3, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L86_C8", "label": "result =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [14, 2, 0.2493, 0.0029, 2, 0.82, 0.2, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L87_C8", "label": "result_params =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [14, 2, 0.2522, 0.0029, 2, 0.82, 0.3, 729, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result_params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result_params = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L88_C8", "label": "empty =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [14, 2, 0.2551, 0.0029, 2, 0.82, 0.4, 365, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "label": "for child", "type": "for", "loc": [89, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [6, 2, 0.3, 0.087, 2, 0.82, 0.5, 967, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in self.children:\n try:\n if hasattr(child, 'as_sql'):\n sql, params = child.as_sql(qn=qn, connection=connection)\n else:\n # A leaf node in the tree.\n sql, params = self.make_atom(child, qn, connection)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "label": "try", "type": "try", "loc": [90, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "vector": [7, 3, 0.2942, 0.0696, 3, 0.27, 0.0, 0, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if hasattr(child, 'as_sql'):\n sql, params = child.as_sql(qn=qn, connection=connection)\n else:\n # A leaf node in the tree.\n sql, params = self.make_atom(child, qn, connection)\n\n except EmptyResultSet:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16", "label": "if", "type": "if", "loc": [91, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "vector": [4, 4, 0.2696, 0.0145, 4, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(child, 'as_sql'):\n sql, params = child.as_sql(qn=qn, connection=connection)\n else:\n # A leaf node in the tree.\n sql, params = self.make_atom(child, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L92_C20", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [92, 92], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16", "vector": [14, 5, 0.2667, 0.0029, 5, 0.78, 0.0, 643, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = child.as_sql(qn=qn, connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L95_C20", "label": "sql, params = make_atom()", "type": "assigned_variable", "loc": [95, 95], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16", "vector": [14, 5, 0.2754, 0.0029, 5, 0.78, 1.0, 643, 3, 3, 0, 0, 307, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "make_atom", "annotation": ""}, "snippet": " sql, params = self.make_atom(child, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L98_C16", "label": "if", "type": "if", "loc": [98, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "vector": [4, 4, 0.2899, 0.0145, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connector == AND and not self.negated:\n # We can bail out early in this particular case (only).\n raise\n elif self.negated:\n empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L101_C16", "label": "if", "type": "if", "loc": [101, 102], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L98_C16", "vector": [4, 5, 0.2942, 0.0058, 5, 0.42, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.negated:\n empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L102_C20", "label": "empty =", "type": "assigned_variable", "loc": [102, 102], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L101_C16", "vector": [14, 6, 0.2957, 0.0029, 6, 0.02, 0.0, 365, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16", "label": "if", "type": "if", "loc": [105, 110], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "vector": [4, 4, 0.3116, 0.0174, 4, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.connector == OR:\n if self.negated:\n empty = True\n break\n # We match everything. No need for any constraints.\n return '', []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L106_C20", "label": "if", "type": "if", "loc": [106, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16", "vector": [4, 5, 0.3101, 0.0087, 5, 0.14, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.negated:\n empty = True\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L107_C24", "label": "empty =", "type": "assigned_variable", "loc": [107, 107], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L106_C20", "vector": [14, 6, 0.3101, 0.0029, 6, 0.21, 0.0, 365, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L110_C20", "label": "return", "type": "return", "loc": [110, 110], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16", "vector": [13, 5, 0.3188, 0.0029, 5, 0.14, 1.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_99016:If_L111_C16", "label": "if", "type": "if", "loc": [111, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "vector": [4, 4, 0.3232, 0.0058, 4, 0.37, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.negated:\n empty = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L112_C20", "label": "empty =", "type": "assigned_variable", "loc": [112, 112], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L111_C16", "vector": [14, 5, 0.3246, 0.0029, 5, 0.08, 0.0, 365, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L115_C12", "label": "empty =", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "vector": [14, 3, 0.3333, 0.0029, 3, 0.27, 0.5, 365, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12", "label": "if", "type": "if", "loc": [116, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "vector": [4, 3, 0.3391, 0.0087, 3, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sql:\n result.append(sql)\n result_params.extend(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L117_C16", "label": "append()", "type": "expression", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12", "vector": [8, 4, 0.3391, 0.0029, 4, 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": " result.append(sql)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L118_C16", "label": "extend()", "type": "expression", "loc": [118, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12", "vector": [8, 4, 0.342, 0.0029, 4, 0.7, 1.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " result_params.extend(params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L119_C8", "label": "if", "type": "if", "loc": [119, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [4, 2, 0.3464, 0.0058, 2, 0.82, 0.6, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if empty:\n raise EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L122_C8", "label": "conn =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [14, 2, 0.3536, 0.0029, 2, 0.82, 0.7, 345, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "conn", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " conn = ' %s ' % self.connector"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L123_C8", "label": "sql_string = join()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [14, 2, 0.3565, 0.0029, 2, 0.82, 0.8, 324, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "sql_string", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " sql_string = conn.join(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L124_C8", "label": "if", "type": "if", "loc": [124, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [4, 2, 0.3652, 0.0145, 2, 0.82, 0.9, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if sql_string:\n if self.negated:\n sql_string = 'NOT (%s)' % sql_string\n elif len(self.children) != 1:\n sql_string = '(%s)' % sql_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12", "label": "if", "type": "if", "loc": [125, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L124_C8", "vector": [4, 3, 0.3667, 0.0116, 3, 0.86, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.negated:\n sql_string = 'NOT (%s)' % sql_string\n elif len(self.children) != 1:\n sql_string = '(%s)' % sql_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L126_C16", "label": "sql_string =", "type": "assigned_variable", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12", "vector": [14, 4, 0.3652, 0.0029, 4, 0.88, 0.0, 324, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sql_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_string = 'NOT (%s)' % sql_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L127_C12", "label": "if", "type": "if", "loc": [127, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12", "vector": [4, 4, 0.3696, 0.0058, 4, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif len(self.children) != 1:\n sql_string = '(%s)' % sql_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L128_C16", "label": "sql_string =", "type": "assigned_variable", "loc": [128, 128], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L127_C12", "vector": [14, 5, 0.371, 0.0029, 5, 0.86, 0.0, 324, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sql_string", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sql_string = '(%s)' % sql_string"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L129_C8", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "vector": [13, 2, 0.3739, 0.0029, 2, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sql_string, result_params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "label": "make_atom", "type": "function", "loc": [131, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [2, 1, 0.4986, 0.2406, 1, 0.85, 0.6667, 307, 0, 4, 1, 0, 0, 0, 33], "semantic": {"name": "make_atom", "arg_names": ["self", "child", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def make_atom(self, child, qn, connection):\n \"\"\"\n Turn a tuple (table_alias, column_name, db_type, lookup_type,\n value_annot, params) into valid SQL.\n\n Returns the string for the SQL fragment and the parameters to use for\n it.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L132_C8", "label": "expression", "type": "expression", "loc": [132, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [8, 2, 0.3913, 0.0203, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Turn a tuple (table_alias, column_name, db_type, lookup_type,\n value_annot, params) into valid SQL.\n\n Returns the string for the SQL fragment and the parameters to use for\n it.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L139_C8", "label": "lvalue, lookup_type, value_annot, params_or_value =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [14, 2, 0.4029, 0.0029, 2, 0.18, 0.125, 58, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "lvalue, lookup_type, value_annot, params_or_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lvalue, lookup_type, value_annot, params_or_value = child"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8", "label": "if", "type": "if", "loc": [140, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.4159, 0.0232, 2, 0.18, 0.25, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(lvalue, 'process'):\n try:\n lvalue, params = lvalue.process(lookup_type, params_or_value, connection)\n except EmptyShortCircuit:\n raise EmptyResultSet\n else:\n params = Field().get_db_prep_lookup(lookup_type, params_or_value,\n connection=connection, prepared=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L141_C12", "label": "try", "type": "try", "loc": [141, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8", "vector": [7, 3, 0.413, 0.0116, 3, 0.06, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n lvalue, params = lvalue.process(lookup_type, params_or_value, connection)\n except EmptyShortCircuit:\n raise EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L142_C16", "label": "lvalue, params = process()", "type": "assigned_variable", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L141_C12", "vector": [14, 4, 0.4116, 0.0029, 4, 0.68, 0.0, 344, 3, 3, 0, 0, 712, 10, 1], "semantic": {"name": "lvalue, params", "arg_names": [], "import_names": [], "rhs_call_name": "process", "annotation": ""}, "snippet": " lvalue, params = lvalue.process(lookup_type, params_or_value, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L146_C12", "label": "params = get_db_prep_lookup()", "type": "assigned_variable", "loc": [146, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8", "vector": [14, 3, 0.4246, 0.0058, 3, 0.06, 1.0, 206, 3, 4, 0, 0, 681, 10, 2], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "get_db_prep_lookup", "annotation": ""}, "snippet": " params = Field().get_db_prep_lookup(lookup_type, params_or_value,\n connection=connection, prepared=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8", "label": "if", "type": "if", "loc": [148, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.4362, 0.0174, 2, 0.18, 0.375, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(lvalue, tuple):\n # A direct database column lookup.\n field_sql = self.sql_for_columns(lvalue, qn, connection)\n else:\n # A smart object with an as_sql() method.\n field_sql = lvalue.as_sql(qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L150_C12", "label": "field_sql = sql_for_columns()", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8", "vector": [14, 3, 0.4348, 0.0029, 3, 0.76, 0.0, 190, 3, 3, 0, 0, 537, 10, 1], "semantic": {"name": "field_sql", "arg_names": [], "import_names": [], "rhs_call_name": "sql_for_columns", "annotation": ""}, "snippet": " field_sql = self.sql_for_columns(lvalue, qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L153_C12", "label": "field_sql = as_sql()", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8", "vector": [14, 3, 0.4435, 0.0029, 3, 0.76, 1.0, 190, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "field_sql", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " field_sql = lvalue.as_sql(qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8", "label": "if", "type": "if", "loc": [155, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.4536, 0.0116, 2, 0.18, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value_annot is datetime.datetime:\n cast_sql = connection.ops.datetime_cast_sql()\n else:\n cast_sql = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L156_C12", "label": "cast_sql = datetime_cast_sql()", "type": "assigned_variable", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8", "vector": [14, 3, 0.4522, 0.0029, 3, 0.92, 0.0, 602, 3, 0, 0, 0, 252, 10, 1], "semantic": {"name": "cast_sql", "arg_names": [], "import_names": [], "rhs_call_name": "datetime_cast_sql", "annotation": ""}, "snippet": " cast_sql = connection.ops.datetime_cast_sql()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L158_C12", "label": "cast_sql =", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8", "vector": [14, 3, 0.458, 0.0029, 3, 0.92, 1.0, 602, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "cast_sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cast_sql = '%s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "label": "if", "type": "if", "loc": [160, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.4696, 0.0145, 2, 0.18, 0.625, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(params, 'as_sql'):\n extra, params = params.as_sql(qn, connection)\n cast_sql = ''\n else:\n extra = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L161_C12", "label": "extra, params = as_sql()", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "vector": [14, 3, 0.4667, 0.0029, 3, 0.19, 0.0, 298, 3, 2, 0, 0, 122, 10, 1], "semantic": {"name": "extra, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " extra, params = params.as_sql(qn, connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L162_C12", "label": "cast_sql =", "type": "assigned_variable", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "vector": [14, 3, 0.4696, 0.0029, 3, 0.19, 0.5, 602, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "cast_sql", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cast_sql = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L164_C12", "label": "extra =", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "vector": [14, 3, 0.4754, 0.0029, 3, 0.19, 1.0, 980, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "extra", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " extra = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8", "label": "if", "type": "if", "loc": [166, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.4855, 0.0116, 2, 0.18, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (len(params) == 1 and params[0] == '' and lookup_type == 'exact'\n and connection.features.interprets_empty_strings_as_nulls):\n lookup_type = 'isnull'\n value_annot = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L168_C12", "label": "lookup_type =", "type": "assigned_variable", "loc": [168, 168], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8", "vector": [14, 3, 0.487, 0.0029, 3, 0.76, 0.0, 476, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lookup_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lookup_type = 'isnull'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L169_C12", "label": "value_annot =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8", "vector": [14, 3, 0.4899, 0.0029, 3, 0.76, 1.0, 375, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "value_annot", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value_annot = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8", "label": "if", "type": "if", "loc": [171, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.5014, 0.0145, 2, 0.18, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in connection.operators:\n format = \"%s %%s %%s\" % (connection.ops.lookup_cast(lookup_type),)\n return (format % (field_sql,\n connection.operators[lookup_type] % cast_sql,\n extra), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L172_C12", "label": "format =", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8", "vector": [14, 3, 0.4986, 0.0029, 3, 0.69, 0.0, 293, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "format", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " format = \"%s %%s %%s\" % (connection.ops.lookup_cast(lookup_type),)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L173_C12", "label": "return", "type": "return", "loc": [173, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8", "vector": [13, 3, 0.5043, 0.0087, 3, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (format % (field_sql,\n connection.operators[lookup_type] % cast_sql,\n extra), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "label": "if", "type": "if", "loc": [177, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "vector": [4, 2, 0.5623, 0.1014, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 20], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type == 'in':\n if not value_annot:\n raise EmptyResultSet\n if extra:\n return ('%s IN %s' % (field_sql, extra), params)\n max_in_list_size = connection.ops.max_in_list_size()\n if max_in_list_size and len(params) > max_in_list_size:\n # Break up the params list into an OR of manageable chunks."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L178_C12", "label": "if", "type": "if", "loc": [178, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "vector": [4, 3, 0.5174, 0.0058, 3, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not value_annot:\n raise EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L180_C12", "label": "if", "type": "if", "loc": [180, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "vector": [4, 3, 0.5232, 0.0058, 3, 0.46, 0.25, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extra:\n return ('%s IN %s' % (field_sql, extra), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L181_C16", "label": "return", "type": "return", "loc": [181, 181], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L180_C12", "vector": [13, 4, 0.5246, 0.0029, 4, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('%s IN %s' % (field_sql, extra), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L182_C12", "label": "max_in_list_size = max_in_list_size()", "type": "assigned_variable", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "vector": [14, 3, 0.5275, 0.0029, 3, 0.46, 0.5, 516, 3, 0, 0, 0, 516, 10, 1], "semantic": {"name": "max_in_list_size", "arg_names": [], "import_names": [], "rhs_call_name": "max_in_list_size", "annotation": ""}, "snippet": " max_in_list_size = connection.ops.max_in_list_size()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "label": "if", "type": "if", "loc": [183, 199], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "vector": [4, 3, 0.5536, 0.0493, 3, 0.46, 0.75, 0, 0, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_in_list_size and len(params) > max_in_list_size:\n # Break up the params list into an OR of manageable chunks.\n in_clause_elements = ['(']\n for offset in xrange(0, len(params), max_in_list_size):\n if offset > 0:\n in_clause_elements.append(' OR ')\n in_clause_elements.append('%s IN (' % field_sql)\n group_size = min(len(params) - offset, max_in_list_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L185_C16", "label": "in_clause_elements =", "type": "assigned_variable", "loc": [185, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "vector": [14, 4, 0.5362, 0.0029, 4, 0.95, 0.0, 273, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "in_clause_elements", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " in_clause_elements = ['(']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "label": "for offset", "type": "for", "loc": [186, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "vector": [6, 4, 0.5493, 0.0232, 4, 0.95, 0.25, 132, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for offset in xrange(0, len(params), max_in_list_size):\n if offset > 0:\n in_clause_elements.append(' OR ')\n in_clause_elements.append('%s IN (' % field_sql)\n group_size = min(len(params) - offset, max_in_list_size)\n param_group = ', '.join(repeat('%s', group_size))\n in_clause_elements.append(param_group)\n in_clause_elements.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L187_C20", "label": "if", "type": "if", "loc": [187, 188], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [4, 5, 0.5435, 0.0058, 5, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if offset > 0:\n in_clause_elements.append(' OR ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L188_C24", "label": "append()", "type": "expression", "loc": [188, 188], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L187_C20", "vector": [8, 6, 0.5449, 0.0029, 6, 0.29, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " in_clause_elements.append(' OR ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L189_C20", "label": "append()", "type": "expression", "loc": [189, 189], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [8, 5, 0.5478, 0.0029, 5, 0.38, 0.2, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " in_clause_elements.append('%s IN (' % field_sql)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L190_C20", "label": "group_size = min()", "type": "assigned_variable", "loc": [190, 190], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [14, 5, 0.5507, 0.0029, 5, 0.38, 0.4, 810, 3, 2, 0, 0, 867, 10, 2], "semantic": {"name": "group_size", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " group_size = min(len(params) - offset, max_in_list_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L191_C20", "label": "param_group = join()", "type": "assigned_variable", "loc": [191, 191], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [14, 5, 0.5536, 0.0029, 5, 0.38, 0.6, 822, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "param_group", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " param_group = ', '.join(repeat('%s', group_size))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L192_C20", "label": "append()", "type": "expression", "loc": [192, 192], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [8, 5, 0.5565, 0.0029, 5, 0.38, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " in_clause_elements.append(param_group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L193_C20", "label": "append()", "type": "expression", "loc": [193, 193], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "vector": [8, 5, 0.5594, 0.0029, 5, 0.38, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " in_clause_elements.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L194_C16", "label": "append()", "type": "expression", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "vector": [8, 4, 0.5623, 0.0029, 4, 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": " in_clause_elements.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L195_C16", "label": "return", "type": "return", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "vector": [13, 4, 0.5652, 0.0029, 4, 0.95, 0.75, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(in_clause_elements), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L197_C16", "label": "return", "type": "return", "loc": [197, 199], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "vector": [13, 4, 0.5739, 0.0087, 4, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('%s IN (%s)' % (field_sql,\n ', '.join(repeat('%s', len(params)))),\n params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8", "label": "if", "type": "if", "loc": [200, 211], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "vector": [4, 3, 0.5957, 0.0348, 3, 0.46, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type in ('range', 'year'):\n return ('%s BETWEEN %%s and %%s' % field_sql, params)\n elif lookup_type in ('month', 'day', 'week_day'):\n return ('%s = %%s' % connection.ops.date_extract_sql(lookup_type, field_sql),\n params)\n elif lookup_type == 'isnull':\n return ('%s IS %sNULL' % (field_sql,\n (not value_annot and 'NOT ' or '')), ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L201_C12", "label": "return", "type": "return", "loc": [201, 201], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8", "vector": [13, 4, 0.5826, 0.0029, 4, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('%s BETWEEN %%s and %%s' % field_sql, params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8", "label": "if", "type": "if", "loc": [202, 211], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8", "vector": [4, 4, 0.5986, 0.029, 4, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type in ('month', 'day', 'week_day'):\n return ('%s = %%s' % connection.ops.date_extract_sql(lookup_type, field_sql),\n params)\n elif lookup_type == 'isnull':\n return ('%s IS %sNULL' % (field_sql,\n (not value_annot and 'NOT ' or '')), ())\n elif lookup_type == 'search':\n return (connection.ops.fulltext_search_sql(field_sql), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L203_C12", "label": "return", "type": "return", "loc": [203, 204], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8", "vector": [13, 5, 0.5899, 0.0058, 5, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('%s = %%s' % connection.ops.date_extract_sql(lookup_type, field_sql),\n params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8", "label": "if", "type": "if", "loc": [205, 211], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8", "vector": [4, 5, 0.6029, 0.0203, 5, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type == 'isnull':\n return ('%s IS %sNULL' % (field_sql,\n (not value_annot and 'NOT ' or '')), ())\n elif lookup_type == 'search':\n return (connection.ops.fulltext_search_sql(field_sql), params)\n elif lookup_type in ('regex', 'iregex'):\n return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L206_C12", "label": "return", "type": "return", "loc": [206, 207], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8", "vector": [13, 6, 0.5986, 0.0058, 6, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ('%s IS %sNULL' % (field_sql,\n (not value_annot and 'NOT ' or '')), ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8", "label": "if", "type": "if", "loc": [208, 211], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8", "vector": [4, 6, 0.6072, 0.0116, 6, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type == 'search':\n return (connection.ops.fulltext_search_sql(field_sql), params)\n elif lookup_type in ('regex', 'iregex'):\n return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L209_C12", "label": "return", "type": "return", "loc": [209, 209], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8", "vector": [13, 7, 0.6058, 0.0029, 7, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (connection.ops.fulltext_search_sql(field_sql), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L210_C8", "label": "if", "type": "if", "loc": [210, 211], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8", "vector": [4, 7, 0.6101, 0.0058, 7, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type in ('regex', 'iregex'):\n return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L211_C12", "label": "return", "type": "return", "loc": [211, 211], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L210_C8", "vector": [13, 8, 0.6116, 0.0029, 8, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return connection.ops.regex_lookup(lookup_type) % (field_sql, cast_sql), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "label": "sql_for_columns", "type": "function", "loc": [215, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [2, 1, 0.6391, 0.0348, 1, 0.85, 0.8333, 537, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "sql_for_columns", "arg_names": ["self", "data", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sql_for_columns(self, data, qn, connection):\n \"\"\"\n Returns the SQL fragment used for the left-hand side of a column\n constraint (for example, the \"T1.foo\" portion in the clause\n \"WHERE ... T1.foo = 6\").\n \"\"\"\n table_alias, name, db_type = data\n if table_alias:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L216_C8", "label": "expression", "type": "expression", "loc": [216, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "vector": [8, 2, 0.6319, 0.0145, 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 fragment used for the left-hand side of a column\n constraint (for example, the \"T1.foo\" portion in the clause\n \"WHERE ... T1.foo = 6\").\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L221_C8", "label": "table_alias, name, db_type =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "vector": [14, 2, 0.6406, 0.0029, 2, 0.99, 0.3333, 691, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "table_alias, name, db_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " table_alias, name, db_type = data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8", "label": "if", "type": "if", "loc": [222, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "vector": [4, 2, 0.6478, 0.0116, 2, 0.99, 0.6667, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if table_alias:\n lhs = '%s.%s' % (qn(table_alias), qn(name))\n else:\n lhs = qn(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L223_C12", "label": "lhs =", "type": "assigned_variable", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8", "vector": [14, 3, 0.6464, 0.0029, 3, 0.63, 0.0, 796, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "lhs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lhs = '%s.%s' % (qn(table_alias), qn(name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L225_C12", "label": "lhs = qn()", "type": "assigned_variable", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8", "vector": [14, 3, 0.6522, 0.0029, 3, 0.63, 1.0, 796, 3, 1, 0, 0, 514, 10, 1], "semantic": {"name": "lhs", "arg_names": [], "import_names": [], "rhs_call_name": "qn", "annotation": ""}, "snippet": " lhs = qn(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L226_C8", "label": "return", "type": "return", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "vector": [13, 2, 0.6551, 0.0029, 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 connection.ops.field_cast_sql(db_type) % lhs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "label": "relabel_aliases", "type": "function", "loc": [228, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "vector": [2, 1, 0.6942, 0.0696, 1, 0.85, 1.0, 905, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map, node=None):\n \"\"\"\n Relabels the alias values of any children. 'change_map' is a dictionary\n mapping old (current) alias values to the new values.\n \"\"\"\n if not node:\n node = self\n for pos, child in enumerate(node.children):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L229_C8", "label": "expression", "type": "expression", "loc": [229, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "vector": [8, 2, 0.6681, 0.0116, 2, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Relabels the alias values of any children. 'change_map' is a dictionary\n mapping old (current) alias values to the new values.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L233_C8", "label": "if", "type": "if", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "vector": [4, 2, 0.6768, 0.0058, 2, 0.68, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not node:\n node = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L234_C12", "label": "node =", "type": "assigned_variable", "loc": [234, 234], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L233_C8", "vector": [14, 3, 0.6783, 0.0029, 3, 0.69, 0.0, 772, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L235_C8", "label": "for pos, child", "type": "for", "loc": [235, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "vector": [6, 2, 0.7043, 0.0493, 2, 0.68, 1.0, 389, 3, 0, 0, 0, 0, 0, 12], "semantic": {"name": "pos, child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pos, child in enumerate(node.children):\n if hasattr(child, 'relabel_aliases'):\n child.relabel_aliases(change_map)\n elif isinstance(child, tree.Node):\n self.relabel_aliases(change_map, child)\n elif isinstance(child, (list, tuple)):\n if isinstance(child[0], (list, tuple)):\n elt = list(child[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12", "label": "if", "type": "if", "loc": [236, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L235_C8", "vector": [4, 3, 0.7058, 0.0464, 3, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(child, 'relabel_aliases'):\n child.relabel_aliases(change_map)\n elif isinstance(child, tree.Node):\n self.relabel_aliases(change_map, child)\n elif isinstance(child, (list, tuple)):\n if isinstance(child[0], (list, tuple)):\n elt = list(child[0])\n if elt[0] in change_map:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L237_C16", "label": "relabel_aliases()", "type": "expression", "loc": [237, 237], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12", "vector": [8, 4, 0.687, 0.0029, 4, 0.4, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "relabel_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "relabel_aliases", "annotation": ""}, "snippet": " child.relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12", "label": "if", "type": "if", "loc": [238, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12", "vector": [4, 4, 0.7087, 0.0406, 4, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(child, tree.Node):\n self.relabel_aliases(change_map, child)\n elif isinstance(child, (list, tuple)):\n if isinstance(child[0], (list, tuple)):\n elt = list(child[0])\n if elt[0] in change_map:\n elt[0] = change_map[elt[0]]\n node.children[pos] = (tuple(elt),) + child[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L239_C16", "label": "relabel_aliases()", "type": "expression", "loc": [239, 239], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12", "vector": [8, 5, 0.6928, 0.0029, 5, 0.39, 0.0, 905, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "relabel_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "relabel_aliases", "annotation": ""}, "snippet": " self.relabel_aliases(change_map, child)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12", "label": "if", "type": "if", "loc": [240, 251], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12", "vector": [4, 5, 0.7116, 0.0348, 5, 0.39, 1.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(child, (list, tuple)):\n if isinstance(child[0], (list, tuple)):\n elt = list(child[0])\n if elt[0] in change_map:\n elt[0] = change_map[elt[0]]\n node.children[pos] = (tuple(elt),) + child[1:]\n else:\n child[0].relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "label": "if", "type": "if", "loc": [241, 247], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12", "vector": [4, 6, 0.7072, 0.0203, 6, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(child[0], (list, tuple)):\n elt = list(child[0])\n if elt[0] in change_map:\n elt[0] = change_map[elt[0]]\n node.children[pos] = (tuple(elt),) + child[1:]\n else:\n child[0].relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L242_C20", "label": "elt = list()", "type": "assigned_variable", "loc": [242, 242], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "vector": [14, 7, 0.7014, 0.0029, 7, 0.46, 0.0, 459, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "elt", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " elt = list(child[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20", "label": "if", "type": "if", "loc": [243, 245], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "vector": [4, 7, 0.7072, 0.0087, 7, 0.46, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if elt[0] in change_map:\n elt[0] = change_map[elt[0]]\n node.children[pos] = (tuple(elt),) + child[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L244_C24", "label": "assign", "type": "assigned_variable", "loc": [244, 244], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20", "vector": [14, 8, 0.7072, 0.0029, 8, 0.26, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elt[0] = change_map[elt[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L245_C24", "label": "assign", "type": "assigned_variable", "loc": [245, 245], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20", "vector": [14, 8, 0.7101, 0.0029, 8, 0.26, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " node.children[pos] = (tuple(elt),) + child[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L247_C20", "label": "relabel_aliases()", "type": "expression", "loc": [247, 247], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "vector": [8, 7, 0.7159, 0.0029, 7, 0.46, 1.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "relabel_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "relabel_aliases", "annotation": ""}, "snippet": " child[0].relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L250_C16", "label": "if", "type": "if", "loc": [250, 251], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12", "vector": [4, 6, 0.7261, 0.0058, 6, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(child[3], 'relabel_aliases'):\n child[3].relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L251_C20", "label": "relabel_aliases()", "type": "expression", "loc": [251, 251], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L250_C16", "vector": [8, 7, 0.7275, 0.0029, 7, 0.92, 0.0, 905, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "relabel_aliases", "arg_names": [], "import_names": [], "rhs_call_name": "relabel_aliases", "annotation": ""}, "snippet": " child[3].relabel_aliases(change_map)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "label": "EverythingNode", "type": "class", "loc": [253, 262], "level": 0, "parent": null, "vector": [3, 0, 0.7464, 0.029, 0, 0.66, 0.7857, 514, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "EverythingNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EverythingNode(object):\n \"\"\"\n A node that matches everything.\n \"\"\"\n\n def as_sql(self, qn=None, connection=None):\n raise FullResultSet\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L254_C4", "label": "expression", "type": "expression", "loc": [254, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "vector": [8, 1, 0.7391, 0.0087, 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 A node that matches everything.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L258_C4", "label": "as_sql", "type": "function", "loc": [258, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "vector": [2, 1, 0.7493, 0.0058, 1, 0.72, 0.5, 122, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn=None, connection=None):\n raise FullResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L261_C4", "label": "relabel_aliases", "type": "function", "loc": [261, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "vector": [2, 1, 0.758, 0.0058, 1, 0.72, 1.0, 905, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map, node=None):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L262_C8", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L261_C4", "vector": [13, 2, 0.7594, 0.0029, 2, 0.86, 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_99016:ClassDef_L264_C0", "label": "NothingNode", "type": "class", "loc": [264, 272], "level": 0, "parent": null, "vector": [3, 0, 0.7768, 0.0261, 0, 0.66, 0.8571, 22, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "NothingNode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NothingNode(object):\n \"\"\"\n A node that matches nothing.\n \"\"\"\n def as_sql(self, qn=None, connection=None):\n raise EmptyResultSet\n\n def relabel_aliases(self, change_map, node=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L265_C4", "label": "expression", "type": "expression", "loc": [265, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "vector": [8, 1, 0.771, 0.0087, 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 A node that matches nothing.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L268_C4", "label": "as_sql", "type": "function", "loc": [268, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "vector": [2, 1, 0.7783, 0.0058, 1, 0.39, 0.5, 122, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn=None, connection=None):\n raise EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L271_C4", "label": "relabel_aliases", "type": "function", "loc": [271, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "vector": [2, 1, 0.787, 0.0058, 1, 0.39, 1.0, 905, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map, node=None):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L271_C4", "vector": [13, 2, 0.7884, 0.0029, 2, 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_99016:ClassDef_L274_C0", "label": "ExtraWhere", "type": "class", "loc": [274, 280], "level": 0, "parent": null, "vector": [3, 0, 0.8029, 0.0203, 0, 0.66, 0.9286, 672, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "ExtraWhere", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExtraWhere(object):\n def __init__(self, sqls, params):\n self.sqls = sqls\n self.params = params\n\n def as_sql(self, qn=None, connection=None):\n return \" AND \".join(self.sqls), tuple(self.params or ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4", "label": "__init__", "type": "function", "loc": [275, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L274_C0", "vector": [2, 1, 0.8, 0.0087, 1, 0.07, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "sqls", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sqls, params):\n self.sqls = sqls\n self.params = params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L276_C8", "label": "self.sqls =", "type": "assigned_variable", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4", "vector": [14, 2, 0.8, 0.0029, 2, 0.32, 0.0, 530, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sqls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.sqls = sqls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L277_C8", "label": "self.params =", "type": "assigned_variable", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4", "vector": [14, 2, 0.8029, 0.0029, 2, 0.32, 1.0, 402, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.params = params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L279_C4", "label": "as_sql", "type": "function", "loc": [279, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L274_C0", "vector": [2, 1, 0.8101, 0.0058, 1, 0.07, 1.0, 122, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn=None, connection=None):\n return \" AND \".join(self.sqls), tuple(self.params or ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L280_C8", "label": "return", "type": "return", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L279_C4", "vector": [13, 2, 0.8116, 0.0029, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \" AND \".join(self.sqls), tuple(self.params or ())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "label": "Constraint", "type": "class", "loc": [282, 345], "level": 0, "parent": null, "vector": [3, 0, 0.9087, 0.1855, 0, 0.66, 1.0, 957, 0, 6, 0, 0, 186, 0, 10], "semantic": {"name": "Constraint", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Constraint(object):\n \"\"\"\n An object that can be passed to WhereNode.add() and knows how to\n pre-process itself prior to including in the WhereNode.\n \"\"\"\n def __init__(self, alias, col, field):\n self.alias, self.col, self.field = alias, col, field\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L283_C4", "label": "expression", "type": "expression", "loc": [283, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [8, 1, 0.8246, 0.0116, 1, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n An object that can be passed to WhereNode.add() and knows how to\n pre-process itself prior to including in the WhereNode.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L287_C4", "label": "__init__", "type": "function", "loc": [287, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.8333, 0.0058, 1, 0.27, 0.1667, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "alias", "col", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, alias, col, field):\n self.alias, self.col, self.field = alias, col, field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L288_C8", "label": "assign", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L287_C4", "vector": [14, 2, 0.8348, 0.0029, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alias, self.col, self.field = alias, col, field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "label": "__getstate__", "type": "function", "loc": [290, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.858, 0.0377, 1, 0.27, 0.3333, 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 \"\"\"Save the state of the Constraint for pickling.\n\n Fields aren't necessarily pickleable, because they can have\n callable default values. So, instead of pickling the field\n store a reference so we can restore it manually\n \"\"\"\n obj_dict = self.__dict__.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L291_C8", "label": "expression", "type": "expression", "loc": [291, 296], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "vector": [8, 2, 0.8507, 0.0174, 2, 0.47, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Save the state of the Constraint for pickling.\n\n Fields aren't necessarily pickleable, because they can have\n callable default values. So, instead of pickling the field\n store a reference so we can restore it manually\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L297_C8", "label": "obj_dict = copy()", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "vector": [14, 2, 0.8609, 0.0029, 2, 0.47, 0.3333, 667, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "obj_dict", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " obj_dict = self.__dict__.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8", "label": "if", "type": "if", "loc": [298, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "vector": [4, 2, 0.8667, 0.0087, 2, 0.47, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.field:\n obj_dict['model'] = self.field.model\n obj_dict['field_name'] = self.field.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L299_C12", "label": "assign", "type": "assigned_variable", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8", "vector": [14, 3, 0.8667, 0.0029, 3, 0.38, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_dict['model'] = self.field.model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L300_C12", "label": "assign", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8", "vector": [14, 3, 0.8696, 0.0029, 3, 0.38, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj_dict['field_name'] = self.field.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L302_C8", "label": "return", "type": "return", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "vector": [13, 2, 0.8754, 0.0029, 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 obj_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "label": "__setstate__", "type": "function", "loc": [304, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.8928, 0.0261, 1, 0.27, 0.5, 698, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__setstate__", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setstate__(self, data):\n \"\"\"Restore the constraint \"\"\"\n model = data.pop('model', None)\n field_name = data.pop('field_name', None)\n self.__dict__.update(data)\n if model is not None:\n self.field = model._meta.get_field(field_name)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L305_C8", "label": "expression", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "vector": [8, 2, 0.8841, 0.0029, 2, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Restore the constraint \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L306_C8", "label": "model = pop()", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "vector": [14, 2, 0.887, 0.0029, 2, 0.84, 0.25, 722, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " model = data.pop('model', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L307_C8", "label": "field_name = pop()", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "vector": [14, 2, 0.8899, 0.0029, 2, 0.84, 0.5, 918, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "field_name", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " field_name = data.pop('field_name', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L308_C8", "label": "update()", "type": "expression", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "vector": [8, 2, 0.8928, 0.0029, 2, 0.84, 0.75, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.__dict__.update(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8", "label": "if", "type": "if", "loc": [309, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "vector": [4, 2, 0.9, 0.0116, 2, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model is not None:\n self.field = model._meta.get_field(field_name)\n else:\n self.field = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L310_C12", "label": "self.field = get_field()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8", "vector": [14, 3, 0.8986, 0.0029, 3, 0.96, 0.0, 951, 3, 1, 0, 0, 389, 10, 1], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "get_field", "annotation": ""}, "snippet": " self.field = model._meta.get_field(field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L312_C12", "label": "self.field =", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8", "vector": [14, 3, 0.9043, 0.0029, 3, 0.96, 1.0, 951, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4", "label": "prepare", "type": "function", "loc": [314, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.9145, 0.0116, 1, 0.27, 0.6667, 556, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "prepare", "arg_names": ["self", "lookup_type", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def prepare(self, lookup_type, value):\n if self.field:\n return self.field.get_prep_lookup(lookup_type, value)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L315_C8", "label": "if", "type": "if", "loc": [315, 316], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4", "vector": [4, 2, 0.9145, 0.0058, 2, 0.29, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.field:\n return self.field.get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L316_C12", "label": "return", "type": "return", "loc": [316, 316], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L315_C8", "vector": [13, 3, 0.9159, 0.0029, 3, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.field.get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L317_C8", "label": "return", "type": "return", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4", "vector": [13, 2, 0.9188, 0.0029, 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 value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "label": "process", "type": "function", "loc": [319, 341], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.9565, 0.0667, 1, 0.27, 0.8333, 712, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "process", "arg_names": ["self", "lookup_type", "value", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def process(self, lookup_type, value, connection):\n \"\"\"\n Returns a tuple of data suitable for inclusion in a WhereNode\n instance.\n \"\"\"\n # Because of circular imports, we need to import this here.\n from django.db.models.base import ObjectDoesNotExist\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L320_C8", "label": "expression", "type": "expression", "loc": [320, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "vector": [8, 2, 0.9319, 0.0116, 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 a tuple of data suitable for inclusion in a WhereNode\n instance.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L325_C8", "label": "from django.db.models.base import ObjectDoesNotExist", "type": "import", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "vector": [1, 2, 0.942, 0.0029, 2, 0.69, 0.3333, 465, 0, 1, 0, 0, 465, 0, 0], "semantic": {"name": "django.db.models.base", "arg_names": [], "import_names": ["ObjectDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.models.base import ObjectDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L326_C8", "label": "try", "type": "try", "loc": [326, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "vector": [7, 2, 0.9638, 0.0406, 2, 0.69, 0.6667, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if self.field:\n params = self.field.get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=True)\n db_type = self.field.db_type(connection=connection)\n else:\n # This branch is used at times when we add a comparison to NULL\n # (we don't really want to waste time looking up the associated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "label": "if", "type": "if", "loc": [327, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L326_C8", "vector": [4, 3, 0.9623, 0.0319, 3, 0.44, 0.0, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.field:\n params = self.field.get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=True)\n db_type = self.field.db_type(connection=connection)\n else:\n # This branch is used at times when we add a comparison to NULL\n # (we don't really want to waste time looking up the associated\n # field object at the calling location)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L328_C16", "label": "params = get_db_prep_lookup()", "type": "assigned_variable", "loc": [328, 329], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "vector": [14, 4, 0.9522, 0.0058, 4, 0.27, 0.0, 206, 3, 4, 0, 0, 681, 10, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "get_db_prep_lookup", "annotation": ""}, "snippet": " params = self.field.get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L330_C16", "label": "db_type = db_type()", "type": "assigned_variable", "loc": [330, 330], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "vector": [14, 4, 0.9565, 0.0029, 4, 0.27, 0.3333, 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 = self.field.db_type(connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L335_C16", "label": "params = get_db_prep_lookup()", "type": "assigned_variable", "loc": [335, 336], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "vector": [14, 4, 0.9725, 0.0058, 4, 0.27, 0.6667, 206, 3, 4, 0, 0, 681, 10, 2], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "get_db_prep_lookup", "annotation": ""}, "snippet": " params = Field().get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L337_C16", "label": "db_type =", "type": "assigned_variable", "loc": [337, 337], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "vector": [14, 4, 0.9768, 0.0029, 4, 0.27, 1.0, 976, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "db_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L341_C8", "label": "return", "type": "return", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "vector": [13, 2, 0.9884, 0.0029, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (self.alias, self.col, db_type), params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L343_C4", "label": "relabel_aliases", "type": "function", "loc": [343, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "vector": [2, 1, 0.9971, 0.0087, 1, 0.27, 1.0, 905, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map):\n if self.alias in change_map:\n self.alias = change_map[self.alias]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L344_C8", "label": "if", "type": "if", "loc": [344, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L343_C4", "vector": [4, 2, 0.9986, 0.0058, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.alias in change_map:\n self.alias = change_map[self.alias]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L345_C12", "label": "self.alias =", "type": "assigned_variable", "loc": [345, 345], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L344_C8", "vector": [14, 3, 1.0, 0.0029, 3, 0.6, 0.0, 503, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.alias", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.alias = change_map[self.alias]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L50_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L92_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L91_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L95_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L98_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L101_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L101_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L102_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L106_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L106_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L107_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L105_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L110_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L90_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L111_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L111_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L112_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L117_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L116_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L126_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L125_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L127_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L128_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L141_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L161_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L160_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L180_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L181_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L185_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L187_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L187_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L188_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L189_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L190_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L191_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L192_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L186_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L193_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L195_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L183_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L197_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L208_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L233_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L234_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:For_L235_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L237_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L236_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L239_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L238_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L242_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L244_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L243_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L245_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L241_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L247_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L240_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L250_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L250_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L251_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L253_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L274_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L280_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L298_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L304_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L315_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L316_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Expr_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:ImportFrom_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:Try_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L328_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L330_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L335_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L327_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L337_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Return_L341_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:FunctionDef_L343_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99016:If_L344_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99016:Assign_L345_C12"}] |
from query import *
from subqueries import *
from where import AND, OR
from datastructures import EmptyResultSet
__all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']
| ajibawa-2023/Python-Code-Large/train/row_99017 | 5 | 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_99017:ImportFrom_L1_C0", "label": "from query import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1429, 0.1429, 0, 0.66, 0.0, 546, 0, 1, 0, 0, 546, 0, 0], "semantic": {"name": "query", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from query import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99017:ImportFrom_L2_C0", "label": "from subqueries import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2857, 0.1429, 0, 0.66, 0.25, 401, 0, 1, 0, 0, 401, 0, 0], "semantic": {"name": "subqueries", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from subqueries import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99017:ImportFrom_L3_C0", "label": "from where import AND, OR", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.4286, 0.1429, 0, 0.66, 0.5, 169, 0, 2, 0, 0, 169, 0, 0], "semantic": {"name": "where", "arg_names": [], "import_names": ["AND", "OR"], "rhs_call_name": "", "annotation": ""}, "snippet": "from where import AND, OR"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99017:ImportFrom_L4_C0", "label": "from datastructures import EmptyResultSet", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.5714, 0.1429, 0, 0.66, 0.75, 215, 0, 1, 0, 0, 215, 0, 0], "semantic": {"name": "datastructures", "arg_names": [], "import_names": ["EmptyResultSet"], "rhs_call_name": "", "annotation": ""}, "snippet": "from datastructures import EmptyResultSet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99017:Assign_L6_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.8571, 0.1429, 0, 0.66, 1.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']"}] | [] |
"""
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class FullResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
exceptionally).
"""
def __init__(self, level):
self.level = level
class Empty(object):
pass
class RawValue(object):
def __init__(self, value):
self.value = value
class Date(object):
"""
Add a date selection column.
"""
def __init__(self, col, lookup_type):
self.col = col
self.lookup_type = lookup_type
def relabel_aliases(self, change_map):
c = self.col
if isinstance(c, (list, tuple)):
self.col = (change_map.get(c[0], c[0]), c[1])
def as_sql(self, qn, connection):
if isinstance(self.col, (list, tuple)):
col = '%s.%s' % tuple([qn(c) for c in self.col])
else:
col = self.col
return connection.ops.date_trunc_sql(self.lookup_type, col)
| ajibawa-2023/Python-Code-Large/train/row_99018 | 25 | 46 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.0543, 0.087, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nUseful auxilliary data structures for query construction. Not useful outside\nthe SQL domain.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L6_C0", "label": "EmptyResultSet", "type": "class", "loc": [6, 7], "level": 0, "parent": null, "vector": [3, 0, 0.1413, 0.0435, 0, 0.66, 0.1667, 855, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "EmptyResultSet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmptyResultSet(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L9_C0", "label": "FullResultSet", "type": "class", "loc": [9, 10], "level": 0, "parent": null, "vector": [3, 0, 0.2065, 0.0435, 0, 0.66, 0.3333, 127, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "FullResultSet", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FullResultSet(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L12_C0", "label": "MultiJoin", "type": "class", "loc": [12, 19], "level": 0, "parent": null, "vector": [3, 0, 0.337, 0.1739, 0, 0.66, 0.5, 795, 0, 1, 0, 0, 645, 0, 0], "semantic": {"name": "MultiJoin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MultiJoin(Exception):\n \"\"\"\n Used by join construction code to indicate the point at which a\n multi-valued join was attempted (if the caller wants to treat that\n exceptionally).\n \"\"\"\n def __init__(self, level):\n self.level = level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Expr_L13_C4", "label": "expression", "type": "expression", "loc": [13, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L12_C0", "vector": [8, 1, 0.3261, 0.1087, 1, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Used by join construction code to indicate the point at which a\n multi-valued join was attempted (if the caller wants to treat that\n exceptionally).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L12_C0", "vector": [2, 1, 0.4022, 0.0435, 1, 0.78, 1.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, level):\n self.level = level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L19_C8", "label": "self.level =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L18_C4", "vector": [14, 2, 0.413, 0.0217, 2, 0.79, 0.0, 56, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.level = level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L21_C0", "label": "Empty", "type": "class", "loc": [21, 22], "level": 0, "parent": null, "vector": [3, 0, 0.4674, 0.0435, 0, 0.66, 0.6667, 28, 0, 0, 0, 0, 186, 0, 0], "semantic": {"name": "Empty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Empty(object):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L24_C0", "label": "RawValue", "type": "class", "loc": [24, 26], "level": 0, "parent": null, "vector": [3, 0, 0.5435, 0.0652, 0, 0.66, 0.8333, 237, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "RawValue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RawValue(object):\n def __init__(self, value):\n self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L24_C0", "vector": [2, 1, 0.5543, 0.0435, 1, 0.41, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, value):\n self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L26_C8", "label": "self.value =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L25_C4", "vector": [14, 2, 0.5652, 0.0217, 2, 0.48, 0.0, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.value = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "label": "Date", "type": "class", "loc": [28, 46], "level": 0, "parent": null, "vector": [3, 0, 0.8043, 0.413, 0, 0.66, 1.0, 929, 0, 3, 0, 0, 186, 0, 6], "semantic": {"name": "Date", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Date(object):\n \"\"\"\n Add a date selection column.\n \"\"\"\n def __init__(self, col, lookup_type):\n self.col = col\n self.lookup_type = lookup_type\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Expr_L29_C4", "label": "expression", "type": "expression", "loc": [29, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "vector": [8, 1, 0.6522, 0.0652, 1, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Add a date selection column.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "vector": [2, 1, 0.7174, 0.0652, 1, 0.88, 0.3333, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "col", "lookup_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, col, lookup_type):\n self.col = col\n self.lookup_type = lookup_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L33_C8", "label": "self.col =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4", "vector": [14, 2, 0.7174, 0.0217, 2, 0.58, 0.0, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.col = col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L34_C8", "label": "self.lookup_type =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4", "vector": [14, 2, 0.7391, 0.0217, 2, 0.58, 1.0, 175, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lookup_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lookup_type = lookup_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4", "label": "relabel_aliases", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "vector": [2, 1, 0.8152, 0.087, 1, 0.88, 0.6667, 905, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "relabel_aliases", "arg_names": ["self", "change_map"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def relabel_aliases(self, change_map):\n c = self.col\n if isinstance(c, (list, tuple)):\n self.col = (change_map.get(c[0], c[0]), c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L37_C8", "label": "c =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4", "vector": [14, 2, 0.8043, 0.0217, 2, 0.32, 0.0, 411, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " c = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4", "vector": [4, 2, 0.837, 0.0435, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(c, (list, tuple)):\n self.col = (change_map.get(c[0], c[0]), c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L39_C12", "label": "self.col =", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L38_C8", "vector": [14, 3, 0.8478, 0.0217, 3, 0.93, 0.0, 11, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "self.col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.col = (change_map.get(c[0], c[0]), c[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4", "label": "as_sql", "type": "function", "loc": [41, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "vector": [2, 1, 0.9457, 0.1304, 1, 0.88, 1.0, 122, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn, connection):\n if isinstance(self.col, (list, tuple)):\n col = '%s.%s' % tuple([qn(c) for c in self.col])\n else:\n col = self.col\n return connection.ops.date_trunc_sql(self.lookup_type, col)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8", "label": "if", "type": "if", "loc": [42, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4", "vector": [4, 2, 0.9457, 0.087, 2, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.col, (list, tuple)):\n col = '%s.%s' % tuple([qn(c) for c in self.col])\n else:\n col = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L43_C12", "label": "col =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8", "vector": [14, 3, 0.9348, 0.0217, 3, 0.18, 0.0, 157, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = '%s.%s' % tuple([qn(c) for c in self.col])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L45_C12", "label": "col =", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8", "vector": [14, 3, 0.9783, 0.0217, 3, 0.18, 1.0, 157, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " col = self.col"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99018:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4", "vector": [13, 2, 1.0, 0.0217, 2, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return connection.ops.date_trunc_sql(self.lookup_type, col)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:If_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Assign_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99018:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99018:Return_L46_C8"}] |
import datetime
import os
import django.utils.copycompat as copy
from django.conf import settings
from django.db.models.fields import Field
from django.core.files.base import File, ContentFile
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile, get_image_dimensions
from django.core.files.uploadedfile import UploadedFile
from django.utils.functional import curry
from django.db.models import signals
from django.utils.encoding import force_unicode, smart_str
from django.utils.translation import ugettext_lazy, ugettext as _
from django import forms
from django.db.models.loading import cache
class FieldFile(File):
def __init__(self, instance, field, name):
super(FieldFile, self).__init__(None, name)
self.instance = instance
self.field = field
self.storage = field.storage
self._committed = True
def __eq__(self, other):
# Older code may be expecting FileField values to be simple strings.
# By overriding the == operator, it can remain backwards compatibility.
if hasattr(other, 'name'):
return self.name == other.name
return self.name == other
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
# Required because we defined a custom __eq__.
return hash(self.name)
# The standard File contains most of the necessary properties, but
# FieldFiles can be instantiated without a name, so that needs to
# be checked for here.
def _require_file(self):
if not self:
raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)
def _get_file(self):
self._require_file()
if not hasattr(self, '_file') or self._file is None:
self._file = self.storage.open(self.name, 'rb')
return self._file
def _set_file(self, file):
self._file = file
def _del_file(self):
del self._file
file = property(_get_file, _set_file, _del_file)
def _get_path(self):
self._require_file()
return self.storage.path(self.name)
path = property(_get_path)
def _get_url(self):
self._require_file()
return self.storage.url(self.name)
url = property(_get_url)
def _get_size(self):
self._require_file()
if not self._committed:
return len(self.file)
return self.storage.size(self.name)
size = property(_get_size)
def open(self, mode='rb'):
self._require_file()
self.file.open(mode)
# open() doesn't alter the file's contents, but it does reset the pointer
open.alters_data = True
# In addition to the standard File API, FieldFiles have extra methods
# to further manipulate the underlying file, as well as update the
# associated model instance.
def save(self, name, content, save=True):
name = self.field.generate_filename(self.instance, name)
self.name = self.storage.save(name, content)
setattr(self.instance, self.field.name, self.name)
# Update the filesize cache
self._size = len(content)
self._committed = True
# Save the object because it has changed, unless save is False
if save:
self.instance.save()
save.alters_data = True
def delete(self, save=True):
# Only close the file if it's already open, which we know by the
# presence of self._file
if hasattr(self, '_file'):
self.close()
del self.file
self.storage.delete(self.name)
self.name = None
setattr(self.instance, self.field.name, self.name)
# Delete the filesize cache
if hasattr(self, '_size'):
del self._size
self._committed = False
if save:
self.instance.save()
delete.alters_data = True
def _get_closed(self):
file = getattr(self, '_file', None)
return file is None or file.closed
closed = property(_get_closed)
def close(self):
file = getattr(self, '_file', None)
if file is not None:
file.close()
def __getstate__(self):
# FieldFile needs access to its associated model field and an instance
# it's attached to in order to work properly, but the only necessary
# data to be pickled is the file's name itself. Everything else will
# be restored later, by FileDescriptor below.
return {'name': self.name, 'closed': False, '_committed': True, '_file': None}
class FileDescriptor(object):
"""
The descriptor for the file attribute on the model instance. Returns a
FieldFile when accessed so you can do stuff like::
>>> instance.file.size
Assigns a file object on assignment so you can do::
>>> instance.file = File(...)
"""
def __init__(self, field):
self.field = field
def __get__(self, instance=None, owner=None):
if instance is None:
raise AttributeError(
"The '%s' attribute can only be accessed from %s instances."
% (self.field.name, owner.__name__))
# This is slightly complicated, so worth an explanation.
# instance.file`needs to ultimately return some instance of `File`,
# probably a subclass. Additionally, this returned object needs to have
# the FieldFile API so that users can easily do things like
# instance.file.path and have that delegated to the file storage engine.
# Easy enough if we're strict about assignment in __set__, but if you
# peek below you can see that we're not. So depending on the current
# value of the field we have to dynamically construct some sort of
# "thing" to return.
# The instance dict contains whatever was originally assigned
# in __set__.
file = instance.__dict__[self.field.name]
# If this value is a string (instance.file = "path/to/file") or None
# then we simply wrap it with the appropriate attribute class according
# to the file field. [This is FieldFile for FileFields and
# ImageFieldFile for ImageFields; it's also conceivable that user
# subclasses might also want to subclass the attribute class]. This
# object understands how to convert a path to a file, and also how to
# handle None.
if isinstance(file, basestring) or file is None:
attr = self.field.attr_class(instance, self.field, file)
instance.__dict__[self.field.name] = attr
# Other types of files may be assigned as well, but they need to have
# the FieldFile interface added to the. Thus, we wrap any other type of
# File inside a FieldFile (well, the field's attr_class, which is
# usually FieldFile).
elif isinstance(file, File) and not isinstance(file, FieldFile):
file_copy = self.field.attr_class(instance, self.field, file.name)
file_copy.file = file
file_copy._committed = False
instance.__dict__[self.field.name] = file_copy
# Finally, because of the (some would say boneheaded) way pickle works,
# the underlying FieldFile might not actually itself have an associated
# file. So we need to reset the details of the FieldFile in those cases.
elif isinstance(file, FieldFile) and not hasattr(file, 'field'):
file.instance = instance
file.field = self.field
file.storage = self.field.storage
# That was fun, wasn't it?
return instance.__dict__[self.field.name]
def __set__(self, instance, value):
instance.__dict__[self.field.name] = value
class FileField(Field):
# The class to wrap instance attributes in. Accessing the file object off
# the instance will always return an instance of attr_class.
attr_class = FieldFile
# The descriptor to use for accessing the attribute off of the class.
descriptor_class = FileDescriptor
description = ugettext_lazy("File path")
def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs):
for arg in ('primary_key', 'unique'):
if arg in kwargs:
raise TypeError("'%s' is not a valid argument for %s." % (arg, self.__class__))
self.storage = storage or default_storage
self.upload_to = upload_to
if callable(upload_to):
self.generate_filename = upload_to
kwargs['max_length'] = kwargs.get('max_length', 100)
super(FileField, self).__init__(verbose_name, name, **kwargs)
def get_internal_type(self):
return "FileField"
def get_prep_lookup(self, lookup_type, value):
if hasattr(value, 'name'):
value = value.name
return super(FileField, self).get_prep_lookup(lookup_type, value)
def get_prep_value(self, value):
"Returns field's value prepared for saving into a database."
# Need to convert File objects provided via a form to unicode for database insertion
if value is None:
return None
return unicode(value)
def pre_save(self, model_instance, add):
"Returns field's value just before saving."
file = super(FileField, self).pre_save(model_instance, add)
if file and not file._committed:
# Commit the file to storage prior to saving the model
file.save(file.name, file, save=False)
return file
def contribute_to_class(self, cls, name):
super(FileField, self).contribute_to_class(cls, name)
setattr(cls, self.name, self.descriptor_class(self))
signals.post_delete.connect(self.delete_file, sender=cls)
def delete_file(self, instance, sender, **kwargs):
file = getattr(instance, self.attname)
# If no other object of this type references the file,
# and it's not the default value for future objects,
# delete it from the backend.
if file and file.name != self.default and \
not sender._default_manager.filter(**{self.name: file.name}):
file.delete(save=False)
elif file:
# Otherwise, just close the file, so it doesn't tie up resources.
file.close()
def get_directory_name(self):
return os.path.normpath(force_unicode(datetime.datetime.now().strftime(smart_str(self.upload_to))))
def get_filename(self, filename):
return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename)))
def generate_filename(self, instance, filename):
return os.path.join(self.get_directory_name(), self.get_filename(filename))
def save_form_data(self, instance, data):
# Important: None means "no change", other false value means "clear"
# This subtle distinction (rather than a more explicit marker) is
# needed because we need to consume values that are also sane for a
# regular (non Model-) Form to find in its cleaned_data dictionary.
if data is not None:
# This value will be converted to unicode and stored in the
# database, so leaving False as-is is not acceptable.
if not data:
data = ''
setattr(instance, self.name, data)
def formfield(self, **kwargs):
defaults = {'form_class': forms.FileField, 'max_length': self.max_length}
# If a file has been provided previously, then the form doesn't require
# that a new file is provided this time.
# The code to mark the form field as not required is used by
# form_for_instance, but can probably be removed once form_for_instance
# is gone. ModelForm uses a different method to check for an existing file.
if 'initial' in kwargs:
defaults['required'] = False
defaults.update(kwargs)
return super(FileField, self).formfield(**defaults)
class ImageFileDescriptor(FileDescriptor):
"""
Just like the FileDescriptor, but for ImageFields. The only difference is
assigning the width/height to the width_field/height_field, if appropriate.
"""
def __set__(self, instance, value):
previous_file = instance.__dict__.get(self.field.name)
super(ImageFileDescriptor, self).__set__(instance, value)
# To prevent recalculating image dimensions when we are instantiating
# an object from the database (bug #11084), only update dimensions if
# the field had a value before this assignment. Since the default
# value for FileField subclasses is an instance of field.attr_class,
# previous_file will only be None when we are called from
# Model.__init__(). The ImageField.update_dimension_fields method
# hooked up to the post_init signal handles the Model.__init__() cases.
# Assignment happening outside of Model.__init__() will trigger the
# update right here.
if previous_file is not None:
self.field.update_dimension_fields(instance, force=True)
class ImageFieldFile(ImageFile, FieldFile):
def delete(self, save=True):
# Clear the image dimensions cache
if hasattr(self, '_dimensions_cache'):
del self._dimensions_cache
super(ImageFieldFile, self).delete(save)
class ImageField(FileField):
attr_class = ImageFieldFile
descriptor_class = ImageFileDescriptor
description = ugettext_lazy("File path")
def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):
self.width_field, self.height_field = width_field, height_field
FileField.__init__(self, verbose_name, name, **kwargs)
def contribute_to_class(self, cls, name):
super(ImageField, self).contribute_to_class(cls, name)
# Attach update_dimension_fields so that dimension fields declared
# after their corresponding image field don't stay cleared by
# Model.__init__, see bug #11196.
signals.post_init.connect(self.update_dimension_fields, sender=cls)
def update_dimension_fields(self, instance, force=False, *args, **kwargs):
"""
Updates field's width and height fields, if defined.
This method is hooked up to model's post_init signal to update
dimensions after instantiating a model instance. However, dimensions
won't be updated if the dimensions fields are already populated. This
avoids unnecessary recalculation when loading an object from the
database.
Dimensions can be forced to update with force=True, which is how
ImageFileDescriptor.__set__ calls this method.
"""
# Nothing to update if the field doesn't have have dimension fields.
has_dimension_fields = self.width_field or self.height_field
if not has_dimension_fields:
return
# getattr will call the ImageFileDescriptor's __get__ method, which
# coerces the assigned value into an instance of self.attr_class
# (ImageFieldFile in this case).
file = getattr(instance, self.attname)
# Nothing to update if we have no file and not being forced to update.
if not file and not force:
return
dimension_fields_filled = not(
(self.width_field and not getattr(instance, self.width_field))
or (self.height_field and not getattr(instance, self.height_field))
)
# When both dimension fields have values, we are most likely loading
# data from the database or updating an image field that already had
# an image stored. In the first case, we don't want to update the
# dimension fields because we are already getting their values from the
# database. In the second case, we do want to update the dimensions
# fields and will skip this return because force will be True since we
# were called from ImageFileDescriptor.__set__.
if dimension_fields_filled and not force:
return
# file should be an instance of ImageFieldFile or should be None.
if file:
width = file.width
height = file.height
else:
# No file, so clear dimensions fields.
width = None
height = None
# Update the width and height fields.
if self.width_field:
setattr(instance, self.width_field, width)
if self.height_field:
setattr(instance, self.height_field, height)
def formfield(self, **kwargs):
defaults = {'form_class': forms.ImageField}
defaults.update(kwargs)
return super(ImageField, self).formfield(**defaults)
| ajibawa-2023/Python-Code-Large/train/row_99019 | 213 | 411 | 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_99019:Import_L1_C0", "label": "datetime import datetime", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0024, 0.0024, 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_99019:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0049, 0.0024, 0, 0.66, 0.05, 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_99019:Import_L4_C0", "label": "django.utils.copycompat import copy", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0097, 0.0024, 0, 0.66, 0.1, 125, 0, 1, 0, 0, 125, 0, 0], "semantic": {"name": "django.utils.copycompat", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "import django.utils.copycompat as copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L6_C0", "label": "from django.conf import settings", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0146, 0.0024, 0, 0.66, 0.15, 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_99019:ImportFrom_L7_C0", "label": "from django.db.models.fields import Field", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.017, 0.0024, 0, 0.66, 0.2, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["Field"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import Field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L8_C0", "label": "from django.core.files.base import File, ContentFile", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0195, 0.0024, 0, 0.66, 0.25, 293, 0, 2, 0, 0, 293, 0, 0], "semantic": {"name": "django.core.files.base", "arg_names": [], "import_names": ["File", "ContentFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.files.base import File, ContentFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L9_C0", "label": "from django.core.files.storage import default_storage", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0219, 0.0024, 0, 0.66, 0.3, 919, 0, 1, 0, 0, 919, 0, 0], "semantic": {"name": "django.core.files.storage", "arg_names": [], "import_names": ["default_storage"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.files.storage import default_storage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L10_C0", "label": "from django.core.files.images import ImageFile, get_image_dimensions", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0243, 0.0024, 0, 0.66, 0.35, 911, 0, 2, 0, 0, 911, 0, 0], "semantic": {"name": "django.core.files.images", "arg_names": [], "import_names": ["ImageFile", "get_image_dimensions"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.files.images import ImageFile, get_image_dimensions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L11_C0", "label": "from django.core.files.uploadedfile import UploadedFile", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0268, 0.0024, 0, 0.66, 0.4, 779, 0, 1, 0, 0, 779, 0, 0], "semantic": {"name": "django.core.files.uploadedfile", "arg_names": [], "import_names": ["UploadedFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.files.uploadedfile import UploadedFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L12_C0", "label": "from django.utils.functional import curry", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0292, 0.0024, 0, 0.66, 0.45, 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_99019:ImportFrom_L13_C0", "label": "from django.db.models import signals", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0316, 0.0024, 0, 0.66, 0.5, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["signals"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import signals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L14_C0", "label": "from django.utils.encoding import force_unicode, smart_str", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0341, 0.0024, 0, 0.66, 0.55, 96, 0, 2, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["force_unicode", "smart_str"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.encoding import force_unicode, smart_str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L15_C0", "label": "from django.utils.translation import ugettext_lazy, _", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0365, 0.0024, 0, 0.66, 0.6, 389, 0, 2, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names": [], "import_names": ["ugettext_lazy", "_"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.translation import ugettext_lazy, ugettext as _"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L16_C0", "label": "from django import forms", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0389, 0.0024, 0, 0.66, 0.65, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django import forms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ImportFrom_L17_C0", "label": "from django.db.models.loading import cache", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0414, 0.0024, 0, 0.66, 0.7, 343, 0, 1, 0, 0, 343, 0, 0], "semantic": {"name": "django.db.models.loading", "arg_names": [], "import_names": ["cache"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.loading import cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "label": "FieldFile", "type": "class", "loc": [19, 140], "level": 0, "parent": null, "vector": [3, 0, 0.1934, 0.2968, 0, 0.66, 0.75, 743, 0, 17, 0, 0, 491, 0, 37], "semantic": {"name": "FieldFile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FieldFile(File):\n def __init__(self, instance, field, name):\n super(FieldFile, self).__init__(None, name)\n self.instance = instance\n self.field = field\n self.storage = field.storage\n self._committed = True\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.0547, 0.0146, 1, 0.29, 0.0, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "instance", "field", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, instance, field, name):\n super(FieldFile, self).__init__(None, name)\n self.instance = instance\n self.field = field\n self.storage = field.storage\n self._committed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L21_C8", "label": "__init__()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "vector": [8, 2, 0.0511, 0.0024, 2, 0.5, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(FieldFile, self).__init__(None, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L22_C8", "label": "self.instance =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "vector": [14, 2, 0.0535, 0.0024, 2, 0.5, 0.25, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.instance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.instance = instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L23_C8", "label": "self.field =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "vector": [14, 2, 0.056, 0.0024, 2, 0.5, 0.5, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L24_C8", "label": "self.storage =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "vector": [14, 2, 0.0584, 0.0024, 2, 0.5, 0.75, 956, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.storage = field.storage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L25_C8", "label": "self._committed =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "vector": [14, 2, 0.0608, 0.0024, 2, 0.5, 1.0, 219, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._committed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._committed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4", "label": "__eq__", "type": "function", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.0718, 0.0146, 1, 0.29, 0.0417, 763, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__eq__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __eq__(self, other):\n # Older code may be expecting FileField values to be simple strings.\n # By overriding the == operator, it can remain backwards compatibility.\n if hasattr(other, 'name'):\n return self.name == other.name\n return self.name == other"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L30_C8", "label": "if", "type": "if", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4", "vector": [4, 2, 0.0742, 0.0049, 2, 0.0, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(other, 'name'):\n return self.name == other.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L31_C12", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L30_C8", "vector": [13, 3, 0.0754, 0.0024, 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 self.name == other.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4", "vector": [13, 2, 0.0779, 0.0024, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name == other"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L34_C4", "label": "__ne__", "type": "function", "loc": [34, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.0839, 0.0049, 1, 0.29, 0.0833, 254, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__ne__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __ne__(self, other):\n return not self.__eq__(other)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L35_C8", "label": "return", "type": "return", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L34_C4", "vector": [13, 2, 0.0852, 0.0024, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self.__eq__(other)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L37_C4", "label": "__hash__", "type": "function", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.0925, 0.0073, 1, 0.29, 0.125, 49, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__hash__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __hash__(self):\n # Required because we defined a custom __eq__.\n return hash(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L37_C4", "vector": [13, 2, 0.0949, 0.0024, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return hash(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L45_C4", "label": "_require_file", "type": "function", "loc": [45, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1119, 0.0073, 1, 0.29, 0.1667, 452, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _require_file(self):\n if not self:\n raise ValueError(\"The '%s' attribute has no file associated with it.\" % self.field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L45_C4", "vector": [4, 2, 0.1131, 0.0049, 2, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self:\n raise ValueError(\"The '%s' attribute has no file associated with it.\" % self.field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "label": "_get_file", "type": "function", "loc": [49, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1241, 0.0122, 1, 0.29, 0.2083, 337, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_file", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_file(self):\n self._require_file()\n if not hasattr(self, '_file') or self._file is None:\n self._file = self.storage.open(self.name, 'rb')\n return self._file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L50_C8", "label": "_require_file()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "vector": [8, 2, 0.1217, 0.0024, 2, 0.99, 0.0, 452, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": [], "import_names": [], "rhs_call_name": "_require_file", "annotation": ""}, "snippet": " self._require_file()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L51_C8", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "vector": [4, 2, 0.1253, 0.0049, 2, 0.99, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, '_file') or self._file is None:\n self._file = self.storage.open(self.name, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L52_C12", "label": "self._file = open()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L51_C8", "vector": [14, 3, 0.1265, 0.0024, 3, 0.85, 0.0, 852, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self._file = self.storage.open(self.name, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "vector": [13, 2, 0.129, 0.0024, 2, 0.99, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L55_C4", "label": "_set_file", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.135, 0.0049, 1, 0.29, 0.25, 243, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_set_file", "arg_names": ["self", "file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_file(self, file):\n self._file = file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L56_C8", "label": "self._file =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L55_C4", "vector": [14, 2, 0.1363, 0.0024, 2, 0.01, 0.0, 852, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._file = file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L58_C4", "label": "_del_file", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1423, 0.0049, 1, 0.29, 0.2917, 325, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_del_file", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _del_file(self):\n del self._file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L61_C4", "label": "file = property()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.1484, 0.0024, 1, 0.29, 0.3333, 107, 3, 3, 0, 0, 244, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " file = property(_get_file, _set_file, _del_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4", "label": "_get_path", "type": "function", "loc": [63, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1557, 0.0073, 1, 0.29, 0.375, 771, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_path", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_path(self):\n self._require_file()\n return self.storage.path(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L64_C8", "label": "_require_file()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4", "vector": [8, 2, 0.1557, 0.0024, 2, 0.85, 0.0, 452, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": [], "import_names": [], "rhs_call_name": "_require_file", "annotation": ""}, "snippet": " self._require_file()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4", "vector": [13, 2, 0.1582, 0.0024, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.storage.path(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L66_C4", "label": "path = property()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.1606, 0.0024, 1, 0.29, 0.4167, 358, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " path = property(_get_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4", "label": "_get_url", "type": "function", "loc": [68, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1679, 0.0073, 1, 0.29, 0.4583, 384, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_url", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_url(self):\n self._require_file()\n return self.storage.url(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L69_C8", "label": "_require_file()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4", "vector": [8, 2, 0.1679, 0.0024, 2, 0.49, 0.0, 452, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": [], "import_names": [], "rhs_call_name": "_require_file", "annotation": ""}, "snippet": " self._require_file()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L70_C8", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4", "vector": [13, 2, 0.1703, 0.0024, 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.storage.url(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L71_C4", "label": "url = property()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.1727, 0.0024, 1, 0.29, 0.5, 789, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " url = property(_get_url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "label": "_get_size", "type": "function", "loc": [73, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1825, 0.0122, 1, 0.29, 0.5417, 61, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_size", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_size(self):\n self._require_file()\n if not self._committed:\n return len(self.file)\n return self.storage.size(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L74_C8", "label": "_require_file()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "vector": [8, 2, 0.18, 0.0024, 2, 0.82, 0.0, 452, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": [], "import_names": [], "rhs_call_name": "_require_file", "annotation": ""}, "snippet": " self._require_file()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "vector": [4, 2, 0.1837, 0.0049, 2, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._committed:\n return len(self.file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L76_C12", "label": "return", "type": "return", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L75_C8", "vector": [13, 3, 0.1849, 0.0024, 3, 0.18, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self.file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L77_C8", "label": "return", "type": "return", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "vector": [13, 2, 0.1873, 0.0024, 2, 0.82, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.storage.size(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L78_C4", "label": "size = property()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.1898, 0.0024, 1, 0.29, 0.5833, 714, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " size = property(_get_size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4", "label": "open", "type": "function", "loc": [80, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.1971, 0.0073, 1, 0.29, 0.625, 693, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "open", "arg_names": ["self", "mode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def open(self, mode='rb'):\n self._require_file()\n self.file.open(mode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L81_C8", "label": "_require_file()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4", "vector": [8, 2, 0.1971, 0.0024, 2, 0.79, 0.0, 452, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_require_file", "arg_names": [], "import_names": [], "rhs_call_name": "_require_file", "annotation": ""}, "snippet": " self._require_file()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L82_C8", "label": "open()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4", "vector": [8, 2, 0.1995, 0.0024, 2, 0.79, 1.0, 693, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "open", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self.file.open(mode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L84_C4", "label": "open.alters_data =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.2044, 0.0024, 1, 0.29, 0.6667, 570, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "open.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " open.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "label": "save", "type": "function", "loc": [90, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.2324, 0.0292, 1, 0.29, 0.7083, 928, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "save", "arg_names": ["self", "name", "content", "save"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save(self, name, content, save=True):\n name = self.field.generate_filename(self.instance, name)\n self.name = self.storage.save(name, content)\n setattr(self.instance, self.field.name, self.name)\n\n # Update the filesize cache\n self._size = len(content)\n self._committed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L91_C8", "label": "name = generate_filename()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [14, 2, 0.2214, 0.0024, 2, 0.44, 0.0, 57, 3, 2, 0, 0, 441, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "generate_filename", "annotation": ""}, "snippet": " name = self.field.generate_filename(self.instance, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L92_C8", "label": "self.name = save()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [14, 2, 0.2238, 0.0024, 2, 0.44, 0.2, 689, 3, 2, 0, 0, 928, 10, 1], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " self.name = self.storage.save(name, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L93_C8", "label": "setattr()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [8, 2, 0.2263, 0.0024, 2, 0.44, 0.4, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self.instance, self.field.name, self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L96_C8", "label": "self._size = len()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [14, 2, 0.2336, 0.0024, 2, 0.44, 0.6, 692, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "self._size", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " self._size = len(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L97_C8", "label": "self._committed =", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [14, 2, 0.236, 0.0024, 2, 0.44, 0.8, 219, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._committed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._committed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "vector": [4, 2, 0.2445, 0.0049, 2, 0.44, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save:\n self.instance.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L101_C12", "label": "save()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L100_C8", "vector": [8, 3, 0.2457, 0.0024, 3, 0.5, 0.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " self.instance.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L102_C4", "label": "save.alters_data =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.2482, 0.0024, 1, 0.29, 0.75, 353, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "save.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " save.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "label": "delete", "type": "function", "loc": [104, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.2749, 0.0462, 1, 0.29, 0.7917, 266, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "delete", "arg_names": ["self", "save"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self, save=True):\n # Only close the file if it's already open, which we know by the\n # presence of self._file\n if hasattr(self, '_file'):\n self.close()\n del self.file\n\n self.storage.delete(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L107_C8", "label": "if", "type": "if", "loc": [107, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [4, 2, 0.2628, 0.0073, 2, 0.36, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_file'):\n self.close()\n del self.file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L108_C12", "label": "close()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L107_C8", "vector": [8, 3, 0.2628, 0.0024, 3, 0.66, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L111_C8", "label": "delete()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [8, 2, 0.2701, 0.0024, 2, 0.36, 0.1667, 266, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " self.storage.delete(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L113_C8", "label": "self.name =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [14, 2, 0.2749, 0.0024, 2, 0.36, 0.3333, 689, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L114_C8", "label": "setattr()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [8, 2, 0.2774, 0.0024, 2, 0.36, 0.5, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self.instance, self.field.name, self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L117_C8", "label": "if", "type": "if", "loc": [117, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [4, 2, 0.2859, 0.0049, 2, 0.36, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_size'):\n del self._size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L119_C8", "label": "self._committed =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [14, 2, 0.2895, 0.0024, 2, 0.36, 0.8333, 219, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._committed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._committed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L121_C8", "label": "if", "type": "if", "loc": [121, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "vector": [4, 2, 0.2956, 0.0049, 2, 0.36, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if save:\n self.instance.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L122_C12", "label": "save()", "type": "expression", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L121_C8", "vector": [8, 3, 0.2968, 0.0024, 3, 0.72, 0.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " self.instance.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L123_C4", "label": "delete.alters_data =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.2993, 0.0024, 1, 0.29, 0.8333, 393, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "delete.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " delete.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4", "label": "_get_closed", "type": "function", "loc": [125, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.3066, 0.0073, 1, 0.29, 0.875, 324, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_closed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_closed(self):\n file = getattr(self, '_file', None)\n return file is None or file.closed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L126_C8", "label": "file = getattr()", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4", "vector": [14, 2, 0.3066, 0.0024, 2, 0.45, 0.0, 107, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " file = getattr(self, '_file', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4", "vector": [13, 2, 0.309, 0.0024, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return file is None or file.closed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L128_C4", "label": "closed = property()", "type": "assigned_variable", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [14, 1, 0.3114, 0.0024, 1, 0.29, 0.9167, 883, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "closed", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " closed = property(_get_closed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4", "label": "close", "type": "function", "loc": [130, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.32, 0.0097, 1, 0.29, 0.9583, 77, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n file = getattr(self, '_file', None)\n if file is not None:\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L131_C8", "label": "file = getattr()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4", "vector": [14, 2, 0.3187, 0.0024, 2, 0.62, 0.0, 107, 3, 3, 0, 0, 121, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " file = getattr(self, '_file', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L132_C8", "label": "if", "type": "if", "loc": [132, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4", "vector": [4, 2, 0.3224, 0.0049, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file is not None:\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L133_C12", "label": "close()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L132_C8", "vector": [8, 3, 0.3236, 0.0024, 3, 0.58, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L135_C4", "label": "__getstate__", "type": "function", "loc": [135, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "vector": [2, 1, 0.3345, 0.0146, 1, 0.29, 1.0, 250, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__getstate__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getstate__(self):\n # FieldFile needs access to its associated model field and an instance\n # it's attached to in order to work properly, but the only necessary\n # data to be pickled is the file's name itself. Everything else will\n # be restored later, by FileDescriptor below.\n return {'name': self.name, 'closed': False, '_committed': True, '_file': None}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L135_C4", "vector": [13, 2, 0.3406, 0.0024, 2, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'name': self.name, 'closed': False, '_committed': True, '_file': None}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "label": "FileDescriptor", "type": "class", "loc": [142, 210], "level": 0, "parent": null, "vector": [3, 0, 0.4282, 0.1679, 0, 0.66, 0.8, 681, 0, 3, 0, 0, 186, 0, 8], "semantic": {"name": "FileDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileDescriptor(object):\n \"\"\"\n The descriptor for the file attribute on the model instance. Returns a\n FieldFile when accessed so you can do stuff like::\n\n >>> instance.file.size\n\n Assigns a file object on assignment so you can do::"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L143_C4", "label": "expression", "type": "expression", "loc": [143, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "vector": [8, 1, 0.3601, 0.0268, 1, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n The descriptor for the file attribute on the model instance. Returns a\n FieldFile when accessed so you can do stuff like::\n\n >>> instance.file.size\n\n Assigns a file object on assignment so you can do::\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L154_C4", "label": "__init__", "type": "function", "loc": [154, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "vector": [2, 1, 0.3759, 0.0049, 1, 0.11, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, field):\n self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L155_C8", "label": "self.field =", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L154_C4", "vector": [14, 2, 0.3771, 0.0024, 2, 0.95, 0.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "label": "__get__", "type": "function", "loc": [157, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "vector": [2, 1, 0.4428, 0.1241, 1, 0.11, 0.6667, 93, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "owner"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance=None, owner=None):\n if instance is None:\n raise AttributeError(\n \"The '%s' attribute can only be accessed from %s instances.\"\n % (self.field.name, owner.__name__))\n\n # This is slightly complicated, so worth an explanation.\n # instance.file`needs to ultimately return some instance of `File`,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L158_C8", "label": "if", "type": "if", "loc": [158, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "vector": [4, 2, 0.3881, 0.0097, 2, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\n \"The '%s' attribute can only be accessed from %s instances.\"\n % (self.field.name, owner.__name__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L175_C8", "label": "file =", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "vector": [14, 2, 0.4258, 0.0024, 2, 0.74, 0.3333, 107, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file = instance.__dict__[self.field.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "label": "if", "type": "if", "loc": [184, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "vector": [4, 2, 0.472, 0.0511, 2, 0.74, 0.6667, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(file, basestring) or file is None:\n attr = self.field.attr_class(instance, self.field, file)\n instance.__dict__[self.field.name] = attr\n\n # Other types of files may be assigned as well, but they need to have\n # the FieldFile interface added to the. Thus, we wrap any other type of\n # File inside a FieldFile (well, the field's attr_class, which is\n # usually FieldFile)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L185_C12", "label": "attr = attr_class()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "vector": [14, 3, 0.4501, 0.0024, 3, 0.32, 0.0, 400, 3, 3, 0, 0, 673, 10, 1], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "attr_class", "annotation": ""}, "snippet": " attr = self.field.attr_class(instance, self.field, file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L186_C12", "label": "assign", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "vector": [14, 3, 0.4526, 0.0024, 3, 0.32, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " instance.__dict__[self.field.name] = attr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "label": "if", "type": "if", "loc": [192, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "vector": [4, 3, 0.4818, 0.0316, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(file, File) and not isinstance(file, FieldFile):\n file_copy = self.field.attr_class(instance, self.field, file.name)\n file_copy.file = file\n file_copy._committed = False\n instance.__dict__[self.field.name] = file_copy\n\n # Finally, because of the (some would say boneheaded) way pickle works,\n # the underlying FieldFile might not actually itself have an associated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L193_C12", "label": "file_copy = attr_class()", "type": "assigned_variable", "loc": [193, 193], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "vector": [14, 4, 0.4696, 0.0024, 4, 0.39, 0.0, 228, 3, 3, 0, 0, 673, 10, 1], "semantic": {"name": "file_copy", "arg_names": [], "import_names": [], "rhs_call_name": "attr_class", "annotation": ""}, "snippet": " file_copy = self.field.attr_class(instance, self.field, file.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L194_C12", "label": "file_copy.file =", "type": "assigned_variable", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "vector": [14, 4, 0.472, 0.0024, 4, 0.39, 0.25, 967, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file_copy.file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file_copy.file = file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L195_C12", "label": "file_copy._committed =", "type": "assigned_variable", "loc": [195, 195], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "vector": [14, 4, 0.4745, 0.0024, 4, 0.39, 0.5, 39, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "file_copy._committed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file_copy._committed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L196_C12", "label": "assign", "type": "assigned_variable", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "vector": [14, 4, 0.4769, 0.0024, 4, 0.39, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " instance.__dict__[self.field.name] = file_copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "label": "if", "type": "if", "loc": [201, 204], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "vector": [4, 4, 0.4927, 0.0097, 4, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(file, FieldFile) and not hasattr(file, 'field'):\n file.instance = instance\n file.field = self.field\n file.storage = self.field.storage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L202_C12", "label": "file.instance =", "type": "assigned_variable", "loc": [202, 202], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "vector": [14, 5, 0.4915, 0.0024, 5, 0.6, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file.instance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file.instance = instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L203_C12", "label": "file.field =", "type": "assigned_variable", "loc": [203, 203], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "vector": [14, 5, 0.4939, 0.0024, 5, 0.6, 0.5, 952, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file.field = self.field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L204_C12", "label": "file.storage =", "type": "assigned_variable", "loc": [204, 204], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "vector": [14, 5, 0.4964, 0.0024, 5, 0.6, 1.0, 678, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "file.storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " file.storage = self.field.storage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L207_C8", "label": "return", "type": "return", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "vector": [13, 2, 0.5036, 0.0024, 2, 0.74, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return instance.__dict__[self.field.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L209_C4", "label": "__set__", "type": "function", "loc": [209, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "vector": [2, 1, 0.5097, 0.0049, 1, 0.11, 1.0, 145, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n instance.__dict__[self.field.name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L210_C8", "label": "assign", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L209_C4", "vector": [14, 2, 0.5109, 0.0024, 2, 0.95, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " instance.__dict__[self.field.name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "label": "FileField", "type": "class", "loc": [212, 306], "level": 0, "parent": null, "vector": [3, 0, 0.6302, 0.2311, 0, 0.66, 0.85, 240, 0, 12, 0, 0, 949, 0, 37], "semantic": {"name": "FileField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileField(Field):\n # The class to wrap instance attributes in. Accessing the file object off\n # the instance will always return an instance of attr_class.\n attr_class = FieldFile\n\n # The descriptor to use for accessing the attribute off of the class.\n descriptor_class = FileDescriptor\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L215_C4", "label": "attr_class =", "type": "assigned_variable", "loc": [215, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [14, 1, 0.5231, 0.0024, 1, 0.8, 0.0, 673, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "attr_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attr_class = FieldFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L218_C4", "label": "descriptor_class =", "type": "assigned_variable", "loc": [218, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [14, 1, 0.5304, 0.0024, 1, 0.8, 0.0714, 897, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "descriptor_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " descriptor_class = FileDescriptor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L220_C4", "label": "description = ugettext_lazy()", "type": "assigned_variable", "loc": [220, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [14, 1, 0.5353, 0.0024, 1, 0.8, 0.1429, 306, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "ugettext_lazy", "annotation": ""}, "snippet": " description = ugettext_lazy(\"File path\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "label": "__init__", "type": "function", "loc": [222, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.5535, 0.0292, 1, 0.8, 0.2143, 555, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "verbose_name", "name", "upload_to", "storage", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, **kwargs):\n for arg in ('primary_key', 'unique'):\n if arg in kwargs:\n raise TypeError(\"'%s' is not a valid argument for %s.\" % (arg, self.__class__))\n\n self.storage = storage or default_storage\n self.upload_to = upload_to\n if callable(upload_to):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:For_L223_C8", "label": "for arg", "type": "for", "loc": [223, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [6, 2, 0.545, 0.0073, 2, 0.03, 0.0, 447, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in ('primary_key', 'unique'):\n if arg in kwargs:\n raise TypeError(\"'%s' is not a valid argument for %s.\" % (arg, self.__class__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L224_C12", "label": "if", "type": "if", "loc": [224, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:For_L223_C8", "vector": [4, 3, 0.5462, 0.0049, 3, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arg in kwargs:\n raise TypeError(\"'%s' is not a valid argument for %s.\" % (arg, self.__class__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L227_C8", "label": "self.storage =", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [14, 2, 0.5523, 0.0024, 2, 0.03, 0.2, 956, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.storage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.storage = storage or default_storage"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L228_C8", "label": "self.upload_to =", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [14, 2, 0.5547, 0.0024, 2, 0.03, 0.4, 143, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.upload_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.upload_to = upload_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L229_C8", "label": "if", "type": "if", "loc": [229, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [4, 2, 0.5584, 0.0049, 2, 0.03, 0.6, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if callable(upload_to):\n self.generate_filename = upload_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L230_C12", "label": "self.generate_filename =", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L229_C8", "vector": [14, 3, 0.5596, 0.0024, 3, 0.03, 0.0, 141, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.generate_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.generate_filename = upload_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L232_C8", "label": " = get()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [14, 2, 0.5645, 0.0024, 2, 0.03, 0.8, 0, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " kwargs['max_length'] = kwargs.get('max_length', 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L233_C8", "label": "__init__()", "type": "expression", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "vector": [8, 2, 0.5669, 0.0024, 2, 0.03, 1.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(FileField, self).__init__(verbose_name, name, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L235_C4", "label": "get_internal_type", "type": "function", "loc": [235, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.573, 0.0049, 1, 0.8, 0.2857, 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 \"FileField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L236_C8", "label": "return", "type": "return", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L235_C4", "vector": [13, 2, 0.5742, 0.0024, 2, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"FileField\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4", "label": "get_prep_lookup", "type": "function", "loc": [238, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.5827, 0.0097, 1, 0.8, 0.3571, 384, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_prep_lookup", "arg_names": ["self", "lookup_type", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_prep_lookup(self, lookup_type, value):\n if hasattr(value, 'name'):\n value = value.name\n return super(FileField, self).get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L239_C8", "label": "if", "type": "if", "loc": [239, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4", "vector": [4, 2, 0.5827, 0.0049, 2, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'name'):\n value = value.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L240_C12", "label": "value =", "type": "assigned_variable", "loc": [240, 240], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L239_C8", "vector": [14, 3, 0.5839, 0.0024, 3, 0.44, 0.0, 441, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = value.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L241_C8", "label": "return", "type": "return", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4", "vector": [13, 2, 0.5864, 0.0024, 2, 0.69, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(FileField, self).get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "label": "get_prep_value", "type": "function", "loc": [243, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.5973, 0.0146, 1, 0.8, 0.4286, 109, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_prep_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_prep_value(self, value):\n \"Returns field's value prepared for saving into a database.\"\n # Need to convert File objects provided via a form to unicode for database insertion\n if value is None:\n return None\n return unicode(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L244_C8", "label": "expression", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "vector": [8, 2, 0.5937, 0.0024, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns field's value prepared for saving into a database.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L246_C8", "label": "if", "type": "if", "loc": [246, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "vector": [4, 2, 0.5998, 0.0049, 2, 0.21, 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_99019:Return_L247_C12", "label": "return", "type": "return", "loc": [247, 247], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L246_C8", "vector": [13, 3, 0.601, 0.0024, 3, 0.78, 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_99019:Return_L248_C8", "label": "return", "type": "return", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "vector": [13, 2, 0.6034, 0.0024, 2, 0.21, 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_99019:FunctionDef_L250_C4", "label": "pre_save", "type": "function", "loc": [250, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6156, 0.017, 1, 0.8, 0.5, 751, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "pre_save", "arg_names": ["self", "model_instance", "add"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pre_save(self, model_instance, add):\n \"Returns field's value just before saving.\"\n file = super(FileField, self).pre_save(model_instance, add)\n if file and not file._committed:\n # Commit the file to storage prior to saving the model\n file.save(file.name, file, save=False)\n return file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L251_C8", "label": "expression", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "vector": [8, 2, 0.6107, 0.0024, 2, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns field's value just before saving.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L252_C8", "label": "file = pre_save()", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "vector": [14, 2, 0.6131, 0.0024, 2, 0.42, 0.3333, 107, 3, 2, 0, 0, 751, 10, 2], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "pre_save", "annotation": ""}, "snippet": " file = super(FileField, self).pre_save(model_instance, add)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L253_C8", "label": "if", "type": "if", "loc": [253, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "vector": [4, 2, 0.618, 0.0073, 2, 0.42, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file and not file._committed:\n # Commit the file to storage prior to saving the model\n file.save(file.name, file, save=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L255_C12", "label": "save()", "type": "expression", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L253_C8", "vector": [8, 3, 0.6204, 0.0024, 3, 0.9, 0.0, 928, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " file.save(file.name, file, save=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L256_C8", "label": "return", "type": "return", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "vector": [13, 2, 0.6229, 0.0024, 2, 0.42, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "label": "contribute_to_class", "type": "function", "loc": [258, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6314, 0.0097, 1, 0.8, 0.5714, 973, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n super(FileField, self).contribute_to_class(cls, name)\n setattr(cls, self.name, self.descriptor_class(self))\n signals.post_delete.connect(self.delete_file, sender=cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L259_C8", "label": "contribute_to_class()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "vector": [8, 2, 0.6302, 0.0024, 2, 0.74, 0.0, 973, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " super(FileField, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L260_C8", "label": "setattr()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "vector": [8, 2, 0.6326, 0.0024, 2, 0.74, 0.5, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, self.name, self.descriptor_class(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L261_C8", "label": "connect()", "type": "expression", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "vector": [8, 2, 0.635, 0.0024, 2, 0.74, 1.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " signals.post_delete.connect(self.delete_file, sender=cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4", "label": "delete_file", "type": "function", "loc": [263, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6521, 0.0268, 1, 0.8, 0.6429, 253, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "delete_file", "arg_names": ["self", "instance", "sender", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_file(self, instance, sender, **kwargs):\n file = getattr(instance, self.attname)\n # If no other object of this type references the file,\n # and it's not the default value for future objects,\n # delete it from the backend.\n if file and file.name != self.default and \\\n not sender._default_manager.filter(**{self.name: file.name}):\n file.delete(save=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L264_C8", "label": "file = getattr()", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4", "vector": [14, 2, 0.6423, 0.0024, 2, 0.1, 0.0, 107, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " file = getattr(instance, self.attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8", "label": "if", "type": "if", "loc": [268, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4", "vector": [4, 2, 0.6582, 0.0146, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file and file.name != self.default and \\\n not sender._default_manager.filter(**{self.name: file.name}):\n file.delete(save=False)\n elif file:\n # Otherwise, just close the file, so it doesn't tie up resources.\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L270_C16", "label": "delete()", "type": "expression", "loc": [270, 270], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8", "vector": [8, 3, 0.6569, 0.0024, 3, 0.45, 0.0, 266, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " file.delete(save=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L271_C8", "label": "if", "type": "if", "loc": [271, 273], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8", "vector": [4, 3, 0.6618, 0.0073, 3, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif file:\n # Otherwise, just close the file, so it doesn't tie up resources.\n file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L273_C12", "label": "close()", "type": "expression", "loc": [273, 273], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L271_C8", "vector": [8, 4, 0.6642, 0.0024, 4, 0.54, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L275_C4", "label": "get_directory_name", "type": "function", "loc": [275, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6703, 0.0049, 1, 0.8, 0.7143, 145, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "get_directory_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_directory_name(self):\n return os.path.normpath(force_unicode(datetime.datetime.now().strftime(smart_str(self.upload_to))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L276_C8", "label": "return", "type": "return", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L275_C4", "vector": [13, 2, 0.6715, 0.0024, 2, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.normpath(force_unicode(datetime.datetime.now().strftime(smart_str(self.upload_to))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L278_C4", "label": "get_filename", "type": "function", "loc": [278, 279], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6776, 0.0049, 1, 0.8, 0.7857, 676, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_filename", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_filename(self, filename):\n return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L279_C8", "label": "return", "type": "return", "loc": [279, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L278_C4", "vector": [13, 2, 0.6788, 0.0024, 2, 0.38, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.normpath(self.storage.get_valid_name(os.path.basename(filename)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L281_C4", "label": "generate_filename", "type": "function", "loc": [281, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.6849, 0.0049, 1, 0.8, 0.8571, 441, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "generate_filename", "arg_names": ["self", "instance", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def generate_filename(self, instance, filename):\n return os.path.join(self.get_directory_name(), self.get_filename(filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L282_C8", "label": "return", "type": "return", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L281_C4", "vector": [13, 2, 0.6861, 0.0024, 2, 0.27, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return os.path.join(self.get_directory_name(), self.get_filename(filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L284_C4", "label": "save_form_data", "type": "function", "loc": [284, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.7032, 0.0268, 1, 0.8, 0.9286, 198, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "save_form_data", "arg_names": ["self", "instance", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_form_data(self, instance, data):\n # Important: None means \"no change\", other false value means \"clear\"\n # This subtle distinction (rather than a more explicit marker) is\n # needed because we need to consume values that are also sane for a\n # regular (non Model-) Form to find in its cleaned_data dictionary.\n if data is not None:\n # This value will be converted to unicode and stored in the\n # database, so leaving False as-is is not acceptable."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8", "label": "if", "type": "if", "loc": [289, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L284_C4", "vector": [4, 2, 0.7092, 0.0146, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is not None:\n # This value will be converted to unicode and stored in the\n # database, so leaving False as-is is not acceptable.\n if not data:\n data = ''\n setattr(instance, self.name, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L292_C12", "label": "if", "type": "if", "loc": [292, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8", "vector": [4, 3, 0.7117, 0.0049, 3, 0.59, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data:\n data = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L293_C16", "label": "data =", "type": "assigned_variable", "loc": [293, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L292_C12", "vector": [14, 4, 0.7129, 0.0024, 4, 0.75, 0.0, 929, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L294_C12", "label": "setattr()", "type": "expression", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8", "vector": [8, 3, 0.7153, 0.0024, 3, 0.59, 1.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.name, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "label": "formfield", "type": "function", "loc": [296, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "vector": [2, 1, 0.7324, 0.0268, 1, 0.8, 1.0, 732, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "formfield", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.FileField, 'max_length': self.max_length}\n # If a file has been provided previously, then the form doesn't require\n # that a new file is provided this time.\n # The code to mark the form field as not required is used by\n # form_for_instance, but can probably be removed once form_for_instance\n # is gone. ModelForm uses a different method to check for an existing file.\n if 'initial' in kwargs:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L297_C8", "label": "defaults =", "type": "assigned_variable", "loc": [297, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "vector": [14, 2, 0.7226, 0.0024, 2, 0.75, 0.0, 233, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {'form_class': forms.FileField, 'max_length': self.max_length}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L303_C8", "label": "if", "type": "if", "loc": [303, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "vector": [4, 2, 0.7384, 0.0049, 2, 0.75, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'initial' in kwargs:\n defaults['required'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L304_C12", "label": "assign", "type": "assigned_variable", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L303_C8", "vector": [14, 3, 0.7397, 0.0024, 3, 0.42, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults['required'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L305_C8", "label": "update()", "type": "expression", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "vector": [8, 2, 0.7421, 0.0024, 2, 0.75, 0.6667, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " defaults.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L306_C8", "label": "return", "type": "return", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "vector": [13, 2, 0.7445, 0.0024, 2, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(FileField, self).formfield(**defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L308_C0", "label": "ImageFileDescriptor", "type": "class", "loc": [308, 327], "level": 0, "parent": null, "vector": [3, 0, 0.7725, 0.0487, 0, 0.66, 0.9, 93, 0, 1, 0, 0, 681, 0, 4], "semantic": {"name": "ImageFileDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ImageFileDescriptor(FileDescriptor):\n \"\"\"\n Just like the FileDescriptor, but for ImageFields. The only difference is\n assigning the width/height to the width_field/height_field, if appropriate.\n \"\"\"\n def __set__(self, instance, value):\n previous_file = instance.__dict__.get(self.field.name)\n super(ImageFileDescriptor, self).__set__(instance, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L309_C4", "label": "expression", "type": "expression", "loc": [309, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L308_C0", "vector": [8, 1, 0.7555, 0.0097, 1, 0.23, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Just like the FileDescriptor, but for ImageFields. The only difference is\n assigning the width/height to the width_field/height_field, if appropriate.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "label": "__set__", "type": "function", "loc": [313, 327], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L308_C0", "vector": [2, 1, 0.7786, 0.0365, 1, 0.23, 1.0, 145, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n previous_file = instance.__dict__.get(self.field.name)\n super(ImageFileDescriptor, self).__set__(instance, value)\n\n # To prevent recalculating image dimensions when we are instantiating\n # an object from the database (bug #11084), only update dimensions if\n # the field had a value before this assignment. Since the default\n # value for FileField subclasses is an instance of field.attr_class,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L314_C8", "label": "previous_file = get()", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "vector": [14, 2, 0.764, 0.0024, 2, 0.74, 0.0, 615, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "previous_file", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " previous_file = instance.__dict__.get(self.field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L315_C8", "label": "__set__()", "type": "expression", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "vector": [8, 2, 0.7664, 0.0024, 2, 0.74, 0.5, 145, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__set__", "arg_names": [], "import_names": [], "rhs_call_name": "__set__", "annotation": ""}, "snippet": " super(ImageFileDescriptor, self).__set__(instance, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L326_C8", "label": "if", "type": "if", "loc": [326, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "vector": [4, 2, 0.7944, 0.0049, 2, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if previous_file is not None:\n self.field.update_dimension_fields(instance, force=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L327_C12", "label": "update_dimension_fields()", "type": "expression", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L326_C8", "vector": [8, 3, 0.7956, 0.0024, 3, 0.61, 0.0, 498, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_dimension_fields", "arg_names": [], "import_names": [], "rhs_call_name": "update_dimension_fields", "annotation": ""}, "snippet": " self.field.update_dimension_fields(instance, force=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L329_C0", "label": "ImageFieldFile", "type": "class", "loc": [329, 334], "level": 0, "parent": null, "vector": [3, 0, 0.8066, 0.0146, 0, 0.66, 0.95, 546, 0, 1, 0, 0, 236, 0, 3], "semantic": {"name": "ImageFieldFile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ImageFieldFile(ImageFile, FieldFile):\n def delete(self, save=True):\n # Clear the image dimensions cache\n if hasattr(self, '_dimensions_cache'):\n del self._dimensions_cache\n super(ImageFieldFile, self).delete(save)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4", "label": "delete", "type": "function", "loc": [330, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L329_C0", "vector": [2, 1, 0.8078, 0.0122, 1, 0.22, 0.0, 266, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "delete", "arg_names": ["self", "save"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete(self, save=True):\n # Clear the image dimensions cache\n if hasattr(self, '_dimensions_cache'):\n del self._dimensions_cache\n super(ImageFieldFile, self).delete(save)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L332_C8", "label": "if", "type": "if", "loc": [332, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4", "vector": [4, 2, 0.809, 0.0049, 2, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_dimensions_cache'):\n del self._dimensions_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L334_C8", "label": "delete()", "type": "expression", "loc": [334, 334], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4", "vector": [8, 2, 0.8127, 0.0024, 2, 0.45, 1.0, 266, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " super(ImageFieldFile, self).delete(save)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "label": "ImageField", "type": "class", "loc": [336, 411], "level": 0, "parent": null, "vector": [3, 0, 0.9088, 0.1849, 0, 0.66, 1.0, 220, 0, 4, 0, 0, 240, 0, 13], "semantic": {"name": "ImageField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ImageField(FileField):\n attr_class = ImageFieldFile\n descriptor_class = ImageFileDescriptor\n description = ugettext_lazy(\"File path\")\n\n def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):\n self.width_field, self.height_field = width_field, height_field\n FileField.__init__(self, verbose_name, name, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L337_C4", "label": "attr_class =", "type": "assigned_variable", "loc": [337, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [14, 1, 0.82, 0.0024, 1, 0.3, 0.0, 673, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "attr_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attr_class = ImageFieldFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L338_C4", "label": "descriptor_class =", "type": "assigned_variable", "loc": [338, 338], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [14, 1, 0.8224, 0.0024, 1, 0.3, 0.1667, 897, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "descriptor_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " descriptor_class = ImageFileDescriptor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L339_C4", "label": "description = ugettext_lazy()", "type": "assigned_variable", "loc": [339, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [14, 1, 0.8248, 0.0024, 1, 0.3, 0.3333, 306, 3, 1, 0, 0, 532, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "ugettext_lazy", "annotation": ""}, "snippet": " description = ugettext_lazy(\"File path\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4", "label": "__init__", "type": "function", "loc": [341, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [2, 1, 0.8321, 0.0073, 1, 0.3, 0.5, 555, 0, 6, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "verbose_name", "name", "width_field", "height_field", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, verbose_name=None, name=None, width_field=None, height_field=None, **kwargs):\n self.width_field, self.height_field = width_field, height_field\n FileField.__init__(self, verbose_name, name, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L342_C8", "label": "assign", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4", "vector": [14, 2, 0.8321, 0.0024, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.width_field, self.height_field = width_field, height_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L343_C8", "label": "__init__()", "type": "expression", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4", "vector": [8, 2, 0.8345, 0.0024, 2, 0.84, 1.0, 555, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " FileField.__init__(self, verbose_name, name, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4", "label": "contribute_to_class", "type": "function", "loc": [345, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [2, 1, 0.8455, 0.0146, 1, 0.3, 0.6667, 973, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n super(ImageField, self).contribute_to_class(cls, name)\n # Attach update_dimension_fields so that dimension fields declared\n # after their corresponding image field don't stay cleared by\n # Model.__init__, see bug #11196.\n signals.post_init.connect(self.update_dimension_fields, sender=cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L346_C8", "label": "contribute_to_class()", "type": "expression", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4", "vector": [8, 2, 0.8418, 0.0024, 2, 0.87, 0.0, 973, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " super(ImageField, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L350_C8", "label": "connect()", "type": "expression", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4", "vector": [8, 2, 0.8516, 0.0024, 2, 0.87, 1.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " signals.post_init.connect(self.update_dimension_fields, sender=cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "label": "update_dimension_fields", "type": "function", "loc": [352, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [2, 1, 0.9221, 0.1338, 1, 0.3, 0.8333, 498, 0, 5, 0, 0, 0, 0, 5], "semantic": {"name": "update_dimension_fields", "arg_names": ["self", "instance", "force", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update_dimension_fields(self, instance, force=False, *args, **kwargs):\n \"\"\"\n Updates field's width and height fields, if defined.\n\n This method is hooked up to model's post_init signal to update\n dimensions after instantiating a model instance. However, dimensions\n won't be updated if the dimensions fields are already populated. This\n avoids unnecessary recalculation when loading an object from the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L353_C8", "label": "expression", "type": "expression", "loc": [353, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [8, 2, 0.8723, 0.0292, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Updates field's width and height fields, if defined.\n\n This method is hooked up to model's post_init signal to update\n dimensions after instantiating a model instance. However, dimensions\n won't be updated if the dimensions fields are already populated. This\n avoids unnecessary recalculation when loading an object from the\n database."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L366_C8", "label": "has_dimension_fields =", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [14, 2, 0.8905, 0.0024, 2, 0.77, 0.1111, 795, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "has_dimension_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " has_dimension_fields = self.width_field or self.height_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L367_C8", "label": "if", "type": "if", "loc": [367, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.8942, 0.0049, 2, 0.77, 0.2222, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not has_dimension_fields:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L368_C12", "label": "return", "type": "return", "loc": [368, 368], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L367_C8", "vector": [13, 3, 0.8954, 0.0024, 3, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L373_C8", "label": "file = getattr()", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [14, 2, 0.9075, 0.0024, 2, 0.77, 0.3333, 107, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "file", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " file = getattr(instance, self.attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L376_C8", "label": "if", "type": "if", "loc": [376, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.9161, 0.0049, 2, 0.77, 0.4444, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not file and not force:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L377_C12", "label": "return", "type": "return", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L376_C8", "vector": [13, 3, 0.9173, 0.0024, 3, 0.69, 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_99019:Assign_L379_C8", "label": "dimension_fields_filled =", "type": "assigned_variable", "loc": [379, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [14, 2, 0.9258, 0.0097, 2, 0.77, 0.5556, 173, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dimension_fields_filled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dimension_fields_filled = not(\n (self.width_field and not getattr(instance, self.width_field))\n or (self.height_field and not getattr(instance, self.height_field))\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L390_C8", "label": "if", "type": "if", "loc": [390, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.9501, 0.0049, 2, 0.77, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dimension_fields_filled and not force:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L391_C12", "label": "return", "type": "return", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L390_C8", "vector": [13, 3, 0.9513, 0.0024, 3, 0.2, 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_99019:If_L394_C8", "label": "if", "type": "if", "loc": [394, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.9659, 0.017, 2, 0.77, 0.7778, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if file:\n width = file.width\n height = file.height\n else:\n # No file, so clear dimensions fields.\n width = None\n height = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L395_C12", "label": "width =", "type": "assigned_variable", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "vector": [14, 3, 0.9611, 0.0024, 3, 0.21, 0.0, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = file.width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L396_C12", "label": "height =", "type": "assigned_variable", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "vector": [14, 3, 0.9635, 0.0024, 3, 0.21, 0.3333, 751, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = file.height"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L399_C12", "label": "width =", "type": "assigned_variable", "loc": [399, 399], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "vector": [14, 3, 0.9708, 0.0024, 3, 0.21, 0.6667, 989, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " width = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L400_C12", "label": "height =", "type": "assigned_variable", "loc": [400, 400], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "vector": [14, 3, 0.9732, 0.0024, 3, 0.21, 1.0, 751, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "height", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " height = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L403_C8", "label": "if", "type": "if", "loc": [403, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.9818, 0.0049, 2, 0.77, 0.8889, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.width_field:\n setattr(instance, self.width_field, width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L404_C12", "label": "setattr()", "type": "expression", "loc": [404, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L403_C8", "vector": [8, 3, 0.983, 0.0024, 3, 0.39, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.width_field, width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L405_C8", "label": "if", "type": "if", "loc": [405, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "vector": [4, 2, 0.9866, 0.0049, 2, 0.77, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.height_field:\n setattr(instance, self.height_field, height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L406_C12", "label": "setattr()", "type": "expression", "loc": [406, 406], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L405_C8", "vector": [8, 3, 0.9878, 0.0024, 3, 0.93, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.height_field, height)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "label": "formfield", "type": "function", "loc": [408, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "vector": [2, 1, 0.9964, 0.0097, 1, 0.3, 1.0, 732, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "formfield", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formfield(self, **kwargs):\n defaults = {'form_class': forms.ImageField}\n defaults.update(kwargs)\n return super(ImageField, self).formfield(**defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L409_C8", "label": "defaults =", "type": "assigned_variable", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "vector": [14, 2, 0.9951, 0.0024, 2, 0.58, 0.0, 233, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {'form_class': forms.ImageField}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L410_C8", "label": "update()", "type": "expression", "loc": [410, 410], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "vector": [8, 2, 0.9976, 0.0024, 2, 0.58, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " defaults.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L411_C8", "label": "return", "type": "return", "loc": [411, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "vector": [13, 2, 1.0, 0.0024, 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(ImageField, self).formfield(**defaults)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L192_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L142_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L218_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:For_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:For_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L229_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L235_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L239_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L240_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L246_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L247_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L270_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L268_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L273_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L278_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L292_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L293_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L289_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L294_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L212_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L303_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L296_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L313_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L329_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L330_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L339_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L367_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L368_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L376_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L396_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L399_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L400_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L403_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L404_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:If_L405_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L406_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:ClassDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Assign_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Expr_L410_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99019:FunctionDef_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99019:Return_L411_C8"}] |
"""
Field-like classes that aren't really fields. It's easier to use objects that
have the same attributes as fields sometimes (avoids a lot of special casing).
"""
from django.db.models import fields
class OrderWrt(fields.IntegerField):
"""
A proxy for the _order database field that is used when
Meta.order_with_respect_to is specified.
"""
def __init__(self, *args, **kwargs):
kwargs['name'] = '_order'
kwargs['editable'] = False
super(OrderWrt, self).__init__(*args, **kwargs)
| ajibawa-2023/Python-Code-Large/train/row_99020 | 8 | 17 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99020:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 4], "level": 0, "parent": null, "vector": [8, 0, 0.1471, 0.2353, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nField-like classes that aren't really fields. It's easier to use objects that\nhave the same attributes as fields sometimes (avoids a lot of special casing).\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:ImportFrom_L6_C0", "label": "from django.db.models import fields", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0588, 0, 0.66, 0.5, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["fields"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:ClassDef_L8_C0", "label": "OrderWrt", "type": "class", "loc": [8, 17], "level": 0, "parent": null, "vector": [3, 0, 0.7353, 0.5882, 0, 0.66, 1.0, 754, 0, 1, 0, 0, 163, 0, 2], "semantic": {"name": "OrderWrt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OrderWrt(fields.IntegerField):\n \"\"\"\n A proxy for the _order database field that is used when\n Meta.order_with_respect_to is specified.\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n kwargs['name'] = '_order'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:Expr_L9_C4", "label": "expression", "type": "expression", "loc": [9, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99020:ClassDef_L8_C0", "vector": [8, 1, 0.6176, 0.2353, 1, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A proxy for the _order database field that is used when\n Meta.order_with_respect_to is specified.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "label": "__init__", "type": "function", "loc": [14, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99020:ClassDef_L8_C0", "vector": [2, 1, 0.9118, 0.2353, 1, 0.13, 1.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n kwargs['name'] = '_order'\n kwargs['editable'] = False\n super(OrderWrt, self).__init__(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:Assign_L15_C8", "label": "assign", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "vector": [14, 2, 0.8824, 0.0588, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['name'] = '_order'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:Assign_L16_C8", "label": "assign", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "vector": [14, 2, 0.9412, 0.0588, 2, 0.36, 0.5, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['editable'] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99020:Expr_L17_C8", "label": "__init__()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "vector": [8, 2, 1.0, 0.0588, 2, 0.36, 1.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(OrderWrt, self).__init__(*args, **kwargs)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99020:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99020:Expr_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99020:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99020:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99020:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99020:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99020:Expr_L17_C8"}] |
from django.conf import settings
from django.db import connection, router, transaction, connections
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from django.db.models.related import RelatedObject
from django.db.models.query import QuerySet
from django.db.models.query_utils import QueryWrapper
from django.db.models.deletion import CASCADE
from django.utils.encoding import smart_unicode
from django.utils.translation import (ugettext_lazy as _, string_concat,
ungettext, ugettext)
from django.utils.functional import curry
from django.core import exceptions
from django import forms
RECURSIVE_RELATIONSHIP_CONSTANT = 'self'
pending_lookups = {}
def add_lazy_relation(cls, field, relation, operation):
"""
Adds a lookup on ``cls`` when a related field is defined using a string,
i.e.::
class MyModel(Model):
fk = ForeignKey("AnotherModel")
This string can be:
* RECURSIVE_RELATIONSHIP_CONSTANT (i.e. "self") to indicate a recursive
relation.
* The name of a model (i.e "AnotherModel") to indicate another model in
the same app.
* An app-label and model name (i.e. "someapp.AnotherModel") to indicate
another model in a different app.
If the other model hasn't yet been loaded -- almost a given if you're using
lazy relationships -- then the relation won't be set up until the
class_prepared signal fires at the end of model initialization.
operation is the work that must be performed once the relation can be resolved.
"""
# Check for recursive relations
if relation == RECURSIVE_RELATIONSHIP_CONSTANT:
app_label = cls._meta.app_label
model_name = cls.__name__
else:
# Look for an "app.Model" relation
try:
app_label, model_name = relation.split(".")
except ValueError:
# If we can't split, assume a model in current app
app_label = cls._meta.app_label
model_name = relation
except AttributeError:
# If it doesn't have a split it's actually a model class
app_label = relation._meta.app_label
model_name = relation._meta.object_name
# Try to look up the related model, and if it's already loaded resolve the
# string right away. If get_model returns None, it means that the related
# model isn't loaded yet, so we need to pend the relation until the class
# is prepared.
model = get_model(app_label, model_name, False)
if model:
operation(field, model, cls)
else:
key = (app_label, model_name)
value = (cls, field, operation)
pending_lookups.setdefault(key, []).append(value)
def do_pending_lookups(sender, **kwargs):
"""
Handle any pending relations to the sending model. Sent from class_prepared.
"""
key = (sender._meta.app_label, sender.__name__)
for cls, field, operation in pending_lookups.pop(key, []):
operation(field, sender, cls)
signals.class_prepared.connect(do_pending_lookups)
#HACK
class RelatedField(object):
def contribute_to_class(self, cls, name):
sup = super(RelatedField, self)
# Store the opts for related_query_name()
self.opts = cls._meta
if hasattr(sup, 'contribute_to_class'):
sup.contribute_to_class(cls, name)
if not cls._meta.abstract and self.rel.related_name:
self.rel.related_name = self.rel.related_name % {
'class': cls.__name__.lower(),
'app_label': cls._meta.app_label.lower(),
}
other = self.rel.to
if isinstance(other, basestring) or other._meta.pk is None:
def resolve_related_class(field, model, cls):
field.rel.to = model
field.do_related_class(model, cls)
add_lazy_relation(cls, self, other, resolve_related_class)
else:
self.do_related_class(other, cls)
def set_attributes_from_rel(self):
self.name = self.name or (self.rel.to._meta.object_name.lower() + '_' + self.rel.to._meta.pk.name)
if self.verbose_name is None:
self.verbose_name = self.rel.to._meta.verbose_name
self.rel.field_name = self.rel.field_name or self.rel.to._meta.pk.name
def do_related_class(self, other, cls):
self.set_attributes_from_rel()
self.related = RelatedObject(other, cls, self)
if not cls._meta.abstract:
self.contribute_to_related_class(other, self.related)
def get_prep_lookup(self, lookup_type, value):
if hasattr(value, 'prepare'):
return value.prepare()
if hasattr(value, '_prepare'):
return value._prepare()
# FIXME: lt and gt are explicitly allowed to make
# get_(next/prev)_by_date work; other lookups are not allowed since that
# gets messy pretty quick. This is a good candidate for some refactoring
# in the future.
if lookup_type in ['exact', 'gt', 'lt', 'gte', 'lte']:
return self._pk_trace(value, 'get_prep_lookup', lookup_type)
if lookup_type in ('range', 'in'):
return [self._pk_trace(v, 'get_prep_lookup', lookup_type) for v in value]
elif lookup_type == 'isnull':
return []
raise TypeError("Related Field has invalid lookup: %s" % lookup_type)
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
if not prepared:
value = self.get_prep_lookup(lookup_type, value)
if hasattr(value, 'get_compiler'):
value = value.get_compiler(connection=connection)
if hasattr(value, 'as_sql') or hasattr(value, '_as_sql'):
# If the value has a relabel_aliases method, it will need to
# be invoked before the final SQL is evaluated
if hasattr(value, 'relabel_aliases'):
return value
if hasattr(value, 'as_sql'):
sql, params = value.as_sql()
else:
sql, params = value._as_sql(connection=connection)
return QueryWrapper(('(%s)' % sql), params)
# FIXME: lt and gt are explicitly allowed to make
# get_(next/prev)_by_date work; other lookups are not allowed since that
# gets messy pretty quick. This is a good candidate for some refactoring
# in the future.
if lookup_type in ['exact', 'gt', 'lt', 'gte', 'lte']:
return [self._pk_trace(value, 'get_db_prep_lookup', lookup_type,
connection=connection, prepared=prepared)]
if lookup_type in ('range', 'in'):
return [self._pk_trace(v, 'get_db_prep_lookup', lookup_type,
connection=connection, prepared=prepared)
for v in value]
elif lookup_type == 'isnull':
return []
raise TypeError("Related Field has invalid lookup: %s" % lookup_type)
def _pk_trace(self, value, prep_func, lookup_type, **kwargs):
# Value may be a primary key, or an object held in a relation.
# If it is an object, then we need to get the primary key value for
# that object. In certain conditions (especially one-to-one relations),
# the primary key may itself be an object - so we need to keep drilling
# down until we hit a value that can be used for a comparison.
v = value
try:
while True:
v = getattr(v, v._meta.pk.name)
except AttributeError:
pass
except exceptions.ObjectDoesNotExist:
v = None
field = self
while field.rel:
if hasattr(field.rel, 'field_name'):
field = field.rel.to._meta.get_field(field.rel.field_name)
else:
field = field.rel.to._meta.pk
if lookup_type in ('range', 'in'):
v = [v]
v = getattr(field, prep_func)(lookup_type, v, **kwargs)
if isinstance(v, list):
v = v[0]
return v
def related_query_name(self):
# This method defines the name that can be used to identify this
# related object in a table-spanning query. It uses the lower-cased
# object_name by default, but this can be overridden with the
# "related_name" option.
return self.rel.related_name or self.opts.object_name.lower()
class SingleRelatedObjectDescriptor(object):
# This class provides the functionality that makes the related-object
# managers available as attributes on a model class, for fields that have
# a single "remote" value, on the class pointed to by a related field.
# In the example "place.restaurant", the restaurant attribute is a
# SingleRelatedObjectDescriptor instance.
def __init__(self, related):
self.related = related
self.cache_name = related.get_cache_name()
def __get__(self, instance, instance_type=None):
if instance is None:
return self
try:
return getattr(instance, self.cache_name)
except AttributeError:
params = {'%s__pk' % self.related.field.name: instance._get_pk_val()}
db = router.db_for_read(self.related.model, instance=instance)
rel_obj = self.related.model._base_manager.using(db).get(**params)
setattr(instance, self.cache_name, rel_obj)
return rel_obj
def __set__(self, instance, value):
if instance is None:
raise AttributeError("%s must be accessed via instance" % self.related.opts.object_name)
# The similarity of the code below to the code in
# ReverseSingleRelatedObjectDescriptor is annoying, but there's a bunch
# of small differences that would make a common base class convoluted.
# If null=True, we can assign null here, but otherwise the value needs
# to be an instance of the related class.
if value is None and self.related.field.null == False:
raise ValueError('Cannot assign None: "%s.%s" does not allow null values.' %
(instance._meta.object_name, self.related.get_accessor_name()))
elif value is not None and not isinstance(value, self.related.model):
raise ValueError('Cannot assign "%r": "%s.%s" must be a "%s" instance.' %
(value, instance._meta.object_name,
self.related.get_accessor_name(), self.related.opts.object_name))
elif value is not None:
if instance._state.db is None:
instance._state.db = router.db_for_write(instance.__class__, instance=value)
elif value._state.db is None:
value._state.db = router.db_for_write(value.__class__, instance=instance)
elif value._state.db is not None and instance._state.db is not None:
if not router.allow_relation(value, instance):
raise ValueError('Cannot assign "%r": instance is on database "%s", value is on database "%s"' %
(value, instance._state.db, value._state.db))
# Set the value of the related field to the value of the related object's related field
setattr(value, self.related.field.attname, getattr(instance, self.related.field.rel.get_related_field().attname))
# Since we already know what the related object is, seed the related
# object caches now, too. This avoids another db hit if you get the
# object you just set.
setattr(instance, self.cache_name, value)
setattr(value, self.related.field.get_cache_name(), instance)
class ReverseSingleRelatedObjectDescriptor(object):
# This class provides the functionality that makes the related-object
# managers available as attributes on a model class, for fields that have
# a single "remote" value, on the class that defines the related field.
# In the example "choice.poll", the poll attribute is a
# ReverseSingleRelatedObjectDescriptor instance.
def __init__(self, field_with_rel):
self.field = field_with_rel
def __get__(self, instance, instance_type=None):
if instance is None:
return self
cache_name = self.field.get_cache_name()
try:
return getattr(instance, cache_name)
except AttributeError:
val = getattr(instance, self.field.attname)
if val is None:
# If NULL is an allowed value, return it.
if self.field.null:
return None
raise self.field.rel.to.DoesNotExist
other_field = self.field.rel.get_related_field()
if other_field.rel:
params = {'%s__pk' % self.field.rel.field_name: val}
else:
params = {'%s__exact' % self.field.rel.field_name: val}
# If the related manager indicates that it should be used for
# related fields, respect that.
rel_mgr = self.field.rel.to._default_manager
db = router.db_for_read(self.field.rel.to, instance=instance)
if getattr(rel_mgr, 'use_for_related_fields', False):
rel_obj = rel_mgr.using(db).get(**params)
else:
rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
setattr(instance, cache_name, rel_obj)
return rel_obj
def __set__(self, instance, value):
if instance is None:
raise AttributeError("%s must be accessed via instance" % self._field.name)
# If null=True, we can assign null here, but otherwise the value needs
# to be an instance of the related class.
if value is None and self.field.null == False:
raise ValueError('Cannot assign None: "%s.%s" does not allow null values.' %
(instance._meta.object_name, self.field.name))
elif value is not None and not isinstance(value, self.field.rel.to):
raise ValueError('Cannot assign "%r": "%s.%s" must be a "%s" instance.' %
(value, instance._meta.object_name,
self.field.name, self.field.rel.to._meta.object_name))
elif value is not None:
if instance._state.db is None:
instance._state.db = router.db_for_write(instance.__class__, instance=value)
elif value._state.db is None:
value._state.db = router.db_for_write(value.__class__, instance=instance)
elif value._state.db is not None and instance._state.db is not None:
if not router.allow_relation(value, instance):
raise ValueError('Cannot assign "%r": instance is on database "%s", value is on database "%s"' %
(value, instance._state.db, value._state.db))
# If we're setting the value of a OneToOneField to None, we need to clear
# out the cache on any old related object. Otherwise, deleting the
# previously-related object will also cause this object to be deleted,
# which is wrong.
if value is None:
# Look up the previously-related object, which may still be available
# since we've not yet cleared out the related field.
# Use the cache directly, instead of the accessor; if we haven't
# populated the cache, then we don't care - we're only accessing
# the object to invalidate the accessor cache, so there's no
# need to populate the cache just to expire it again.
related = getattr(instance, self.field.get_cache_name(), None)
# If we've got an old related object, we need to clear out its
# cache. This cache also might not exist if the related object
# hasn't been accessed yet.
if related:
cache_name = self.field.related.get_cache_name()
try:
delattr(related, cache_name)
except AttributeError:
pass
# Set the value of the related field
try:
val = getattr(value, self.field.rel.get_related_field().attname)
except AttributeError:
val = None
setattr(instance, self.field.attname, val)
# Since we already know what the related object is, seed the related
# object cache now, too. This avoids another db hit if you get the
# object you just set.
setattr(instance, self.field.get_cache_name(), value)
class ForeignRelatedObjectsDescriptor(object):
# This class provides the functionality that makes the related-object
# managers available as attributes on a model class, for fields that have
# multiple "remote" values and have a ForeignKey pointed at them by
# some other model. In the example "poll.choice_set", the choice_set
# attribute is a ForeignRelatedObjectsDescriptor instance.
def __init__(self, related):
self.related = related # RelatedObject instance
def __get__(self, instance, instance_type=None):
if instance is None:
return self
return self.create_manager(instance,
self.related.model._default_manager.__class__)
def __set__(self, instance, value):
if instance is None:
raise AttributeError("Manager must be accessed via instance")
manager = self.__get__(instance)
# If the foreign key can support nulls, then completely clear the related set.
# Otherwise, just move the named objects into the set.
if self.related.field.null:
manager.clear()
manager.add(*value)
def delete_manager(self, instance):
"""
Returns a queryset based on the related model's base manager (rather
than the default manager, as returned by __get__). Used by
Model.delete().
"""
return self.create_manager(instance,
self.related.model._base_manager.__class__)
def create_manager(self, instance, superclass):
"""
Creates the managers used by other methods (__get__() and delete()).
"""
rel_field = self.related.field
rel_model = self.related.model
class RelatedManager(superclass):
def get_query_set(self):
db = self._db or router.db_for_read(rel_model, instance=instance)
return superclass.get_query_set(self).using(db).filter(**(self.core_filters))
def add(self, *objs):
for obj in objs:
if not isinstance(obj, self.model):
raise TypeError("'%s' instance expected" % self.model._meta.object_name)
setattr(obj, rel_field.name, instance)
obj.save()
add.alters_data = True
def create(self, **kwargs):
kwargs.update({rel_field.name: instance})
db = router.db_for_write(rel_model, instance=instance)
return super(RelatedManager, self.db_manager(db)).create(**kwargs)
create.alters_data = True
def get_or_create(self, **kwargs):
# Update kwargs with the related object that this
# ForeignRelatedObjectsDescriptor knows about.
kwargs.update({rel_field.name: instance})
db = router.db_for_write(rel_model, instance=instance)
return super(RelatedManager, self.db_manager(db)).get_or_create(**kwargs)
get_or_create.alters_data = True
# remove() and clear() are only provided if the ForeignKey can have a value of null.
if rel_field.null:
def remove(self, *objs):
val = getattr(instance, rel_field.rel.get_related_field().attname)
for obj in objs:
# Is obj actually part of this descriptor set?
if getattr(obj, rel_field.attname) == val:
setattr(obj, rel_field.name, None)
obj.save()
else:
raise rel_field.rel.to.DoesNotExist("%r is not related to %r." % (obj, instance))
remove.alters_data = True
def clear(self):
for obj in self.all():
setattr(obj, rel_field.name, None)
obj.save()
clear.alters_data = True
manager = RelatedManager()
attname = rel_field.rel.get_related_field().name
manager.core_filters = {'%s__%s' % (rel_field.name, attname):
getattr(instance, attname)}
manager.model = self.related.model
return manager
def create_many_related_manager(superclass, rel=False):
"""Creates a manager that subclasses 'superclass' (which is a Manager)
and adds behavior for many-to-many related objects."""
through = rel.through
class ManyRelatedManager(superclass):
def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None,
join_table=None, source_field_name=None, target_field_name=None,
reverse=False):
super(ManyRelatedManager, self).__init__()
self.core_filters = core_filters
self.model = model
self.symmetrical = symmetrical
self.instance = instance
self.source_field_name = source_field_name
self.target_field_name = target_field_name
self.through = through
self._pk_val = self.instance.pk
self.reverse = reverse
if self._pk_val is None:
raise ValueError("%r instance needs to have a primary key value before a many-to-many relationship can be used." % instance.__class__.__name__)
def get_query_set(self):
db = self._db or router.db_for_read(self.instance.__class__, instance=self.instance)
return superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))
# If the ManyToMany relation has an intermediary model,
# the add and remove methods do not exist.
if rel.through._meta.auto_created:
def add(self, *objs):
self._add_items(self.source_field_name, self.target_field_name, *objs)
# If this is a symmetrical m2m relation to self, add the mirror entry in the m2m table
if self.symmetrical:
self._add_items(self.target_field_name, self.source_field_name, *objs)
add.alters_data = True
def remove(self, *objs):
self._remove_items(self.source_field_name, self.target_field_name, *objs)
# If this is a symmetrical m2m relation to self, remove the mirror entry in the m2m table
if self.symmetrical:
self._remove_items(self.target_field_name, self.source_field_name, *objs)
remove.alters_data = True
def clear(self):
self._clear_items(self.source_field_name)
# If this is a symmetrical m2m relation to self, clear the mirror entry in the m2m table
if self.symmetrical:
self._clear_items(self.target_field_name)
clear.alters_data = True
def create(self, **kwargs):
# This check needs to be done here, since we can't later remove this
# from the method lookup table, as we do with add and remove.
if not rel.through._meta.auto_created:
opts = through._meta
raise AttributeError("Cannot use create() on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead." % (opts.app_label, opts.object_name))
db = router.db_for_write(self.instance.__class__, instance=self.instance)
new_obj = super(ManyRelatedManager, self.db_manager(db)).create(**kwargs)
self.add(new_obj)
return new_obj
create.alters_data = True
def get_or_create(self, **kwargs):
db = router.db_for_write(self.instance.__class__, instance=self.instance)
obj, created = \
super(ManyRelatedManager, self.db_manager(db)).get_or_create(**kwargs)
# We only need to add() if created because if we got an object back
# from get() then the relationship already exists.
if created:
self.add(obj)
return obj, created
get_or_create.alters_data = True
def _add_items(self, source_field_name, target_field_name, *objs):
# join_table: name of the m2m link table
# source_field_name: the PK fieldname in join_table for the source object
# target_field_name: the PK fieldname in join_table for the target object
# *objs - objects to add. Either object instances, or primary keys of object instances.
# If there aren't any objects, there is nothing to do.
from django.db.models import Model
if objs:
new_ids = set()
for obj in objs:
if isinstance(obj, self.model):
if not router.allow_relation(obj, self.instance):
raise ValueError('Cannot add "%r": instance is on database "%s", value is on database "%s"' %
(obj, self.instance._state.db, obj._state.db))
new_ids.add(obj.pk)
elif isinstance(obj, Model):
raise TypeError("'%s' instance expected" % self.model._meta.object_name)
else:
new_ids.add(obj)
db = router.db_for_write(self.through.__class__, instance=self.instance)
vals = self.through._default_manager.using(db).values_list(target_field_name, flat=True)
vals = vals.filter(**{
source_field_name: self._pk_val,
'%s__in' % target_field_name: new_ids,
})
new_ids = new_ids - set(vals)
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are inserting the
# duplicate data row for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action='pre_add',
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=new_ids, using=db)
# Add the ones that aren't there already
for obj_id in new_ids:
self.through._default_manager.using(db).create(**{
'%s_id' % source_field_name: self._pk_val,
'%s_id' % target_field_name: obj_id,
})
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are inserting the
# duplicate data row for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action='post_add',
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=new_ids, using=db)
def _remove_items(self, source_field_name, target_field_name, *objs):
# source_col_name: the PK colname in join_table for the source object
# target_col_name: the PK colname in join_table for the target object
# *objs - objects to remove
# If there aren't any objects, there is nothing to do.
if objs:
# Check that all the objects are of the right type
old_ids = set()
for obj in objs:
if isinstance(obj, self.model):
old_ids.add(obj.pk)
else:
old_ids.add(obj)
# Work out what DB we're operating on
db = router.db_for_write(self.through.__class__, instance=self.instance)
# Send a signal to the other end if need be.
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are deleting the
# duplicate data row for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action="pre_remove",
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=old_ids, using=db)
# Remove the specified objects from the join table
self.through._default_manager.using(db).filter(**{
source_field_name: self._pk_val,
'%s__in' % target_field_name: old_ids
}).delete()
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are deleting the
# duplicate data row for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action="post_remove",
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=old_ids, using=db)
def _clear_items(self, source_field_name):
db = router.db_for_write(self.through.__class__, instance=self.instance)
# source_col_name: the PK colname in join_table for the source object
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are clearing the
# duplicate data rows for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action="pre_clear",
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=None, using=db)
self.through._default_manager.using(db).filter(**{
source_field_name: self._pk_val
}).delete()
if self.reverse or source_field_name == self.source_field_name:
# Don't send the signal when we are clearing the
# duplicate data rows for symmetrical reverse entries.
signals.m2m_changed.send(sender=rel.through, action="post_clear",
instance=self.instance, reverse=self.reverse,
model=self.model, pk_set=None, using=db)
return ManyRelatedManager
class ManyRelatedObjectsDescriptor(object):
# This class provides the functionality that makes the related-object
# managers available as attributes on a model class, for fields that have
# multiple "remote" values and have a ManyToManyField pointed at them by
# some other model (rather than having a ManyToManyField themselves).
# In the example "publication.article_set", the article_set attribute is a
# ManyRelatedObjectsDescriptor instance.
def __init__(self, related):
self.related = related # RelatedObject instance
def __get__(self, instance, instance_type=None):
if instance is None:
return self
# Dynamically create a class that subclasses the related
# model's default manager.
rel_model = self.related.model
superclass = rel_model._default_manager.__class__
RelatedManager = create_many_related_manager(superclass, self.related.field.rel)
manager = RelatedManager(
model=rel_model,
core_filters={'%s__pk' % self.related.field.name: instance._get_pk_val()},
instance=instance,
symmetrical=False,
source_field_name=self.related.field.m2m_reverse_field_name(),
target_field_name=self.related.field.m2m_field_name(),
reverse=True
)
return manager
def __set__(self, instance, value):
if instance is None:
raise AttributeError("Manager must be accessed via instance")
if not self.related.field.rel.through._meta.auto_created:
opts = self.related.field.rel.through._meta
raise AttributeError("Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead." % (opts.app_label, opts.object_name))
manager = self.__get__(instance)
manager.clear()
manager.add(*value)
class ReverseManyRelatedObjectsDescriptor(object):
# This class provides the functionality that makes the related-object
# managers available as attributes on a model class, for fields that have
# multiple "remote" values and have a ManyToManyField defined in their
# model (rather than having another model pointed *at* them).
# In the example "article.publications", the publications attribute is a
# ReverseManyRelatedObjectsDescriptor instance.
def __init__(self, m2m_field):
self.field = m2m_field
def _through(self):
# through is provided so that you have easy access to the through
# model (Book.authors.through) for inlines, etc. This is done as
# a property to ensure that the fully resolved value is returned.
return self.field.rel.through
through = property(_through)
def __get__(self, instance, instance_type=None):
if instance is None:
return self
# Dynamically create a class that subclasses the related
# model's default manager.
rel_model=self.field.rel.to
superclass = rel_model._default_manager.__class__
RelatedManager = create_many_related_manager(superclass, self.field.rel)
manager = RelatedManager(
model=rel_model,
core_filters={'%s__pk' % self.field.related_query_name(): instance._get_pk_val()},
instance=instance,
symmetrical=self.field.rel.symmetrical,
source_field_name=self.field.m2m_field_name(),
target_field_name=self.field.m2m_reverse_field_name(),
reverse=False
)
return manager
def __set__(self, instance, value):
if instance is None:
raise AttributeError("Manager must be accessed via instance")
if not self.field.rel.through._meta.auto_created:
opts = self.field.rel.through._meta
raise AttributeError("Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead." % (opts.app_label, opts.object_name))
manager = self.__get__(instance)
manager.clear()
manager.add(*value)
class ManyToOneRel(object):
def __init__(self, to, field_name, related_name=None, limit_choices_to=None,
parent_link=False, on_delete=None):
try:
to._meta
except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT
assert isinstance(to, basestring), "'to' must be either a model, a model name or the string %r" % RECURSIVE_RELATIONSHIP_CONSTANT
self.to, self.field_name = to, field_name
self.related_name = related_name
if limit_choices_to is None:
limit_choices_to = {}
self.limit_choices_to = limit_choices_to
self.multiple = True
self.parent_link = parent_link
self.on_delete = on_delete
def is_hidden(self):
"Should the related object be hidden?"
return self.related_name and self.related_name[-1] == '+'
def get_related_field(self):
"""
Returns the Field in the 'to' object to which this relationship is
tied.
"""
data = self.to._meta.get_field_by_name(self.field_name)
if not data[2]:
raise FieldDoesNotExist("No related field named '%s'" %
self.field_name)
return data[0]
class OneToOneRel(ManyToOneRel):
def __init__(self, to, field_name, related_name=None, limit_choices_to=None,
parent_link=False, on_delete=None):
super(OneToOneRel, self).__init__(to, field_name,
related_name=related_name, limit_choices_to=limit_choices_to,
parent_link=parent_link, on_delete=on_delete
)
self.multiple = False
class ManyToManyRel(object):
def __init__(self, to, related_name=None, limit_choices_to=None,
symmetrical=True, through=None):
self.to = to
self.related_name = related_name
if limit_choices_to is None:
limit_choices_to = {}
self.limit_choices_to = limit_choices_to
self.symmetrical = symmetrical
self.multiple = True
self.through = through
def is_hidden(self):
"Should the related object be hidden?"
return self.related_name and self.related_name[-1] == '+'
def get_related_field(self):
"""
Returns the field in the to' object to which this relationship is tied
(this is always the primary key on the target model). Provided for
symmetry with ManyToOneRel.
"""
return self.to._meta.pk
class ForeignKey(RelatedField, Field):
empty_strings_allowed = False
default_error_messages = {
'invalid': _('Model %(model)s with pk %(pk)r does not exist.')
}
description = _("Foreign Key (type determined by related field)")
def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):
try:
to_name = to._meta.object_name.lower()
except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT
assert isinstance(to, basestring), "%s(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)
else:
assert not to._meta.abstract, "%s cannot define a relation with abstract class %s" % (self.__class__.__name__, to._meta.object_name)
# For backwards compatibility purposes, we need to *try* and set
# the to_field during FK construction. It won't be guaranteed to
# be correct until contribute_to_class is called. Refs #12190.
to_field = to_field or (to._meta.pk and to._meta.pk.name)
kwargs['verbose_name'] = kwargs.get('verbose_name', None)
if 'db_index' not in kwargs:
kwargs['db_index'] = True
kwargs['rel'] = rel_class(to, to_field,
related_name=kwargs.pop('related_name', None),
limit_choices_to=kwargs.pop('limit_choices_to', None),
parent_link=kwargs.pop('parent_link', False),
on_delete=kwargs.pop('on_delete', CASCADE),
)
Field.__init__(self, **kwargs)
def validate(self, value, model_instance):
if self.rel.parent_link:
return
super(ForeignKey, self).validate(value, model_instance)
if value is None:
return
qs = self.rel.to._default_manager.filter(**{self.rel.field_name:value})
qs = qs.complex_filter(self.rel.limit_choices_to)
if not qs.exists():
raise exceptions.ValidationError(self.error_messages['invalid'] % {
'model': self.rel.to._meta.verbose_name, 'pk': value})
def get_attname(self):
return '%s_id' % self.name
def get_validator_unique_lookup_type(self):
return '%s__%s__exact' % (self.name, self.rel.get_related_field().name)
def get_default(self):
"Here we check if the default value is an object and return the to_field if so."
field_default = super(ForeignKey, self).get_default()
if isinstance(field_default, self.rel.to):
return getattr(field_default, self.rel.get_related_field().attname)
return field_default
def get_db_prep_save(self, value, connection):
if value == '' or value == None:
return None
else:
return self.rel.get_related_field().get_db_prep_save(value,
connection=connections[router.db_for_read(self.rel.to)])
def value_to_string(self, obj):
if not obj:
# In required many-to-one fields with only one available choice,
# select that one available choice. Note: For SelectFields
# we have to check that the length of choices is *2*, not 1,
# because SelectFields always have an initial "blank" value.
if not self.blank and self.choices:
choice_list = self.get_choices_default()
if len(choice_list) == 2:
return smart_unicode(choice_list[1][0])
return Field.value_to_string(self, obj)
def contribute_to_class(self, cls, name):
super(ForeignKey, self).contribute_to_class(cls, name)
setattr(cls, self.name, ReverseSingleRelatedObjectDescriptor(self))
if isinstance(self.rel.to, basestring):
target = self.rel.to
else:
target = self.rel.to._meta.db_table
cls._meta.duplicate_targets[self.column] = (target, "o2m")
def contribute_to_related_class(self, cls, related):
# Internal FK's - i.e., those with a related name ending with '+' -
# don't get a related descriptor.
if not self.rel.is_hidden():
setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))
if self.rel.field_name is None:
self.rel.field_name = cls._meta.pk.name
def formfield(self, **kwargs):
db = kwargs.pop('using', None)
defaults = {
'form_class': forms.ModelChoiceField,
'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to),
'to_field_name': self.rel.field_name,
}
defaults.update(kwargs)
return super(ForeignKey, self).formfield(**defaults)
def db_type(self, connection):
# The database column type of a ForeignKey is the column type
# of the field to which it points. An exception is if the ForeignKey
# points to an AutoField/PositiveIntegerField/PositiveSmallIntegerField,
# in which case the column type is simply that of an IntegerField.
# If the database needs similar types for key fields however, the only
# thing we can do is making AutoField an IntegerField.
rel_field = self.rel.get_related_field()
return rel_field.related_db_type(connection=connections[router.db_for_read(rel_field.model)])
class OneToOneField(ForeignKey):
"""
A OneToOneField is essentially the same as a ForeignKey, with the exception
that always carries a "unique" constraint with it and the reverse relation
always returns the object pointed to (since there will only ever be one),
rather than returning a list.
"""
description = _("One-to-one relationship")
def __init__(self, to, to_field=None, **kwargs):
kwargs['unique'] = True
super(OneToOneField, self).__init__(to, to_field, OneToOneRel, **kwargs)
def contribute_to_related_class(self, cls, related):
setattr(cls, related.get_accessor_name(),
SingleRelatedObjectDescriptor(related))
def formfield(self, **kwargs):
if self.rel.parent_link:
return None
return super(OneToOneField, self).formfield(**kwargs)
def save_form_data(self, instance, data):
if isinstance(data, self.rel.to):
setattr(instance, self.name, data)
else:
setattr(instance, self.attname, data)
def create_many_to_many_intermediary_model(field, klass):
from django.db import models
managed = True
if isinstance(field.rel.to, basestring) and field.rel.to != RECURSIVE_RELATIONSHIP_CONSTANT:
to_model = field.rel.to
to = to_model.split('.')[-1]
def set_managed(field, model, cls):
field.rel.through._meta.managed = model._meta.managed or cls._meta.managed
add_lazy_relation(klass, field, to_model, set_managed)
elif isinstance(field.rel.to, basestring):
to = klass._meta.object_name
to_model = klass
managed = klass._meta.managed
else:
to = field.rel.to._meta.object_name
to_model = field.rel.to
managed = klass._meta.managed or to_model._meta.managed
name = '%s_%s' % (klass._meta.object_name, field.name)
if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or to == klass._meta.object_name:
from_ = 'from_%s' % to.lower()
to = 'to_%s' % to.lower()
else:
from_ = klass._meta.object_name.lower()
to = to.lower()
meta = type('Meta', (object,), {
'db_table': field._get_m2m_db_table(klass._meta),
'managed': managed,
'auto_created': klass,
'app_label': klass._meta.app_label,
'unique_together': (from_, to),
'verbose_name': '%(from)s-%(to)s relationship' % {'from': from_, 'to': to},
'verbose_name_plural': '%(from)s-%(to)s relationships' % {'from': from_, 'to': to},
})
# Construct and return the new class.
return type(name, (models.Model,), {
'Meta': meta,
'__module__': klass.__module__,
from_: models.ForeignKey(klass, related_name='%s+' % name),
to: models.ForeignKey(to_model, related_name='%s+' % name)
})
class ManyToManyField(RelatedField, Field):
description = _("Many-to-many relationship")
def __init__(self, to, **kwargs):
try:
assert not to._meta.abstract, "%s cannot define a relation with abstract class %s" % (self.__class__.__name__, to._meta.object_name)
except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT
assert isinstance(to, basestring), "%s(%r) is invalid. First parameter to ManyToManyField must be either a model, a model name, or the string %r" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)
kwargs['verbose_name'] = kwargs.get('verbose_name', None)
kwargs['rel'] = ManyToManyRel(to,
related_name=kwargs.pop('related_name', None),
limit_choices_to=kwargs.pop('limit_choices_to', None),
symmetrical=kwargs.pop('symmetrical', to==RECURSIVE_RELATIONSHIP_CONSTANT),
through=kwargs.pop('through', None))
self.db_table = kwargs.pop('db_table', None)
if kwargs['rel'].through is not None:
assert self.db_table is None, "Cannot specify a db_table if an intermediary model is used."
Field.__init__(self, **kwargs)
msg = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
self.help_text = string_concat(self.help_text, ' ', msg)
def get_choices_default(self):
return Field.get_choices(self, include_blank=False)
def _get_m2m_db_table(self, opts):
"Function that can be curried to provide the m2m table name for this relation"
if self.rel.through is not None:
return self.rel.through._meta.db_table
elif self.db_table:
return self.db_table
else:
return util.truncate_name('%s_%s' % (opts.db_table, self.name),
connection.ops.max_name_length())
def _get_m2m_attr(self, related, attr):
"Function that can be curried to provide the source accessor or DB column name for the m2m table"
cache_attr = '_m2m_%s_cache' % attr
if hasattr(self, cache_attr):
return getattr(self, cache_attr)
for f in self.rel.through._meta.fields:
if hasattr(f,'rel') and f.rel and f.rel.to == related.model:
setattr(self, cache_attr, getattr(f, attr))
return getattr(self, cache_attr)
def _get_m2m_reverse_attr(self, related, attr):
"Function that can be curried to provide the related accessor or DB column name for the m2m table"
cache_attr = '_m2m_reverse_%s_cache' % attr
if hasattr(self, cache_attr):
return getattr(self, cache_attr)
found = False
for f in self.rel.through._meta.fields:
if hasattr(f,'rel') and f.rel and f.rel.to == related.parent_model:
if related.model == related.parent_model:
# If this is an m2m-intermediate to self,
# the first foreign key you find will be
# the source column. Keep searching for
# the second foreign key.
if found:
setattr(self, cache_attr, getattr(f, attr))
break
else:
found = True
else:
setattr(self, cache_attr, getattr(f, attr))
break
return getattr(self, cache_attr)
def isValidIDList(self, field_data, all_data):
"Validates that the value is a valid list of foreign keys"
mod = self.rel.to
try:
pks = map(int, field_data.split(','))
except ValueError:
# the CommaSeparatedIntegerField validator will catch this error
return
objects = mod._default_manager.in_bulk(pks)
if len(objects) != len(pks):
badkeys = [k for k in pks if k not in objects]
raise exceptions.ValidationError(
ungettext("Please enter valid %(self)s IDs. The value %(value)r is invalid.",
"Please enter valid %(self)s IDs. The values %(value)r are invalid.",
len(badkeys)) % {
'self': self.verbose_name,
'value': len(badkeys) == 1 and badkeys[0] or tuple(badkeys),
})
def value_to_string(self, obj):
data = ''
if obj:
qs = getattr(obj, self.name).all()
data = [instance._get_pk_val() for instance in qs]
else:
# In required many-to-many fields with only one available choice,
# select that one available choice.
if not self.blank:
choices_list = self.get_choices_default()
if len(choices_list) == 1:
data = [choices_list[0][0]]
return smart_unicode(data)
def contribute_to_class(self, cls, name):
# To support multiple relations to self, it's useful to have a non-None
# related name on symmetrical relations for internal reasons. The
# concept doesn't make a lot of sense externally ("you want me to
# specify *what* on my non-reversible relation?!"), so we set it up
# automatically. The funky name reduces the chance of an accidental
# clash.
if self.rel.symmetrical and (self.rel.to == "self" or self.rel.to == cls._meta.object_name):
self.rel.related_name = "%s_rel_+" % name
super(ManyToManyField, self).contribute_to_class(cls, name)
# The intermediate m2m model is not auto created if:
# 1) There is a manually specified intermediate, or
# 2) The class owning the m2m field is abstract.
if not self.rel.through and not cls._meta.abstract:
self.rel.through = create_many_to_many_intermediary_model(self, cls)
# Add the descriptor for the m2m relation
setattr(cls, self.name, ReverseManyRelatedObjectsDescriptor(self))
# Set up the accessor for the m2m table name for the relation
self.m2m_db_table = curry(self._get_m2m_db_table, cls._meta)
# Populate some necessary rel arguments so that cross-app relations
# work correctly.
if isinstance(self.rel.through, basestring):
def resolve_through_model(field, model, cls):
field.rel.through = model
add_lazy_relation(cls, self, self.rel.through, resolve_through_model)
if isinstance(self.rel.to, basestring):
target = self.rel.to
else:
target = self.rel.to._meta.db_table
cls._meta.duplicate_targets[self.column] = (target, "m2m")
def contribute_to_related_class(self, cls, related):
# Internal M2Ms (i.e., those with a related name ending with '+')
# don't get a related descriptor.
if not self.rel.is_hidden():
setattr(cls, related.get_accessor_name(), ManyRelatedObjectsDescriptor(related))
# Set up the accessors for the column names on the m2m table
self.m2m_column_name = curry(self._get_m2m_attr, related, 'column')
self.m2m_reverse_name = curry(self._get_m2m_reverse_attr, related, 'column')
self.m2m_field_name = curry(self._get_m2m_attr, related, 'name')
self.m2m_reverse_field_name = curry(self._get_m2m_reverse_attr, related, 'name')
def set_attributes_from_rel(self):
pass
def value_from_object(self, obj):
"Returns the value of this field in the given model instance."
return getattr(obj, self.attname).all()
def save_form_data(self, instance, data):
setattr(instance, self.attname, data)
def formfield(self, **kwargs):
db = kwargs.pop('using', None)
defaults = {
'form_class': forms.ModelMultipleChoiceField,
'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to)
}
defaults.update(kwargs)
# If initial is passed in, it's a list of related objects, but the
# MultipleChoiceField takes a list of IDs.
if defaults.get('initial') is not None:
initial = defaults['initial']
if callable(initial):
initial = initial()
defaults['initial'] = [i._get_pk_val() for i in initial]
return super(ManyToManyField, self).formfield(**defaults)
def db_type(self, connection):
# A ManyToManyField is not represented by a single column,
# so return None.
return None
| ajibawa-2023/Python-Code-Large/train/row_99021 | 620 | 1,163 | 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_99021:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0009, 0.0009, 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_99021:ImportFrom_L2_C0", "label": "from django.db import connection, router, transaction\u2026", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0017, 0.0009, 0, 0.66, 0.0312, 40, 0, 4, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connection", "router", "transaction", "connections"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connection, router, transaction, connections"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L3_C0", "label": "from django.db.backends import util", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0026, 0.0009, 0, 0.66, 0.0625, 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_99021:ImportFrom_L4_C0", "label": "from django.db.models import signals, get_model", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0034, 0.0009, 0, 0.66, 0.0938, 680, 0, 2, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["signals", "get_model"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import signals, get_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L5_C0", "label": "from django.db.models.fields import AutoField, Field, IntegerField\u2026", "type": "import", "loc": [5, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0047, 0.0017, 0, 0.66, 0.125, 5, 0, 6, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["AutoField", "Field", "IntegerField", "PositiveIntegerField", "PositiveSmallIntegerField", "FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import (AutoField, Field, IntegerField,\n PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L7_C0", "label": "from django.db.models.related import RelatedObject", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.006, 0.0009, 0, 0.66, 0.1562, 859, 0, 1, 0, 0, 859, 0, 0], "semantic": {"name": "django.db.models.related", "arg_names": [], "import_names": ["RelatedObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.related import RelatedObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L8_C0", "label": "from django.db.models.query import QuerySet", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0069, 0.0009, 0, 0.66, 0.1875, 793, 0, 1, 0, 0, 793, 0, 0], "semantic": {"name": "django.db.models.query", "arg_names": [], "import_names": ["QuerySet"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.query import QuerySet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L9_C0", "label": "from django.db.models.query_utils import QueryWrapper", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0077, 0.0009, 0, 0.66, 0.2188, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "django.db.models.query_utils", "arg_names": [], "import_names": ["QueryWrapper"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.query_utils import QueryWrapper"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L10_C0", "label": "from django.db.models.deletion import CASCADE", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0086, 0.0009, 0, 0.66, 0.25, 229, 0, 1, 0, 0, 229, 0, 0], "semantic": {"name": "django.db.models.deletion", "arg_names": [], "import_names": ["CASCADE"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.deletion import CASCADE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L11_C0", "label": "from django.utils.encoding import smart_unicode", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0095, 0.0009, 0, 0.66, 0.2812, 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_99021:ImportFrom_L12_C0", "label": "from django.utils.translation import _, string_concat, ungettext\u2026", "type": "import", "loc": [12, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0107, 0.0017, 0, 0.66, 0.3125, 389, 0, 4, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names": [], "import_names": ["_", "string_concat", "ungettext", "ugettext"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.translation import (ugettext_lazy as _, string_concat,\n ungettext, ugettext)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L14_C0", "label": "from django.utils.functional import curry", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.012, 0.0009, 0, 0.66, 0.3438, 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_99021:ImportFrom_L15_C0", "label": "from django.core import exceptions", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0129, 0.0009, 0, 0.66, 0.375, 913, 0, 1, 0, 0, 913, 0, 0], "semantic": {"name": "django.core", "arg_names": [], "import_names": ["exceptions"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core import exceptions"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L16_C0", "label": "from django import forms", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0138, 0.0009, 0, 0.66, 0.4062, 294, 0, 1, 0, 0, 294, 0, 0], "semantic": {"name": "django", "arg_names": [], "import_names": ["forms"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django import forms"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L19_C0", "label": "RECURSIVE_RELATIONSHIP_CONSTANT =", "type": "assigned_variable", "loc": [19, 19], "level": 0, "parent": null, "vector": [14, 0, 0.0163, 0.0009, 0, 0.66, 0.4375, 52, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RECURSIVE_RELATIONSHIP_CONSTANT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RECURSIVE_RELATIONSHIP_CONSTANT = 'self'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L21_C0", "label": "pending_lookups =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.0181, 0.0009, 0, 0.66, 0.4688, 482, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "pending_lookups", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pending_lookups = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "label": "add_lazy_relation", "type": "function", "loc": [23, 76], "level": 0, "parent": null, "vector": [2, 0, 0.0426, 0.0464, 0, 0.66, 0.5, 283, 0, 4, 0, 0, 0, 0, 5], "semantic": {"name": "add_lazy_relation", "arg_names": ["cls", "field", "relation", "operation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def add_lazy_relation(cls, field, relation, operation):\n \"\"\"\n Adds a lookup on ``cls`` when a related field is defined using a string,\n i.e.::\n\n class MyModel(Model):\n fk = ForeignKey(\"AnotherModel\")\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L24_C4", "label": "expression", "type": "expression", "loc": [24, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "vector": [8, 1, 0.0305, 0.0206, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Adds a lookup on ``cls`` when a related field is defined using a string,\n i.e.::\n\n class MyModel(Model):\n fk = ForeignKey(\"AnotherModel\")\n\n This string can be:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "label": "if", "type": "if", "loc": [49, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "vector": [4, 1, 0.0486, 0.0138, 1, 0.65, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if relation == RECURSIVE_RELATIONSHIP_CONSTANT:\n app_label = cls._meta.app_label\n model_name = cls.__name__\n\n else:\n # Look for an \"app.Model\" relation\n try:\n app_label, model_name = relation.split(\".\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L50_C8", "label": "app_label =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "vector": [14, 2, 0.043, 0.0009, 2, 0.85, 0.0, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "app_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " app_label = cls._meta.app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L51_C8", "label": "model_name =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "vector": [14, 2, 0.0439, 0.0009, 2, 0.85, 0.5, 131, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_name = cls.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "label": "try", "type": "try", "loc": [55, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "vector": [7, 2, 0.0512, 0.0086, 2, 0.85, 1.0, 0, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n app_label, model_name = relation.split(\".\")\n except ValueError:\n # If we can't split, assume a model in current app\n app_label = cls._meta.app_label\n model_name = relation\n except AttributeError:\n # If it doesn't have a split it's actually a model class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L56_C12", "label": "app_label, model_name = split()", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "vector": [14, 3, 0.0482, 0.0009, 3, 0.37, 0.0, 388, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "app_label, model_name", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " app_label, model_name = relation.split(\".\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L59_C12", "label": "app_label =", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "vector": [14, 3, 0.0507, 0.0009, 3, 0.37, 0.0, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "app_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " app_label = cls._meta.app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L60_C12", "label": "model_name =", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "vector": [14, 3, 0.0516, 0.0009, 3, 0.37, 1.0, 131, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_name = relation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L63_C12", "label": "app_label =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "vector": [14, 3, 0.0542, 0.0009, 3, 0.37, 0.0, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "app_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " app_label = relation._meta.app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L64_C12", "label": "model_name =", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "vector": [14, 3, 0.055, 0.0009, 3, 0.37, 1.0, 131, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_name = relation._meta.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L70_C4", "label": "model = get_model()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "vector": [14, 1, 0.0602, 0.0009, 1, 0.65, 0.6667, 722, 3, 3, 0, 0, 115, 10, 1], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "get_model", "annotation": ""}, "snippet": " model = get_model(app_label, model_name, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "label": "if", "type": "if", "loc": [71, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "vector": [4, 1, 0.0632, 0.0052, 1, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model:\n operation(field, model, cls)\n else:\n key = (app_label, model_name)\n value = (cls, field, operation)\n pending_lookups.setdefault(key, []).append(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L72_C8", "label": "operation()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "vector": [8, 2, 0.0619, 0.0009, 2, 0.32, 0.0, 870, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "operation", "arg_names": [], "import_names": [], "rhs_call_name": "operation", "annotation": ""}, "snippet": " operation(field, model, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L74_C8", "label": "key =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "vector": [14, 2, 0.0636, 0.0009, 2, 0.32, 0.3333, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (app_label, model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L75_C8", "label": "value =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "vector": [14, 2, 0.0645, 0.0009, 2, 0.32, 0.6667, 441, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = (cls, field, operation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L76_C8", "label": "append()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "vector": [8, 2, 0.0653, 0.0009, 2, 0.32, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " pending_lookups.setdefault(key, []).append(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "label": "do_pending_lookups", "type": "function", "loc": [78, 84], "level": 0, "parent": null, "vector": [2, 0, 0.0696, 0.006, 0, 0.66, 0.5312, 510, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "do_pending_lookups", "arg_names": ["sender", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def do_pending_lookups(sender, **kwargs):\n \"\"\"\n Handle any pending relations to the sending model. Sent from class_prepared.\n \"\"\"\n key = (sender._meta.app_label, sender.__name__)\n for cls, field, operation in pending_lookups.pop(key, []):\n operation(field, sender, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L79_C4", "label": "expression", "type": "expression", "loc": [79, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "vector": [8, 1, 0.0688, 0.0026, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Handle any pending relations to the sending model. Sent from class_prepared.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L82_C4", "label": "key =", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "vector": [14, 1, 0.0705, 0.0009, 1, 0.02, 0.5, 230, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " key = (sender._meta.app_label, sender.__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L83_C4", "label": "for cls, field, operation", "type": "for", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "vector": [6, 1, 0.0718, 0.0017, 1, 0.02, 1.0, 626, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cls, field, operation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cls, field, operation in pending_lookups.pop(key, []):\n operation(field, sender, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L84_C8", "label": "operation()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L83_C4", "vector": [8, 2, 0.0722, 0.0009, 2, 0.5, 0.0, 870, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "operation", "arg_names": [], "import_names": [], "rhs_call_name": "operation", "annotation": ""}, "snippet": " operation(field, sender, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L86_C0", "label": "connect()", "type": "expression", "loc": [86, 86], "level": 0, "parent": null, "vector": [8, 0, 0.0739, 0.0009, 0, 0.66, 0.5625, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "signals.class_prepared.connect(do_pending_lookups)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "label": "RelatedField", "type": "class", "loc": [89, 208], "level": 0, "parent": null, "vector": [3, 0, 0.1277, 0.1032, 0, 0.66, 0.5938, 878, 0, 8, 0, 0, 186, 0, 40], "semantic": {"name": "RelatedField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RelatedField(object):\n def contribute_to_class(self, cls, name):\n sup = super(RelatedField, self)\n\n # Store the opts for related_query_name()\n self.opts = cls._meta\n\n if hasattr(sup, 'contribute_to_class'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "label": "contribute_to_class", "type": "function", "loc": [90, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.0868, 0.0198, 1, 0.44, 0.0, 973, 0, 3, 0, 0, 0, 0, 9], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n sup = super(RelatedField, self)\n\n # Store the opts for related_query_name()\n self.opts = cls._meta\n\n if hasattr(sup, 'contribute_to_class'):\n sup.contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L91_C8", "label": "sup = super()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [14, 2, 0.0782, 0.0009, 2, 0.81, 0.0, 575, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "sup", "arg_names": [], "import_names": [], "rhs_call_name": "super", "annotation": ""}, "snippet": " sup = super(RelatedField, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L94_C8", "label": "self.opts =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [14, 2, 0.0808, 0.0009, 2, 0.81, 0.2, 26, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.opts = cls._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [4, 2, 0.083, 0.0017, 2, 0.81, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(sup, 'contribute_to_class'):\n sup.contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L97_C12", "label": "contribute_to_class()", "type": "expression", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L96_C8", "vector": [8, 3, 0.0834, 0.0009, 3, 0.9, 0.0, 973, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " sup.contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L99_C8", "label": "if", "type": "if", "loc": [99, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [4, 2, 0.0868, 0.0043, 2, 0.81, 0.6, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not cls._meta.abstract and self.rel.related_name:\n self.rel.related_name = self.rel.related_name % {\n 'class': cls.__name__.lower(),\n 'app_label': cls._meta.app_label.lower(),\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L100_C12", "label": "self.rel.related_name =", "type": "assigned_variable", "loc": [100, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L99_C8", "vector": [14, 3, 0.0873, 0.0034, 3, 0.83, 0.0, 339, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.rel.related_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rel.related_name = self.rel.related_name % {\n 'class': cls.__name__.lower(),\n 'app_label': cls._meta.app_label.lower(),\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L105_C8", "label": "other =", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [14, 2, 0.0903, 0.0009, 2, 0.81, 0.8, 341, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "other", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other = self.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "label": "if", "type": "if", "loc": [106, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "vector": [4, 2, 0.0937, 0.006, 2, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(other, basestring) or other._meta.pk is None:\n def resolve_related_class(field, model, cls):\n field.rel.to = model\n field.do_related_class(model, cls)\n add_lazy_relation(cls, self, other, resolve_related_class)\n else:\n self.do_related_class(other, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12", "label": "resolve_related_class", "type": "function", "loc": [107, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "vector": [2, 3, 0.0929, 0.0026, 3, 0.0, 0.0, 49, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "resolve_related_class", "arg_names": ["field", "model", "cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve_related_class(field, model, cls):\n field.rel.to = model\n field.do_related_class(model, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L108_C16", "label": "field.rel.to =", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12", "vector": [14, 4, 0.0929, 0.0009, 4, 0.6, 0.0, 584, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field.rel.to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field.rel.to = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L109_C16", "label": "do_related_class()", "type": "expression", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12", "vector": [8, 4, 0.0937, 0.0009, 4, 0.6, 1.0, 589, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "do_related_class", "arg_names": [], "import_names": [], "rhs_call_name": "do_related_class", "annotation": ""}, "snippet": " field.do_related_class(model, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L110_C12", "label": "add_lazy_relation()", "type": "expression", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "vector": [8, 3, 0.0946, 0.0009, 3, 0.0, 0.5, 283, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_lazy_relation", "arg_names": [], "import_names": [], "rhs_call_name": "add_lazy_relation", "annotation": ""}, "snippet": " add_lazy_relation(cls, self, other, resolve_related_class)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L112_C12", "label": "do_related_class()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "vector": [8, 3, 0.0963, 0.0009, 3, 0.0, 1.0, 589, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "do_related_class", "arg_names": [], "import_names": [], "rhs_call_name": "do_related_class", "annotation": ""}, "snippet": " self.do_related_class(other, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "label": "set_attributes_from_rel", "type": "function", "loc": [114, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.0997, 0.0043, 1, 0.44, 0.1667, 796, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_attributes_from_rel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_attributes_from_rel(self):\n self.name = self.name or (self.rel.to._meta.object_name.lower() + '_' + self.rel.to._meta.pk.name)\n if self.verbose_name is None:\n self.verbose_name = self.rel.to._meta.verbose_name\n self.rel.field_name = self.rel.field_name or self.rel.to._meta.pk.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L115_C8", "label": "self.name =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "vector": [14, 2, 0.0989, 0.0009, 2, 0.98, 0.0, 689, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = self.name or (self.rel.to._meta.object_name.lower() + '_' + self.rel.to._meta.pk.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L116_C8", "label": "if", "type": "if", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "vector": [4, 2, 0.1002, 0.0017, 2, 0.98, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.verbose_name is None:\n self.verbose_name = self.rel.to._meta.verbose_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L117_C12", "label": "self.verbose_name =", "type": "assigned_variable", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L116_C8", "vector": [14, 3, 0.1006, 0.0009, 3, 0.17, 0.0, 45, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.verbose_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.verbose_name = self.rel.to._meta.verbose_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L118_C8", "label": "self.rel.field_name =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "vector": [14, 2, 0.1015, 0.0009, 2, 0.98, 1.0, 889, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rel.field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rel.field_name = self.rel.field_name or self.rel.to._meta.pk.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "label": "do_related_class", "type": "function", "loc": [120, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.1049, 0.0043, 1, 0.44, 0.3333, 589, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "do_related_class", "arg_names": ["self", "other", "cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_related_class(self, other, cls):\n self.set_attributes_from_rel()\n self.related = RelatedObject(other, cls, self)\n if not cls._meta.abstract:\n self.contribute_to_related_class(other, self.related)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L121_C8", "label": "set_attributes_from_rel()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "vector": [8, 2, 0.104, 0.0009, 2, 0.05, 0.0, 796, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_attributes_from_rel", "arg_names": [], "import_names": [], "rhs_call_name": "set_attributes_from_rel", "annotation": ""}, "snippet": " self.set_attributes_from_rel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L122_C8", "label": "self.related = RelatedObject()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "vector": [14, 2, 0.1049, 0.0009, 2, 0.05, 0.5, 71, 3, 3, 0, 0, 353, 10, 1], "semantic": {"name": "self.related", "arg_names": [], "import_names": [], "rhs_call_name": "RelatedObject", "annotation": ""}, "snippet": " self.related = RelatedObject(other, cls, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L123_C8", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "vector": [4, 2, 0.1062, 0.0017, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not cls._meta.abstract:\n self.contribute_to_related_class(other, self.related)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L124_C12", "label": "contribute_to_related_class()", "type": "expression", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L123_C8", "vector": [8, 3, 0.1066, 0.0009, 3, 0.63, 0.0, 722, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "contribute_to_related_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_related_class", "annotation": ""}, "snippet": " self.contribute_to_related_class(other, self.related)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "label": "get_prep_lookup", "type": "function", "loc": [126, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.1148, 0.0138, 1, 0.44, 0.5, 384, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "get_prep_lookup", "arg_names": ["self", "lookup_type", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_prep_lookup(self, lookup_type, value):\n if hasattr(value, 'prepare'):\n return value.prepare()\n if hasattr(value, '_prepare'):\n return value._prepare()\n # FIXME: lt and gt are explicitly allowed to make\n # get_(next/prev)_by_date work; other lookups are not allowed since that\n # gets messy pretty quick. This is a good candidate for some refactoring"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L127_C8", "label": "if", "type": "if", "loc": [127, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "vector": [4, 2, 0.1096, 0.0017, 2, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'prepare'):\n return value.prepare()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L128_C12", "label": "return", "type": "return", "loc": [128, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L127_C8", "vector": [13, 3, 0.1101, 0.0009, 3, 0.33, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.prepare()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L129_C8", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "vector": [4, 2, 0.1113, 0.0017, 2, 0.65, 0.3333, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, '_prepare'):\n return value._prepare()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L130_C12", "label": "return", "type": "return", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L129_C8", "vector": [13, 3, 0.1118, 0.0009, 3, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value._prepare()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "vector": [4, 2, 0.1165, 0.0017, 2, 0.65, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ['exact', 'gt', 'lt', 'gte', 'lte']:\n return self._pk_trace(value, 'get_prep_lookup', lookup_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L136_C12", "label": "return", "type": "return", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L135_C8", "vector": [13, 3, 0.1169, 0.0009, 3, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._pk_trace(value, 'get_prep_lookup', lookup_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8", "label": "if", "type": "if", "loc": [137, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "vector": [4, 2, 0.1191, 0.0034, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ('range', 'in'):\n return [self._pk_trace(v, 'get_prep_lookup', lookup_type) for v in value]\n elif lookup_type == 'isnull':\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L138_C12", "label": "return", "type": "return", "loc": [138, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8", "vector": [13, 3, 0.1187, 0.0009, 3, 0.4, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._pk_trace(v, 'get_prep_lookup', lookup_type) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L139_C8", "label": "if", "type": "if", "loc": [139, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8", "vector": [4, 3, 0.1199, 0.0017, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type == 'isnull':\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L140_C12", "label": "return", "type": "return", "loc": [140, 140], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L139_C8", "vector": [13, 4, 0.1204, 0.0009, 4, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "label": "get_db_prep_lookup", "type": "function", "loc": [143, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.1354, 0.0258, 1, 0.44, 0.6667, 681, 0, 5, 1, 0, 0, 0, 13], "semantic": {"name": "get_db_prep_lookup", "arg_names": ["self", "lookup_type", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):\n if not prepared:\n value = self.get_prep_lookup(lookup_type, value)\n if hasattr(value, 'get_compiler'):\n value = value.get_compiler(connection=connection)\n if hasattr(value, 'as_sql') or hasattr(value, '_as_sql'):\n # If the value has a relabel_aliases method, it will need to\n # be invoked before the final SQL is evaluated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L144_C8", "label": "if", "type": "if", "loc": [144, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "vector": [4, 2, 0.1242, 0.0017, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not prepared:\n value = self.get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L145_C12", "label": "value = get_prep_lookup()", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L144_C8", "vector": [14, 3, 0.1247, 0.0009, 3, 0.43, 0.0, 441, 3, 2, 0, 0, 384, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get_prep_lookup", "annotation": ""}, "snippet": " value = self.get_prep_lookup(lookup_type, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "vector": [4, 2, 0.126, 0.0017, 2, 0.18, 0.25, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'get_compiler'):\n value = value.get_compiler(connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L147_C12", "label": "value = get_compiler()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L146_C8", "vector": [14, 3, 0.1264, 0.0009, 3, 0.55, 0.0, 441, 3, 1, 0, 0, 963, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "get_compiler", "annotation": ""}, "snippet": " value = value.get_compiler(connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "label": "if", "type": "if", "loc": [148, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "vector": [4, 2, 0.1311, 0.0086, 2, 0.18, 0.5, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'as_sql') or hasattr(value, '_as_sql'):\n # If the value has a relabel_aliases method, it will need to\n # be invoked before the final SQL is evaluated\n if hasattr(value, 'relabel_aliases'):\n return value\n if hasattr(value, 'as_sql'):\n sql, params = value.as_sql()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L151_C12", "label": "if", "type": "if", "loc": [151, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "vector": [4, 3, 0.1303, 0.0017, 3, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'relabel_aliases'):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L152_C16", "label": "return", "type": "return", "loc": [152, 152], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L151_C12", "vector": [13, 4, 0.1307, 0.0009, 4, 0.86, 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_99021:If_L153_C12", "label": "if", "type": "if", "loc": [153, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "vector": [4, 3, 0.1328, 0.0034, 3, 0.9, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(value, 'as_sql'):\n sql, params = value.as_sql()\n else:\n sql, params = value._as_sql(connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L154_C16", "label": "sql, params = as_sql()", "type": "assigned_variable", "loc": [154, 154], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L153_C12", "vector": [14, 4, 0.1324, 0.0009, 4, 0.26, 0.0, 643, 3, 0, 0, 0, 122, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "as_sql", "annotation": ""}, "snippet": " sql, params = value.as_sql()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L156_C16", "label": "sql, params = _as_sql()", "type": "assigned_variable", "loc": [156, 156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L153_C12", "vector": [14, 4, 0.1341, 0.0009, 4, 0.26, 1.0, 643, 3, 1, 0, 0, 548, 10, 1], "semantic": {"name": "sql, params", "arg_names": [], "import_names": [], "rhs_call_name": "_as_sql", "annotation": ""}, "snippet": " sql, params = value._as_sql(connection=connection)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "vector": [13, 3, 0.135, 0.0009, 3, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return QueryWrapper(('(%s)' % sql), params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L163_C8", "label": "if", "type": "if", "loc": [163, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "vector": [4, 2, 0.141, 0.0026, 2, 0.18, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ['exact', 'gt', 'lt', 'gte', 'lte']:\n return [self._pk_trace(value, 'get_db_prep_lookup', lookup_type,\n connection=connection, prepared=prepared)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L164_C12", "label": "return", "type": "return", "loc": [164, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L163_C8", "vector": [13, 3, 0.1414, 0.0017, 3, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._pk_trace(value, 'get_db_prep_lookup', lookup_type,\n connection=connection, prepared=prepared)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8", "label": "if", "type": "if", "loc": [166, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "vector": [4, 2, 0.1449, 0.0052, 2, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ('range', 'in'):\n return [self._pk_trace(v, 'get_db_prep_lookup', lookup_type,\n connection=connection, prepared=prepared)\n for v in value]\n elif lookup_type == 'isnull':\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L167_C12", "label": "return", "type": "return", "loc": [167, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8", "vector": [13, 3, 0.1445, 0.0026, 3, 0.39, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._pk_trace(v, 'get_db_prep_lookup', lookup_type,\n connection=connection, prepared=prepared)\n for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L170_C8", "label": "if", "type": "if", "loc": [170, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8", "vector": [4, 3, 0.1466, 0.0017, 3, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif lookup_type == 'isnull':\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L171_C12", "label": "return", "type": "return", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L170_C8", "vector": [13, 4, 0.147, 0.0009, 4, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "label": "_pk_trace", "type": "function", "loc": [174, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.1612, 0.0241, 1, 0.44, 0.8333, 943, 0, 5, 1, 0, 0, 0, 6], "semantic": {"name": "_pk_trace", "arg_names": ["self", "value", "prep_func", "lookup_type", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _pk_trace(self, value, prep_func, lookup_type, **kwargs):\n # Value may be a primary key, or an object held in a relation.\n # If it is an object, then we need to get the primary key value for\n # that object. In certain conditions (especially one-to-one relations),\n # the primary key may itself be an object - so we need to keep drilling\n # down until we hit a value that can be used for a comparison.\n v = value\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L180_C8", "label": "v =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [14, 2, 0.1548, 0.0009, 2, 0.95, 0.0, 553, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8", "label": "try", "type": "try", "loc": [181, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [7, 2, 0.1582, 0.006, 2, 0.95, 0.1429, 0, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n while True:\n v = getattr(v, v._meta.pk.name)\n except AttributeError:\n pass\n except exceptions.ObjectDoesNotExist:\n v = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L182_C12", "label": "while", "type": "while", "loc": [182, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8", "vector": [5, 3, 0.1569, 0.0017, 3, 0.71, 0.0, 0, 1, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n v = getattr(v, v._meta.pk.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L183_C16", "label": "v = getattr()", "type": "assigned_variable", "loc": [183, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L182_C12", "vector": [14, 4, 0.1574, 0.0009, 4, 0.22, 0.0, 553, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " v = getattr(v, v._meta.pk.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L187_C12", "label": "v =", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8", "vector": [14, 3, 0.1608, 0.0009, 3, 0.71, 0.0, 553, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L189_C8", "label": "field =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [14, 2, 0.1625, 0.0009, 2, 0.95, 0.2857, 480, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L190_C8", "label": "while", "type": "while", "loc": [190, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [5, 2, 0.1651, 0.0043, 2, 0.95, 0.4286, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while field.rel:\n if hasattr(field.rel, 'field_name'):\n field = field.rel.to._meta.get_field(field.rel.field_name)\n else:\n field = field.rel.to._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12", "label": "if", "type": "if", "loc": [191, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L190_C8", "vector": [4, 3, 0.1655, 0.0034, 3, 0.66, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(field.rel, 'field_name'):\n field = field.rel.to._meta.get_field(field.rel.field_name)\n else:\n field = field.rel.to._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L192_C16", "label": "field = get_field()", "type": "assigned_variable", "loc": [192, 192], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12", "vector": [14, 4, 0.1651, 0.0009, 4, 0.51, 0.0, 480, 3, 1, 0, 0, 389, 10, 1], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "get_field", "annotation": ""}, "snippet": " field = field.rel.to._meta.get_field(field.rel.field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L194_C16", "label": "field =", "type": "assigned_variable", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12", "vector": [14, 4, 0.1668, 0.0009, 4, 0.51, 1.0, 480, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field = field.rel.to._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L196_C8", "label": "if", "type": "if", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [4, 2, 0.169, 0.0017, 2, 0.95, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if lookup_type in ('range', 'in'):\n v = [v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L197_C12", "label": "v =", "type": "assigned_variable", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L196_C8", "vector": [14, 3, 0.1694, 0.0009, 3, 0.06, 0.0, 553, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = [v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L198_C8", "label": "v =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [14, 2, 0.1702, 0.0009, 2, 0.95, 0.7143, 553, 3, 3, 0, 0, 0, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = getattr(field, prep_func)(lookup_type, v, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L199_C8", "label": "if", "type": "if", "loc": [199, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [4, 2, 0.1715, 0.0017, 2, 0.95, 0.8571, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(v, list):\n v = v[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L200_C12", "label": "v =", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L199_C8", "vector": [14, 3, 0.172, 0.0009, 3, 0.82, 0.0, 553, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " v = v[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L201_C8", "label": "return", "type": "return", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "vector": [13, 2, 0.1728, 0.0009, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L203_C4", "label": "related_query_name", "type": "function", "loc": [203, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "vector": [2, 1, 0.1767, 0.0052, 1, 0.44, 1.0, 121, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "related_query_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def related_query_name(self):\n # This method defines the name that can be used to identify this\n # related object in a table-spanning query. It uses the lower-cased\n # object_name by default, but this can be overridden with the\n # \"related_name\" option.\n return self.rel.related_name or self.opts.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L208_C8", "label": "return", "type": "return", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L203_C4", "vector": [13, 2, 0.1788, 0.0009, 2, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.rel.related_name or self.opts.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "label": "SingleRelatedObjectDescriptor", "type": "class", "loc": [210, 266], "level": 0, "parent": null, "vector": [3, 0, 0.2046, 0.049, 0, 0.66, 0.625, 769, 0, 3, 0, 0, 186, 0, 23], "semantic": {"name": "SingleRelatedObjectDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SingleRelatedObjectDescriptor(object):\n # This class provides the functionality that makes the related-object\n # managers available as attributes on a model class, for fields that have\n # a single \"remote\" value, on the class pointed to by a related field.\n # In the example \"place.restaurant\", the restaurant attribute is a\n # SingleRelatedObjectDescriptor instance.\n def __init__(self, related):\n self.related = related"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4", "label": "__init__", "type": "function", "loc": [216, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "vector": [2, 1, 0.1866, 0.0026, 1, 0.76, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, related):\n self.related = related\n self.cache_name = related.get_cache_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L217_C8", "label": "self.related =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4", "vector": [14, 2, 0.1866, 0.0009, 2, 0.6, 0.0, 71, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related = related"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L218_C8", "label": "self.cache_name = get_cache_name()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4", "vector": [14, 2, 0.1874, 0.0009, 2, 0.6, 1.0, 454, 3, 0, 0, 0, 691, 10, 1], "semantic": {"name": "self.cache_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_cache_name", "annotation": ""}, "snippet": " self.cache_name = related.get_cache_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4", "label": "__get__", "type": "function", "loc": [220, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "vector": [2, 1, 0.1935, 0.0095, 1, 0.76, 0.5, 93, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "instance_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, instance_type=None):\n if instance is None:\n return self\n try:\n return getattr(instance, self.cache_name)\n except AttributeError:\n params = {'%s__pk' % self.related.field.name: instance._get_pk_val()}\n db = router.db_for_read(self.related.model, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L221_C8", "label": "if", "type": "if", "loc": [221, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4", "vector": [4, 2, 0.1905, 0.0017, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L222_C12", "label": "return", "type": "return", "loc": [222, 222], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L221_C8", "vector": [13, 3, 0.1909, 0.0009, 3, 0.86, 0.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_99021:Try_L223_C8", "label": "try", "type": "try", "loc": [223, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4", "vector": [7, 2, 0.1948, 0.0069, 2, 0.98, 1.0, 0, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return getattr(instance, self.cache_name)\n except AttributeError:\n params = {'%s__pk' % self.related.field.name: instance._get_pk_val()}\n db = router.db_for_read(self.related.model, instance=instance)\n rel_obj = self.related.model._base_manager.using(db).get(**params)\n setattr(instance, self.cache_name, rel_obj)\n return rel_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L224_C12", "label": "return", "type": "return", "loc": [224, 224], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [13, 3, 0.1926, 0.0009, 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 getattr(instance, self.cache_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L226_C12", "label": "params =", "type": "assigned_variable", "loc": [226, 226], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [14, 3, 0.1943, 0.0009, 3, 0.54, 0.0, 206, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = {'%s__pk' % self.related.field.name: instance._get_pk_val()}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L227_C12", "label": "db = db_for_read()", "type": "assigned_variable", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [14, 3, 0.1952, 0.0009, 3, 0.54, 0.25, 761, 3, 2, 0, 0, 968, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_read", "annotation": ""}, "snippet": " db = router.db_for_read(self.related.model, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L228_C12", "label": "rel_obj = get()", "type": "assigned_variable", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [14, 3, 0.196, 0.0009, 3, 0.54, 0.5, 711, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "rel_obj", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " rel_obj = self.related.model._base_manager.using(db).get(**params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L229_C12", "label": "setattr()", "type": "expression", "loc": [229, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [8, 3, 0.1969, 0.0009, 3, 0.54, 0.75, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.cache_name, rel_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L230_C12", "label": "return", "type": "return", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "vector": [13, 3, 0.1978, 0.0009, 3, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rel_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "label": "__set__", "type": "function", "loc": [232, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "vector": [2, 1, 0.2141, 0.0301, 1, 0.76, 1.0, 145, 0, 3, 0, 0, 0, 0, 16], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n if instance is None:\n raise AttributeError(\"%s must be accessed via instance\" % self.related.opts.object_name)\n\n # The similarity of the code below to the code in\n # ReverseSingleRelatedObjectDescriptor is annoying, but there's a bunch\n # of small differences that would make a common base class convoluted.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L233_C8", "label": "if", "type": "if", "loc": [233, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "vector": [4, 2, 0.2008, 0.0017, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\"%s must be accessed via instance\" % self.related.opts.object_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L242_C8", "label": "if", "type": "if", "loc": [242, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "vector": [4, 2, 0.2145, 0.0138, 2, 0.99, 0.25, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None and self.related.field.null == False:\n raise ValueError('Cannot assign None: \"%s.%s\" does not allow null values.' %\n (instance._meta.object_name, self.related.get_accessor_name()))\n elif value is not None and not isinstance(value, self.related.model):\n raise ValueError('Cannot assign \"%r\": \"%s.%s\" must be a \"%s\" instance.' %\n (value, instance._meta.object_name,\n self.related.get_accessor_name(), self.related.opts.object_name))\n elif value is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L245_C8", "label": "if", "type": "if", "loc": [245, 257], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L242_C8", "vector": [4, 3, 0.2158, 0.0112, 3, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value is not None and not isinstance(value, self.related.model):\n raise ValueError('Cannot assign \"%r\": \"%s.%s\" must be a \"%s\" instance.' %\n (value, instance._meta.object_name,\n self.related.get_accessor_name(), self.related.opts.object_name))\n elif value is not None:\n if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L249_C8", "label": "if", "type": "if", "loc": [249, 257], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L245_C8", "vector": [4, 4, 0.2175, 0.0077, 4, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value is not None:\n if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12", "label": "if", "type": "if", "loc": [250, 257], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L249_C8", "vector": [4, 5, 0.218, 0.0069, 5, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L251_C16", "label": "instance._state.db = db_for_write()", "type": "assigned_variable", "loc": [251, 251], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12", "vector": [14, 6, 0.2158, 0.0009, 6, 0.9, 0.0, 172, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "instance._state.db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " instance._state.db = router.db_for_write(instance.__class__, instance=value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12", "label": "if", "type": "if", "loc": [252, 257], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12", "vector": [4, 6, 0.2188, 0.0052, 6, 0.9, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L253_C16", "label": "value._state.db = db_for_write()", "type": "assigned_variable", "loc": [253, 253], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12", "vector": [14, 7, 0.2175, 0.0009, 7, 0.62, 0.0, 659, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "value._state.db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " value._state.db = router.db_for_write(value.__class__, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L254_C12", "label": "if", "type": "if", "loc": [254, 257], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12", "vector": [4, 7, 0.2197, 0.0034, 7, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L255_C16", "label": "if", "type": "if", "loc": [255, 257], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L254_C12", "vector": [4, 8, 0.2201, 0.0026, 8, 0.28, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L260_C8", "label": "setattr()", "type": "expression", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "vector": [8, 2, 0.2236, 0.0009, 2, 0.99, 0.5, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(value, self.related.field.attname, getattr(instance, self.related.field.rel.get_related_field().attname))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L265_C8", "label": "setattr()", "type": "expression", "loc": [265, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "vector": [8, 2, 0.2279, 0.0009, 2, 0.99, 0.75, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.cache_name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L266_C8", "label": "setattr()", "type": "expression", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "vector": [8, 2, 0.2287, 0.0009, 2, 0.99, 1.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(value, self.related.field.get_cache_name(), instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "label": "ReverseSingleRelatedObjectDescriptor", "type": "class", "loc": [268, 364], "level": 0, "parent": null, "vector": [3, 0, 0.2717, 0.0834, 0, 0.66, 0.6562, 269, 0, 3, 0, 0, 186, 0, 29], "semantic": {"name": "ReverseSingleRelatedObjectDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ReverseSingleRelatedObjectDescriptor(object):\n # This class provides the functionality that makes the related-object\n # managers available as attributes on a model class, for fields that have\n # a single \"remote\" value, on the class that defines the related field.\n # In the example \"choice.poll\", the poll attribute is a\n # ReverseSingleRelatedObjectDescriptor instance.\n def __init__(self, field_with_rel):\n self.field = field_with_rel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L274_C4", "label": "__init__", "type": "function", "loc": [274, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "vector": [2, 1, 0.236, 0.0017, 1, 0.12, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "field_with_rel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, field_with_rel):\n self.field = field_with_rel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L275_C8", "label": "self.field =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L274_C4", "vector": [14, 2, 0.2365, 0.0009, 2, 0.0, 0.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = field_with_rel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "label": "__get__", "type": "function", "loc": [277, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "vector": [2, 1, 0.2506, 0.0258, 1, 0.12, 0.5, 93, 0, 3, 1, 0, 0, 0, 12], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "instance_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, instance_type=None):\n if instance is None:\n return self\n\n cache_name = self.field.get_cache_name()\n try:\n return getattr(instance, cache_name)\n except AttributeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L278_C8", "label": "if", "type": "if", "loc": [278, 279], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "vector": [4, 2, 0.2395, 0.0017, 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 instance is None:\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L279_C12", "label": "return", "type": "return", "loc": [279, 279], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L278_C8", "vector": [13, 3, 0.2399, 0.0009, 3, 0.64, 0.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_99021:Assign_L281_C8", "label": "cache_name = get_cache_name()", "type": "assigned_variable", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "vector": [14, 2, 0.2416, 0.0009, 2, 0.5, 0.5, 377, 3, 0, 0, 0, 691, 10, 1], "semantic": {"name": "cache_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_cache_name", "annotation": ""}, "snippet": " cache_name = self.field.get_cache_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "label": "try", "type": "try", "loc": [282, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "vector": [7, 2, 0.2528, 0.0215, 2, 0.5, 1.0, 0, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return getattr(instance, cache_name)\n except AttributeError:\n val = getattr(instance, self.field.attname)\n if val is None:\n # If NULL is an allowed value, return it.\n if self.field.null:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L283_C12", "label": "return", "type": "return", "loc": [283, 283], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [13, 3, 0.2433, 0.0009, 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 getattr(instance, cache_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L285_C12", "label": "val = getattr()", "type": "assigned_variable", "loc": [285, 285], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [14, 3, 0.2451, 0.0009, 3, 0.54, 0.0, 618, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " val = getattr(instance, self.field.attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L286_C12", "label": "if", "type": "if", "loc": [286, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [4, 3, 0.2476, 0.0043, 3, 0.54, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val is None:\n # If NULL is an allowed value, return it.\n if self.field.null:\n return None\n raise self.field.rel.to.DoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L288_C16", "label": "if", "type": "if", "loc": [288, 289], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L286_C12", "vector": [4, 4, 0.2481, 0.0017, 4, 0.08, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.field.null:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L289_C20", "label": "return", "type": "return", "loc": [289, 289], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L288_C16", "vector": [13, 5, 0.2485, 0.0009, 5, 0.84, 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_99021:Assign_L291_C12", "label": "other_field = get_related_field()", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [14, 3, 0.2502, 0.0009, 3, 0.54, 0.25, 859, 3, 0, 0, 0, 383, 10, 1], "semantic": {"name": "other_field", "arg_names": [], "import_names": [], "rhs_call_name": "get_related_field", "annotation": ""}, "snippet": " other_field = self.field.rel.get_related_field()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12", "label": "if", "type": "if", "loc": [292, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [4, 3, 0.2524, 0.0034, 3, 0.54, 0.375, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if other_field.rel:\n params = {'%s__pk' % self.field.rel.field_name: val}\n else:\n params = {'%s__exact' % self.field.rel.field_name: val}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L293_C16", "label": "params =", "type": "assigned_variable", "loc": [293, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12", "vector": [14, 4, 0.2519, 0.0009, 4, 0.16, 0.0, 206, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = {'%s__pk' % self.field.rel.field_name: val}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L295_C16", "label": "params =", "type": "assigned_variable", "loc": [295, 295], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12", "vector": [14, 4, 0.2537, 0.0009, 4, 0.16, 1.0, 206, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = {'%s__exact' % self.field.rel.field_name: val}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L299_C12", "label": "rel_mgr =", "type": "assigned_variable", "loc": [299, 299], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [14, 3, 0.2571, 0.0009, 3, 0.54, 0.5, 281, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rel_mgr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_mgr = self.field.rel.to._default_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L300_C12", "label": "db = db_for_read()", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [14, 3, 0.258, 0.0009, 3, 0.54, 0.625, 761, 3, 2, 0, 0, 968, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_read", "annotation": ""}, "snippet": " db = router.db_for_read(self.field.rel.to, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12", "label": "if", "type": "if", "loc": [301, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [4, 3, 0.2601, 0.0034, 3, 0.54, 0.75, 0, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(rel_mgr, 'use_for_related_fields', False):\n rel_obj = rel_mgr.using(db).get(**params)\n else:\n rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L302_C16", "label": "rel_obj = get()", "type": "assigned_variable", "loc": [302, 302], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12", "vector": [14, 4, 0.2597, 0.0009, 4, 0.74, 0.0, 711, 3, 1, 0, 0, 607, 10, 2], "semantic": {"name": "rel_obj", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " rel_obj = rel_mgr.using(db).get(**params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L304_C16", "label": "rel_obj = get()", "type": "assigned_variable", "loc": [304, 304], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12", "vector": [14, 4, 0.2614, 0.0009, 4, 0.74, 1.0, 711, 3, 1, 0, 0, 607, 10, 3], "semantic": {"name": "rel_obj", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L305_C12", "label": "setattr()", "type": "expression", "loc": [305, 305], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [8, 3, 0.2623, 0.0009, 3, 0.54, 0.875, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, cache_name, rel_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L306_C12", "label": "return", "type": "return", "loc": [306, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "vector": [13, 3, 0.2631, 0.0009, 3, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rel_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "label": "__set__", "type": "function", "loc": [308, 364], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "vector": [2, 1, 0.2889, 0.049, 1, 0.12, 1.0, 145, 0, 3, 0, 0, 0, 0, 17], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n if instance is None:\n raise AttributeError(\"%s must be accessed via instance\" % self._field.name)\n\n # If null=True, we can assign null here, but otherwise the value needs\n # to be an instance of the related class.\n if value is None and self.field.null == False:\n raise ValueError('Cannot assign None: \"%s.%s\" does not allow null values.' %"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L309_C8", "label": "if", "type": "if", "loc": [309, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [4, 2, 0.2661, 0.0017, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\"%s must be accessed via instance\" % self._field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L314_C8", "label": "if", "type": "if", "loc": [314, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [4, 2, 0.2764, 0.0138, 2, 0.83, 0.2, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None and self.field.null == False:\n raise ValueError('Cannot assign None: \"%s.%s\" does not allow null values.' %\n (instance._meta.object_name, self.field.name))\n elif value is not None and not isinstance(value, self.field.rel.to):\n raise ValueError('Cannot assign \"%r\": \"%s.%s\" must be a \"%s\" instance.' %\n (value, instance._meta.object_name,\n self.field.name, self.field.rel.to._meta.object_name))\n elif value is not None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L317_C8", "label": "if", "type": "if", "loc": [317, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L314_C8", "vector": [4, 3, 0.2777, 0.0112, 3, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value is not None and not isinstance(value, self.field.rel.to):\n raise ValueError('Cannot assign \"%r\": \"%s.%s\" must be a \"%s\" instance.' %\n (value, instance._meta.object_name,\n self.field.name, self.field.rel.to._meta.object_name))\n elif value is not None:\n if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L321_C8", "label": "if", "type": "if", "loc": [321, 329], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L317_C8", "vector": [4, 4, 0.2794, 0.0077, 4, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value is not None:\n if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12", "label": "if", "type": "if", "loc": [322, 329], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L321_C8", "vector": [4, 5, 0.2799, 0.0069, 5, 0.88, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance._state.db is None:\n instance._state.db = router.db_for_write(instance.__class__, instance=value)\n elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L323_C16", "label": "instance._state.db = db_for_write()", "type": "assigned_variable", "loc": [323, 323], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12", "vector": [14, 6, 0.2777, 0.0009, 6, 0.56, 0.0, 172, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "instance._state.db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " instance._state.db = router.db_for_write(instance.__class__, instance=value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12", "label": "if", "type": "if", "loc": [324, 329], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12", "vector": [4, 6, 0.2807, 0.0052, 6, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value._state.db is None:\n value._state.db = router.db_for_write(value.__class__, instance=instance)\n elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L325_C16", "label": "value._state.db = db_for_write()", "type": "assigned_variable", "loc": [325, 325], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12", "vector": [14, 7, 0.2794, 0.0009, 7, 0.88, 0.0, 659, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "value._state.db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " value._state.db = router.db_for_write(value.__class__, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L326_C12", "label": "if", "type": "if", "loc": [326, 329], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12", "vector": [4, 7, 0.2816, 0.0034, 7, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif value._state.db is not None and instance._state.db is not None:\n if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L327_C16", "label": "if", "type": "if", "loc": [327, 329], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L326_C12", "vector": [4, 8, 0.282, 0.0026, 8, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not router.allow_relation(value, instance):\n raise ValueError('Cannot assign \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (value, instance._state.db, value._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8", "label": "if", "type": "if", "loc": [335, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [4, 2, 0.2954, 0.0155, 2, 0.83, 0.4, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n # Look up the previously-related object, which may still be available\n # since we've not yet cleared out the related field.\n # Use the cache directly, instead of the accessor; if we haven't\n # populated the cache, then we don't care - we're only accessing\n # the object to invalidate the accessor cache, so there's no\n # need to populate the cache just to expire it again.\n related = getattr(instance, self.field.get_cache_name(), None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L342_C12", "label": "related = getattr()", "type": "assigned_variable", "loc": [342, 342], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8", "vector": [14, 3, 0.2941, 0.0009, 3, 0.04, 0.0, 462, 3, 3, 0, 0, 121, 10, 2], "semantic": {"name": "related", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " related = getattr(instance, self.field.get_cache_name(), None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12", "label": "if", "type": "if", "loc": [347, 352], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8", "vector": [4, 3, 0.3005, 0.0052, 3, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if related:\n cache_name = self.field.related.get_cache_name()\n try:\n delattr(related, cache_name)\n except AttributeError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L348_C16", "label": "cache_name = get_cache_name()", "type": "assigned_variable", "loc": [348, 348], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12", "vector": [14, 4, 0.2992, 0.0009, 4, 0.4, 0.0, 377, 3, 0, 0, 0, 691, 10, 1], "semantic": {"name": "cache_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_cache_name", "annotation": ""}, "snippet": " cache_name = self.field.related.get_cache_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L349_C16", "label": "try", "type": "try", "loc": [349, 352], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12", "vector": [7, 4, 0.3014, 0.0034, 4, 0.4, 1.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n delattr(related, cache_name)\n except AttributeError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L350_C20", "label": "delattr()", "type": "expression", "loc": [350, 350], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L349_C16", "vector": [8, 5, 0.3009, 0.0009, 5, 0.62, 0.0, 779, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "delattr", "arg_names": [], "import_names": [], "rhs_call_name": "delattr", "annotation": ""}, "snippet": " delattr(related, cache_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8", "label": "try", "type": "try", "loc": [355, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [7, 2, 0.3065, 0.0034, 2, 0.83, 0.6, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n val = getattr(value, self.field.rel.get_related_field().attname)\n except AttributeError:\n val = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L356_C12", "label": "val = getattr()", "type": "assigned_variable", "loc": [356, 356], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8", "vector": [14, 3, 0.3061, 0.0009, 3, 0.62, 0.0, 618, 3, 2, 0, 0, 121, 10, 2], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " val = getattr(value, self.field.rel.get_related_field().attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L358_C12", "label": "val =", "type": "assigned_variable", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8", "vector": [14, 3, 0.3078, 0.0009, 3, 0.62, 0.0, 618, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " val = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L359_C8", "label": "setattr()", "type": "expression", "loc": [359, 359], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [8, 2, 0.3087, 0.0009, 2, 0.83, 0.8, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.field.attname, val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L364_C8", "label": "setattr()", "type": "expression", "loc": [364, 364], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "vector": [8, 2, 0.313, 0.0009, 2, 0.83, 1.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.field.get_cache_name(), value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "label": "ForeignRelatedObjectsDescriptor", "type": "class", "loc": [366, 461], "level": 0, "parent": null, "vector": [3, 0, 0.3555, 0.0825, 0, 0.66, 0.6875, 749, 0, 11, 0, 0, 186, 0, 36], "semantic": {"name": "ForeignRelatedObjectsDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForeignRelatedObjectsDescriptor(object):\n # This class provides the functionality that makes the related-object\n # managers available as attributes on a model class, for fields that have\n # multiple \"remote\" values and have a ForeignKey pointed at them by\n # some other model. In the example \"poll.choice_set\", the choice_set\n # attribute is a ForeignRelatedObjectsDescriptor instance.\n def __init__(self, related):\n self.related = related # RelatedObject instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L372_C4", "label": "__init__", "type": "function", "loc": [372, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "vector": [2, 1, 0.3203, 0.0017, 1, 0.29, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, related):\n self.related = related # RelatedObject instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L373_C8", "label": "self.related =", "type": "assigned_variable", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L372_C4", "vector": [14, 2, 0.3207, 0.0009, 2, 0.12, 0.0, 71, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related = related # RelatedObject instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4", "label": "__get__", "type": "function", "loc": [375, 380], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "vector": [2, 1, 0.3246, 0.0052, 1, 0.29, 0.25, 93, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "instance_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, instance_type=None):\n if instance is None:\n return self\n\n return self.create_manager(instance,\n self.related.model._default_manager.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L376_C8", "label": "if", "type": "if", "loc": [376, 377], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4", "vector": [4, 2, 0.3237, 0.0017, 2, 0.84, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L377_C12", "label": "return", "type": "return", "loc": [377, 377], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L376_C8", "vector": [13, 3, 0.3242, 0.0009, 3, 0.38, 0.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_99021:Return_L379_C8", "label": "return", "type": "return", "loc": [379, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4", "vector": [13, 2, 0.3263, 0.0017, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.create_manager(instance,\n self.related.model._default_manager.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "label": "__set__", "type": "function", "loc": [382, 391], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "vector": [2, 1, 0.3323, 0.0086, 1, 0.29, 0.5, 145, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")\n\n manager = self.__get__(instance)\n # If the foreign key can support nulls, then completely clear the related set.\n # Otherwise, just move the named objects into the set.\n if self.related.field.null:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L383_C8", "label": "if", "type": "if", "loc": [383, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "vector": [4, 2, 0.3298, 0.0017, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L386_C8", "label": "manager = __get__()", "type": "assigned_variable", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "vector": [14, 2, 0.3319, 0.0009, 2, 0.85, 0.3333, 748, 3, 1, 0, 0, 93, 10, 1], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "__get__", "annotation": ""}, "snippet": " manager = self.__get__(instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L389_C8", "label": "if", "type": "if", "loc": [389, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "vector": [4, 2, 0.3349, 0.0017, 2, 0.85, 0.6667, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.related.field.null:\n manager.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L390_C12", "label": "clear()", "type": "expression", "loc": [390, 390], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L389_C8", "vector": [8, 3, 0.3353, 0.0009, 3, 0.21, 0.0, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " manager.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L391_C8", "label": "add()", "type": "expression", "loc": [391, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "vector": [8, 2, 0.3362, 0.0009, 2, 0.85, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " manager.add(*value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4", "label": "delete_manager", "type": "function", "loc": [393, 400], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "vector": [2, 1, 0.3409, 0.0069, 1, 0.29, 0.75, 114, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "delete_manager", "arg_names": ["self", "instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def delete_manager(self, instance):\n \"\"\"\n Returns a queryset based on the related model's base manager (rather\n than the default manager, as returned by __get__). Used by\n Model.delete().\n \"\"\"\n return self.create_manager(instance,\n self.related.model._base_manager.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L394_C8", "label": "expression", "type": "expression", "loc": [394, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4", "vector": [8, 2, 0.3405, 0.0043, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a queryset based on the related model's base manager (rather\n than the default manager, as returned by __get__). Used by\n Model.delete().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L399_C8", "label": "return", "type": "return", "loc": [399, 400], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4", "vector": [13, 2, 0.3435, 0.0017, 2, 0.15, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.create_manager(instance,\n self.related.model._base_manager.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "label": "create_manager", "type": "function", "loc": [402, 461], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "vector": [2, 1, 0.371, 0.0516, 1, 0.29, 1.0, 7, 0, 3, 1, 0, 0, 0, 30], "semantic": {"name": "create_manager", "arg_names": ["self", "instance", "superclass"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_manager(self, instance, superclass):\n \"\"\"\n Creates the managers used by other methods (__get__() and delete()).\n \"\"\"\n rel_field = self.related.field\n rel_model = self.related.model\n\n class RelatedManager(superclass):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L403_C8", "label": "expression", "type": "expression", "loc": [403, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [8, 2, 0.3474, 0.0026, 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 Creates the managers used by other methods (__get__() and delete()).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L406_C8", "label": "rel_field =", "type": "assigned_variable", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.3491, 0.0009, 2, 0.87, 0.125, 889, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rel_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_field = self.related.field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L407_C8", "label": "rel_model =", "type": "assigned_variable", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.35, 0.0009, 2, 0.87, 0.25, 510, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rel_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_model = self.related.model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "label": "RelatedManager", "type": "class", "loc": [409, 453], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [3, 2, 0.3706, 0.0387, 2, 0.87, 0.375, 865, 0, 6, 0, 0, 770, 0, 27], "semantic": {"name": "RelatedManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class RelatedManager(superclass):\n def get_query_set(self):\n db = self._db or router.db_for_read(rel_model, instance=instance)\n return superclass.get_query_set(self).using(db).filter(**(self.core_filters))\n\n def add(self, *objs):\n for obj in objs:\n if not isinstance(obj, self.model):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12", "label": "get_query_set", "type": "function", "loc": [410, 412], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [2, 3, 0.3534, 0.0026, 3, 0.69, 0.0, 696, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_query_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_query_set(self):\n db = self._db or router.db_for_read(rel_model, instance=instance)\n return superclass.get_query_set(self).using(db).filter(**(self.core_filters))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L411_C16", "label": "db =", "type": "assigned_variable", "loc": [411, 411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12", "vector": [14, 4, 0.3534, 0.0009, 4, 0.53, 0.0, 761, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db = self._db or router.db_for_read(rel_model, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L412_C16", "label": "return", "type": "return", "loc": [412, 412], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12", "vector": [13, 4, 0.3543, 0.0009, 4, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return superclass.get_query_set(self).using(db).filter(**(self.core_filters))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L414_C12", "label": "add", "type": "function", "loc": [414, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [2, 3, 0.3581, 0.0052, 3, 0.69, 0.1429, 241, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "add", "arg_names": ["self", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, *objs):\n for obj in objs:\n if not isinstance(obj, self.model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)\n setattr(obj, rel_field.name, instance)\n obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "label": "for obj", "type": "for", "loc": [415, 419], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L414_C12", "vector": [6, 4, 0.3586, 0.0043, 4, 0.21, 0.0, 505, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n if not isinstance(obj, self.model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)\n setattr(obj, rel_field.name, instance)\n obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L416_C20", "label": "if", "type": "if", "loc": [416, 417], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "vector": [4, 5, 0.3581, 0.0017, 5, 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 isinstance(obj, self.model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L418_C20", "label": "setattr()", "type": "expression", "loc": [418, 418], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "vector": [8, 5, 0.3594, 0.0009, 5, 0.09, 0.5, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(obj, rel_field.name, instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L419_C20", "label": "save()", "type": "expression", "loc": [419, 419], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "vector": [8, 5, 0.3603, 0.0009, 5, 0.09, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L420_C12", "label": "add.alters_data =", "type": "assigned_variable", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [14, 3, 0.3611, 0.0009, 3, 0.69, 0.2857, 3, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "add.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " add.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "label": "create", "type": "function", "loc": [422, 425], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [2, 3, 0.3641, 0.0034, 3, 0.69, 0.4286, 316, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create(self, **kwargs):\n kwargs.update({rel_field.name: instance})\n db = router.db_for_write(rel_model, instance=instance)\n return super(RelatedManager, self.db_manager(db)).create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L423_C16", "label": "update()", "type": "expression", "loc": [423, 423], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "vector": [8, 4, 0.3637, 0.0009, 4, 0.24, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " kwargs.update({rel_field.name: instance})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L424_C16", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [424, 424], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "vector": [14, 4, 0.3646, 0.0009, 4, 0.24, 0.5, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(rel_model, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L425_C16", "label": "return", "type": "return", "loc": [425, 425], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "vector": [13, 4, 0.3654, 0.0009, 4, 0.24, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(RelatedManager, self.db_manager(db)).create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L426_C12", "label": "create.alters_data =", "type": "assigned_variable", "loc": [426, 426], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [14, 3, 0.3663, 0.0009, 3, 0.69, 0.5714, 770, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "create.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " create.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "label": "get_or_create", "type": "function", "loc": [428, 433], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [2, 3, 0.3702, 0.0052, 3, 0.69, 0.7143, 204, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_or_create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_or_create(self, **kwargs):\n # Update kwargs with the related object that this\n # ForeignRelatedObjectsDescriptor knows about.\n kwargs.update({rel_field.name: instance})\n db = router.db_for_write(rel_model, instance=instance)\n return super(RelatedManager, self.db_manager(db)).get_or_create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L431_C16", "label": "update()", "type": "expression", "loc": [431, 431], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "vector": [8, 4, 0.3706, 0.0009, 4, 0.3, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " kwargs.update({rel_field.name: instance})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L432_C16", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [432, 432], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "vector": [14, 4, 0.3715, 0.0009, 4, 0.3, 0.5, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(rel_model, instance=instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L433_C16", "label": "return", "type": "return", "loc": [433, 433], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "vector": [13, 4, 0.3723, 0.0009, 4, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(RelatedManager, self.db_manager(db)).get_or_create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L434_C12", "label": "get_or_create.alters_data =", "type": "assigned_variable", "loc": [434, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [14, 3, 0.3732, 0.0009, 3, 0.69, 0.8571, 482, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "get_or_create.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_or_create.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "label": "if", "type": "if", "loc": [437, 453], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "vector": [4, 3, 0.3826, 0.0146, 3, 0.69, 1.0, 0, 7, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rel_field.null:\n def remove(self, *objs):\n val = getattr(instance, rel_field.rel.get_related_field().attname)\n for obj in objs:\n # Is obj actually part of this descriptor set?\n if getattr(obj, rel_field.attname) == val:\n setattr(obj, rel_field.name, None)\n obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16", "label": "remove", "type": "function", "loc": [438, 446], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "vector": [2, 4, 0.3801, 0.0077, 4, 0.32, 0.0, 185, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "remove", "arg_names": ["self", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove(self, *objs):\n val = getattr(instance, rel_field.rel.get_related_field().attname)\n for obj in objs:\n # Is obj actually part of this descriptor set?\n if getattr(obj, rel_field.attname) == val:\n setattr(obj, rel_field.name, None)\n obj.save()\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L439_C20", "label": "val = getattr()", "type": "assigned_variable", "loc": [439, 439], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16", "vector": [14, 5, 0.3775, 0.0009, 5, 0.87, 0.0, 618, 3, 2, 0, 0, 121, 10, 2], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " val = getattr(instance, rel_field.rel.get_related_field().attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L440_C20", "label": "for obj", "type": "for", "loc": [440, 446], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16", "vector": [6, 5, 0.3809, 0.006, 5, 0.87, 1.0, 505, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n # Is obj actually part of this descriptor set?\n if getattr(obj, rel_field.attname) == val:\n setattr(obj, rel_field.name, None)\n obj.save()\n else:\n raise rel_field.rel.to.DoesNotExist(\"%r is not related to %r.\" % (obj, instance))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24", "label": "if", "type": "if", "loc": [442, 446], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L440_C20", "vector": [4, 6, 0.3818, 0.0043, 6, 0.39, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(obj, rel_field.attname) == val:\n setattr(obj, rel_field.name, None)\n obj.save()\n else:\n raise rel_field.rel.to.DoesNotExist(\"%r is not related to %r.\" % (obj, instance))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L443_C28", "label": "setattr()", "type": "expression", "loc": [443, 443], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24", "vector": [8, 7, 0.3809, 0.0009, 7, 0.04, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(obj, rel_field.name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L444_C28", "label": "save()", "type": "expression", "loc": [444, 444], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24", "vector": [8, 7, 0.3818, 0.0009, 7, 0.04, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L447_C16", "label": "remove.alters_data =", "type": "assigned_variable", "loc": [447, 447], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "vector": [14, 4, 0.3844, 0.0009, 4, 0.32, 0.3333, 434, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "remove.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remove.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L449_C16", "label": "clear", "type": "function", "loc": [449, 452], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "vector": [2, 4, 0.3874, 0.0034, 4, 0.32, 0.6667, 712, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "clear", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear(self):\n for obj in self.all():\n setattr(obj, rel_field.name, None)\n obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20", "label": "for obj", "type": "for", "loc": [450, 452], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L449_C16", "vector": [6, 5, 0.3878, 0.0026, 5, 0.58, 0.0, 505, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in self.all():\n setattr(obj, rel_field.name, None)\n obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L451_C24", "label": "setattr()", "type": "expression", "loc": [451, 451], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20", "vector": [8, 6, 0.3878, 0.0009, 6, 0.2, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(obj, rel_field.name, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L452_C24", "label": "save()", "type": "expression", "loc": [452, 452], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20", "vector": [8, 6, 0.3887, 0.0009, 6, 0.2, 1.0, 928, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "save", "arg_names": [], "import_names": [], "rhs_call_name": "save", "annotation": ""}, "snippet": " obj.save()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L453_C16", "label": "clear.alters_data =", "type": "assigned_variable", "loc": [453, 453], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "vector": [14, 4, 0.3895, 0.0009, 4, 0.32, 1.0, 56, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "clear.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clear.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L455_C8", "label": "manager = RelatedManager()", "type": "assigned_variable", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.3912, 0.0009, 2, 0.87, 0.5, 748, 3, 0, 0, 0, 865, 10, 1], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "RelatedManager", "annotation": ""}, "snippet": " manager = RelatedManager()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L456_C8", "label": "attname =", "type": "assigned_variable", "loc": [456, 456], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.3921, 0.0009, 2, 0.87, 0.625, 787, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "attname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attname = rel_field.rel.get_related_field().name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L457_C8", "label": "manager.core_filters =", "type": "assigned_variable", "loc": [457, 458], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.3934, 0.0017, 2, 0.87, 0.75, 87, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "manager.core_filters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " manager.core_filters = {'%s__%s' % (rel_field.name, attname):\n getattr(instance, attname)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L459_C8", "label": "manager.model =", "type": "assigned_variable", "loc": [459, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [14, 2, 0.3947, 0.0009, 2, 0.87, 0.875, 976, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "manager.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " manager.model = self.related.model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L461_C8", "label": "return", "type": "return", "loc": [461, 461], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "vector": [13, 2, 0.3964, 0.0009, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "label": "create_many_related_manager", "type": "function", "loc": [463, 639], "level": 0, "parent": null, "vector": [2, 0, 0.4738, 0.1522, 0, 0.66, 0.7188, 978, 0, 2, 1, 0, 0, 0, 58], "semantic": {"name": "create_many_related_manager", "arg_names": ["superclass", "rel"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_many_related_manager(superclass, rel=False):\n \"\"\"Creates a manager that subclasses 'superclass' (which is a Manager)\n and adds behavior for many-to-many related objects.\"\"\"\n through = rel.through\n class ManyRelatedManager(superclass):\n def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None,\n join_table=None, source_field_name=None, target_field_name=None,\n reverse=False):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L464_C4", "label": "expression", "type": "expression", "loc": [464, 465], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "vector": [8, 1, 0.3994, 0.0017, 1, 0.59, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Creates a manager that subclasses 'superclass' (which is a Manager)\n and adds behavior for many-to-many related objects.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L466_C4", "label": "through =", "type": "assigned_variable", "loc": [466, 466], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "vector": [14, 1, 0.4007, 0.0009, 1, 0.59, 0.3333, 14, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "through", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " through = rel.through"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "label": "ManyRelatedManager", "type": "class", "loc": [467, 637], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "vector": [3, 1, 0.4746, 0.147, 1, 0.59, 0.6667, 252, 0, 10, 0, 0, 770, 0, 58], "semantic": {"name": "ManyRelatedManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class ManyRelatedManager(superclass):\n def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None,\n join_table=None, source_field_name=None, target_field_name=None,\n reverse=False):\n super(ManyRelatedManager, self).__init__()\n self.core_filters = core_filters\n self.model = model\n self.symmetrical = symmetrical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "label": "__init__", "type": "function", "loc": [468, 482], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.4084, 0.0129, 2, 0.91, 0.0, 555, 0, 9, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "model", "core_filters", "instance", "symmetrical", "join_table", "source_field_name", "target_field_name", "reverse"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None,\n join_table=None, source_field_name=None, target_field_name=None,\n reverse=False):\n super(ManyRelatedManager, self).__init__()\n self.core_filters = core_filters\n self.model = model\n self.symmetrical = symmetrical\n self.instance = instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L471_C12", "label": "__init__()", "type": "expression", "loc": [471, 471], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [8, 3, 0.405, 0.0009, 3, 0.4, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(ManyRelatedManager, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L472_C12", "label": "self.core_filters =", "type": "assigned_variable", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4058, 0.0009, 3, 0.4, 0.1, 605, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.core_filters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.core_filters = core_filters"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L473_C12", "label": "self.model =", "type": "assigned_variable", "loc": [473, 473], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4067, 0.0009, 3, 0.4, 0.2, 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_99021:Assign_L474_C12", "label": "self.symmetrical =", "type": "assigned_variable", "loc": [474, 474], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4076, 0.0009, 3, 0.4, 0.3, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.symmetrical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.symmetrical = symmetrical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L475_C12", "label": "self.instance =", "type": "assigned_variable", "loc": [475, 475], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4084, 0.0009, 3, 0.4, 0.4, 330, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.instance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.instance = instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L476_C12", "label": "self.source_field_name =", "type": "assigned_variable", "loc": [476, 476], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4093, 0.0009, 3, 0.4, 0.5, 48, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.source_field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source_field_name = source_field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L477_C12", "label": "self.target_field_name =", "type": "assigned_variable", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4101, 0.0009, 3, 0.4, 0.6, 258, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.target_field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.target_field_name = target_field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L478_C12", "label": "self.through =", "type": "assigned_variable", "loc": [478, 478], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.411, 0.0009, 3, 0.4, 0.7, 654, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.through", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.through = through"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L479_C12", "label": "self._pk_val =", "type": "assigned_variable", "loc": [479, 479], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4119, 0.0009, 3, 0.4, 0.8, 874, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._pk_val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._pk_val = self.instance.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L480_C12", "label": "self.reverse =", "type": "assigned_variable", "loc": [480, 480], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [14, 3, 0.4127, 0.0009, 3, 0.4, 0.9, 690, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.reverse", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.reverse = reverse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L481_C12", "label": "if", "type": "if", "loc": [481, 482], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "vector": [4, 3, 0.414, 0.0017, 3, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._pk_val is None:\n raise ValueError(\"%r instance needs to have a primary key value before a many-to-many relationship can be used.\" % instance.__class__.__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8", "label": "get_query_set", "type": "function", "loc": [484, 486], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.417, 0.0026, 2, 0.91, 0.0909, 696, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "get_query_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_query_set(self):\n db = self._db or router.db_for_read(self.instance.__class__, instance=self.instance)\n return superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L485_C12", "label": "db =", "type": "assigned_variable", "loc": [485, 485], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8", "vector": [14, 3, 0.417, 0.0009, 3, 0.3, 0.0, 761, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " db = self._db or router.db_for_read(self.instance.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L486_C12", "label": "return", "type": "return", "loc": [486, 486], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8", "vector": [13, 3, 0.4179, 0.0009, 3, 0.3, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return superclass.get_query_set(self).using(db)._next_is_sticky().filter(**(self.core_filters))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "label": "if", "type": "if", "loc": [490, 505], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [4, 2, 0.4278, 0.0138, 2, 0.91, 0.1818, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rel.through._meta.auto_created:\n def add(self, *objs):\n self._add_items(self.source_field_name, self.target_field_name, *objs)\n\n # If this is a symmetrical m2m relation to self, add the mirror entry in the m2m table\n if self.symmetrical:\n self._add_items(self.target_field_name, self.source_field_name, *objs)\n add.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12", "label": "add", "type": "function", "loc": [491, 496], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "vector": [2, 3, 0.4243, 0.0052, 3, 0.1, 0.0, 241, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": ["self", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, *objs):\n self._add_items(self.source_field_name, self.target_field_name, *objs)\n\n # If this is a symmetrical m2m relation to self, add the mirror entry in the m2m table\n if self.symmetrical:\n self._add_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L492_C16", "label": "_add_items()", "type": "expression", "loc": [492, 492], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12", "vector": [8, 4, 0.423, 0.0009, 4, 0.48, 0.0, 784, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_items", "arg_names": [], "import_names": [], "rhs_call_name": "_add_items", "annotation": ""}, "snippet": " self._add_items(self.source_field_name, self.target_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L495_C16", "label": "if", "type": "if", "loc": [495, 496], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12", "vector": [4, 4, 0.4261, 0.0017, 4, 0.48, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.symmetrical:\n self._add_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L496_C20", "label": "_add_items()", "type": "expression", "loc": [496, 496], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L495_C16", "vector": [8, 5, 0.4265, 0.0009, 5, 0.76, 0.0, 784, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_add_items", "arg_names": [], "import_names": [], "rhs_call_name": "_add_items", "annotation": ""}, "snippet": " self._add_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L497_C12", "label": "add.alters_data =", "type": "assigned_variable", "loc": [497, 497], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "vector": [14, 3, 0.4273, 0.0009, 3, 0.1, 0.3333, 3, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "add.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " add.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12", "label": "remove", "type": "function", "loc": [499, 504], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "vector": [2, 3, 0.4312, 0.0052, 3, 0.1, 0.6667, 185, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "remove", "arg_names": ["self", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove(self, *objs):\n self._remove_items(self.source_field_name, self.target_field_name, *objs)\n\n # If this is a symmetrical m2m relation to self, remove the mirror entry in the m2m table\n if self.symmetrical:\n self._remove_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L500_C16", "label": "_remove_items()", "type": "expression", "loc": [500, 500], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12", "vector": [8, 4, 0.4299, 0.0009, 4, 0.48, 0.0, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_remove_items", "arg_names": [], "import_names": [], "rhs_call_name": "_remove_items", "annotation": ""}, "snippet": " self._remove_items(self.source_field_name, self.target_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L503_C16", "label": "if", "type": "if", "loc": [503, 504], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12", "vector": [4, 4, 0.4329, 0.0017, 4, 0.48, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.symmetrical:\n self._remove_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L504_C20", "label": "_remove_items()", "type": "expression", "loc": [504, 504], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L503_C16", "vector": [8, 5, 0.4334, 0.0009, 5, 0.07, 0.0, 415, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_remove_items", "arg_names": [], "import_names": [], "rhs_call_name": "_remove_items", "annotation": ""}, "snippet": " self._remove_items(self.target_field_name, self.source_field_name, *objs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L505_C12", "label": "remove.alters_data =", "type": "assigned_variable", "loc": [505, 505], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "vector": [14, 3, 0.4342, 0.0009, 3, 0.1, 1.0, 434, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "remove.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remove.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8", "label": "clear", "type": "function", "loc": [507, 512], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.4381, 0.0052, 2, 0.91, 0.2727, 712, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "clear", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear(self):\n self._clear_items(self.source_field_name)\n\n # If this is a symmetrical m2m relation to self, clear the mirror entry in the m2m table\n if self.symmetrical:\n self._clear_items(self.target_field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L508_C12", "label": "_clear_items()", "type": "expression", "loc": [508, 508], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8", "vector": [8, 3, 0.4368, 0.0009, 3, 0.13, 0.0, 95, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_items", "arg_names": [], "import_names": [], "rhs_call_name": "_clear_items", "annotation": ""}, "snippet": " self._clear_items(self.source_field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L511_C12", "label": "if", "type": "if", "loc": [511, 512], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8", "vector": [4, 3, 0.4398, 0.0017, 3, 0.13, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.symmetrical:\n self._clear_items(self.target_field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L512_C16", "label": "_clear_items()", "type": "expression", "loc": [512, 512], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L511_C12", "vector": [8, 4, 0.4402, 0.0009, 4, 0.01, 0.0, 95, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_items", "arg_names": [], "import_names": [], "rhs_call_name": "_clear_items", "annotation": ""}, "snippet": " self._clear_items(self.target_field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L513_C8", "label": "clear.alters_data =", "type": "assigned_variable", "loc": [513, 513], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [14, 2, 0.4411, 0.0009, 2, 0.91, 0.3636, 56, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "clear.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " clear.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "label": "create", "type": "function", "loc": [515, 524], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.4467, 0.0086, 2, 0.91, 0.4545, 316, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create(self, **kwargs):\n # This check needs to be done here, since we can't later remove this\n # from the method lookup table, as we do with add and remove.\n if not rel.through._meta.auto_created:\n opts = through._meta\n raise AttributeError(\"Cannot use create() on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))\n db = router.db_for_write(self.instance.__class__, instance=self.instance)\n new_obj = super(ManyRelatedManager, self.db_manager(db)).create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L518_C12", "label": "if", "type": "if", "loc": [518, 520], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "vector": [4, 3, 0.4463, 0.0026, 3, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not rel.through._meta.auto_created:\n opts = through._meta\n raise AttributeError(\"Cannot use create() on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L519_C16", "label": "opts =", "type": "assigned_variable", "loc": [519, 519], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L518_C12", "vector": [14, 4, 0.4463, 0.0009, 4, 0.58, 0.0, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = through._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L521_C12", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [521, 521], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "vector": [14, 3, 0.448, 0.0009, 3, 0.78, 0.25, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(self.instance.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L522_C12", "label": "new_obj = create()", "type": "assigned_variable", "loc": [522, 522], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "vector": [14, 3, 0.4488, 0.0009, 3, 0.78, 0.5, 237, 3, 1, 0, 0, 316, 10, 3], "semantic": {"name": "new_obj", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " new_obj = super(ManyRelatedManager, self.db_manager(db)).create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L523_C12", "label": "add()", "type": "expression", "loc": [523, 523], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "vector": [8, 3, 0.4497, 0.0009, 3, 0.78, 0.75, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(new_obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L524_C12", "label": "return", "type": "return", "loc": [524, 524], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "vector": [13, 3, 0.4506, 0.0009, 3, 0.78, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return new_obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L525_C8", "label": "create.alters_data =", "type": "assigned_variable", "loc": [525, 525], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [14, 2, 0.4514, 0.0009, 2, 0.91, 0.5455, 770, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "create.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " create.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "label": "get_or_create", "type": "function", "loc": [527, 535], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.4566, 0.0077, 2, 0.91, 0.6364, 204, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_or_create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_or_create(self, **kwargs):\n db = router.db_for_write(self.instance.__class__, instance=self.instance)\n obj, created = \\\n super(ManyRelatedManager, self.db_manager(db)).get_or_create(**kwargs)\n # We only need to add() if created because if we got an object back\n # from get() then the relationship already exists.\n if created:\n self.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L528_C12", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [528, 528], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "vector": [14, 3, 0.454, 0.0009, 3, 0.74, 0.0, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(self.instance.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L529_C12", "label": "obj, created = get_or_create()", "type": "assigned_variable", "loc": [529, 530], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "vector": [14, 3, 0.4553, 0.0017, 3, 0.74, 0.3333, 600, 3, 1, 0, 0, 204, 10, 3], "semantic": {"name": "obj, created", "arg_names": [], "import_names": [], "rhs_call_name": "get_or_create", "annotation": ""}, "snippet": " obj, created = \\\n super(ManyRelatedManager, self.db_manager(db)).get_or_create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L533_C12", "label": "if", "type": "if", "loc": [533, 534], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "vector": [4, 3, 0.4587, 0.0017, 3, 0.74, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if created:\n self.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L534_C16", "label": "add()", "type": "expression", "loc": [534, 534], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L533_C12", "vector": [8, 4, 0.4592, 0.0009, 4, 0.03, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L535_C12", "label": "return", "type": "return", "loc": [535, 535], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "vector": [13, 3, 0.46, 0.0009, 3, 0.74, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj, created"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L536_C8", "label": "get_or_create.alters_data =", "type": "assigned_variable", "loc": [536, 536], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [14, 2, 0.4609, 0.0009, 2, 0.91, 0.7273, 482, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "get_or_create.alters_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_or_create.alters_data = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8", "label": "_add_items", "type": "function", "loc": [538, 583], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.4819, 0.0396, 2, 0.91, 0.8182, 784, 0, 4, 0, 0, 0, 0, 17], "semantic": {"name": "_add_items", "arg_names": ["self", "source_field_name", "target_field_name", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_items(self, source_field_name, target_field_name, *objs):\n # join_table: name of the m2m link table\n # source_field_name: the PK fieldname in join_table for the source object\n # target_field_name: the PK fieldname in join_table for the target object\n # *objs - objects to add. Either object instances, or primary keys of object instances.\n\n # If there aren't any objects, there is nothing to do.\n from django.db.models import Model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L545_C12", "label": "from django.db.models import Model", "type": "import", "loc": [545, 545], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8", "vector": [1, 3, 0.4686, 0.0009, 3, 0.11, 0.0, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["Model"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.models import Model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "label": "if", "type": "if", "loc": [546, 583], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8", "vector": [4, 3, 0.4854, 0.0327, 3, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 17], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if objs:\n new_ids = set()\n for obj in objs:\n if isinstance(obj, self.model):\n if not router.allow_relation(obj, self.instance):\n raise ValueError('Cannot add \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (obj, self.instance._state.db, obj._state.db))\n new_ids.add(obj.pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L547_C16", "label": "new_ids = set()", "type": "assigned_variable", "loc": [547, 547], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [14, 4, 0.4703, 0.0009, 4, 0.57, 0.0, 884, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "new_ids", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " new_ids = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L548_C16", "label": "for obj", "type": "for", "loc": [548, 557], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [6, 4, 0.4751, 0.0086, 4, 0.57, 0.125, 505, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n if isinstance(obj, self.model):\n if not router.allow_relation(obj, self.instance):\n raise ValueError('Cannot add \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (obj, self.instance._state.db, obj._state.db))\n new_ids.add(obj.pk)\n elif isinstance(obj, Model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "label": "if", "type": "if", "loc": [549, 557], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L548_C16", "vector": [4, 5, 0.4755, 0.0077, 5, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(obj, self.model):\n if not router.allow_relation(obj, self.instance):\n raise ValueError('Cannot add \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (obj, self.instance._state.db, obj._state.db))\n new_ids.add(obj.pk)\n elif isinstance(obj, Model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L550_C24", "label": "if", "type": "if", "loc": [550, 552], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "vector": [4, 6, 0.4738, 0.0026, 6, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not router.allow_relation(obj, self.instance):\n raise ValueError('Cannot add \"%r\": instance is on database \"%s\", value is on database \"%s\"' %\n (obj, self.instance._state.db, obj._state.db))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L553_C24", "label": "add()", "type": "expression", "loc": [553, 553], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "vector": [8, 6, 0.4755, 0.0009, 6, 0.68, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " new_ids.add(obj.pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L554_C20", "label": "if", "type": "if", "loc": [554, 557], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "vector": [4, 6, 0.4776, 0.0034, 6, 0.68, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(obj, Model):\n raise TypeError(\"'%s' instance expected\" % self.model._meta.object_name)\n else:\n new_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L557_C24", "label": "add()", "type": "expression", "loc": [557, 557], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L554_C20", "vector": [8, 7, 0.4789, 0.0009, 7, 0.26, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " new_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L558_C16", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [558, 558], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [14, 4, 0.4798, 0.0009, 4, 0.57, 0.25, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(self.through.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L559_C16", "label": "vals = values_list()", "type": "assigned_variable", "loc": [559, 559], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [14, 4, 0.4807, 0.0009, 4, 0.57, 0.375, 17, 3, 2, 0, 0, 253, 10, 2], "semantic": {"name": "vals", "arg_names": [], "import_names": [], "rhs_call_name": "values_list", "annotation": ""}, "snippet": " vals = self.through._default_manager.using(db).values_list(target_field_name, flat=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L560_C16", "label": "vals = filter()", "type": "assigned_variable", "loc": [560, 563], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [14, 4, 0.4828, 0.0034, 4, 0.57, 0.5, 17, 3, 1, 0, 0, 526, 10, 1], "semantic": {"name": "vals", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": " vals = vals.filter(**{\n source_field_name: self._pk_val,\n '%s__in' % target_field_name: new_ids,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L564_C16", "label": "new_ids =", "type": "assigned_variable", "loc": [564, 564], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [14, 4, 0.485, 0.0009, 4, 0.57, 0.625, 884, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "new_ids", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " new_ids = new_ids - set(vals)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L566_C16", "label": "if", "type": "if", "loc": [566, 571], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [4, 4, 0.4888, 0.0052, 4, 0.57, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are inserting the\n # duplicate data row for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action='pre_add',\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=new_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L569_C20", "label": "send()", "type": "expression", "loc": [569, 571], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L566_C16", "vector": [8, 5, 0.4901, 0.0026, 5, 0.12, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action='pre_add',\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=new_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L573_C16", "label": "for obj_id", "type": "for", "loc": [573, 577], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [6, 4, 0.4944, 0.0043, 4, 0.57, 0.875, 670, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "obj_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj_id in new_ids:\n self.through._default_manager.using(db).create(**{\n '%s_id' % source_field_name: self._pk_val,\n '%s_id' % target_field_name: obj_id,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L574_C20", "label": "create()", "type": "expression", "loc": [574, 577], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L573_C16", "vector": [8, 5, 0.4948, 0.0034, 5, 0.67, 0.0, 316, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": " self.through._default_manager.using(db).create(**{\n '%s_id' % source_field_name: self._pk_val,\n '%s_id' % target_field_name: obj_id,\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L578_C16", "label": "if", "type": "if", "loc": [578, 583], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "vector": [4, 4, 0.4991, 0.0052, 4, 0.57, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are inserting the\n # duplicate data row for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action='post_add',\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=new_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L581_C20", "label": "send()", "type": "expression", "loc": [581, 583], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L578_C16", "vector": [8, 5, 0.5004, 0.0026, 5, 0.59, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action='post_add',\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=new_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L585_C8", "label": "_remove_items", "type": "function", "loc": [585, 618], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.5172, 0.0292, 2, 0.91, 0.9091, 415, 0, 4, 0, 0, 0, 0, 10], "semantic": {"name": "_remove_items", "arg_names": ["self", "source_field_name", "target_field_name", "objs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _remove_items(self, source_field_name, target_field_name, *objs):\n # source_col_name: the PK colname in join_table for the source object\n # target_col_name: the PK colname in join_table for the target object\n # *objs - objects to remove\n\n # If there aren't any objects, there is nothing to do.\n if objs:\n # Check that all the objects are of the right type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "label": "if", "type": "if", "loc": [591, 618], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L585_C8", "vector": [4, 3, 0.5198, 0.0241, 3, 0.3, 0.0, 0, 2, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if objs:\n # Check that all the objects are of the right type\n old_ids = set()\n for obj in objs:\n if isinstance(obj, self.model):\n old_ids.add(obj.pk)\n else:\n old_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L593_C16", "label": "old_ids = set()", "type": "assigned_variable", "loc": [593, 593], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [14, 4, 0.5099, 0.0009, 4, 0.69, 0.0, 308, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "old_ids", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " old_ids = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L594_C16", "label": "for obj", "type": "for", "loc": [594, 598], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [6, 4, 0.5125, 0.0043, 4, 0.69, 0.2, 505, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj in objs:\n if isinstance(obj, self.model):\n old_ids.add(obj.pk)\n else:\n old_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20", "label": "if", "type": "if", "loc": [595, 598], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L594_C16", "vector": [4, 5, 0.5129, 0.0034, 5, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(obj, self.model):\n old_ids.add(obj.pk)\n else:\n old_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L596_C24", "label": "add()", "type": "expression", "loc": [596, 596], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20", "vector": [8, 6, 0.5125, 0.0009, 6, 0.62, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " old_ids.add(obj.pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L598_C24", "label": "add()", "type": "expression", "loc": [598, 598], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20", "vector": [8, 6, 0.5142, 0.0009, 6, 0.62, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " old_ids.add(obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L600_C16", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [600, 600], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [14, 4, 0.5159, 0.0009, 4, 0.69, 0.4, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(self.through.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L602_C16", "label": "if", "type": "if", "loc": [602, 607], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [4, 4, 0.5198, 0.0052, 4, 0.69, 0.6, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are deleting the\n # duplicate data row for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action=\"pre_remove\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=old_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L605_C20", "label": "send()", "type": "expression", "loc": [605, 607], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L602_C16", "vector": [8, 5, 0.5211, 0.0026, 5, 0.03, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action=\"pre_remove\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=old_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L609_C16", "label": "delete()", "type": "expression", "loc": [609, 612], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [8, 4, 0.5249, 0.0034, 4, 0.69, 0.8, 266, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " self.through._default_manager.using(db).filter(**{\n source_field_name: self._pk_val,\n '%s__in' % target_field_name: old_ids\n }).delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L613_C16", "label": "if", "type": "if", "loc": [613, 618], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "vector": [4, 4, 0.5292, 0.0052, 4, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are deleting the\n # duplicate data row for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action=\"post_remove\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=old_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L616_C20", "label": "send()", "type": "expression", "loc": [616, 618], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L613_C16", "vector": [8, 5, 0.5305, 0.0026, 5, 0.98, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action=\"post_remove\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=old_ids, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "label": "_clear_items", "type": "function", "loc": [620, 637], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "vector": [2, 2, 0.5404, 0.0155, 2, 0.91, 1.0, 95, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_clear_items", "arg_names": ["self", "source_field_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _clear_items(self, source_field_name):\n db = router.db_for_write(self.through.__class__, instance=self.instance)\n # source_col_name: the PK colname in join_table for the source object\n if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are clearing the\n # duplicate data rows for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action=\"pre_clear\",\n instance=self.instance, reverse=self.reverse,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L621_C12", "label": "db = db_for_write()", "type": "assigned_variable", "loc": [621, 621], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "vector": [14, 3, 0.534, 0.0009, 3, 0.11, 0.0, 761, 3, 2, 0, 0, 395, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "db_for_write", "annotation": ""}, "snippet": " db = router.db_for_write(self.through.__class__, instance=self.instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L623_C12", "label": "if", "type": "if", "loc": [623, 628], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "vector": [4, 3, 0.5378, 0.0052, 3, 0.11, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are clearing the\n # duplicate data rows for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action=\"pre_clear\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=None, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L626_C16", "label": "send()", "type": "expression", "loc": [626, 628], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L623_C12", "vector": [8, 4, 0.5391, 0.0026, 4, 0.04, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action=\"pre_clear\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=None, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L629_C12", "label": "delete()", "type": "expression", "loc": [629, 631], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "vector": [8, 3, 0.5417, 0.0026, 3, 0.11, 0.6667, 266, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " self.through._default_manager.using(db).filter(**{\n source_field_name: self._pk_val\n }).delete()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L632_C12", "label": "if", "type": "if", "loc": [632, 637], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "vector": [4, 3, 0.5456, 0.0052, 3, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.reverse or source_field_name == self.source_field_name:\n # Don't send the signal when we are clearing the\n # duplicate data rows for symmetrical reverse entries.\n signals.m2m_changed.send(sender=rel.through, action=\"post_clear\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=None, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L635_C16", "label": "send()", "type": "expression", "loc": [635, 637], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L632_C12", "vector": [8, 4, 0.5469, 0.0026, 4, 0.79, 0.0, 826, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "send", "arg_names": [], "import_names": [], "rhs_call_name": "send", "annotation": ""}, "snippet": " signals.m2m_changed.send(sender=rel.through, action=\"post_clear\",\n instance=self.instance, reverse=self.reverse,\n model=self.model, pk_set=None, using=db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L639_C4", "label": "return", "type": "return", "loc": [639, 639], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "vector": [13, 1, 0.5494, 0.0009, 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 ManyRelatedManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "label": "ManyRelatedObjectsDescriptor", "type": "class", "loc": [641, 683], "level": 0, "parent": null, "vector": [3, 0, 0.5692, 0.037, 0, 0.66, 0.75, 348, 0, 3, 0, 0, 186, 0, 10], "semantic": {"name": "ManyRelatedObjectsDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ManyRelatedObjectsDescriptor(object):\n # This class provides the functionality that makes the related-object\n # managers available as attributes on a model class, for fields that have\n # multiple \"remote\" values and have a ManyToManyField pointed at them by\n # some other model (rather than having a ManyToManyField themselves).\n # In the example \"publication.article_set\", the article_set attribute is a\n # ManyRelatedObjectsDescriptor instance.\n def __init__(self, related):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L648_C4", "label": "__init__", "type": "function", "loc": [648, 649], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "vector": [2, 1, 0.5576, 0.0017, 1, 0.02, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, related):\n self.related = related # RelatedObject instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L649_C8", "label": "self.related =", "type": "assigned_variable", "loc": [649, 649], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L648_C4", "vector": [14, 2, 0.558, 0.0009, 2, 0.15, 0.0, 71, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.related", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related = related # RelatedObject instance"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "label": "__get__", "type": "function", "loc": [651, 671], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "vector": [2, 1, 0.5684, 0.0181, 1, 0.02, 0.5, 93, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "instance_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, instance_type=None):\n if instance is None:\n return self\n\n # Dynamically create a class that subclasses the related\n # model's default manager.\n rel_model = self.related.model\n superclass = rel_model._default_manager.__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L652_C8", "label": "if", "type": "if", "loc": [652, 653], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [4, 2, 0.561, 0.0017, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L653_C12", "label": "return", "type": "return", "loc": [653, 653], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L652_C8", "vector": [13, 3, 0.5615, 0.0009, 3, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L657_C8", "label": "rel_model =", "type": "assigned_variable", "loc": [657, 657], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [14, 2, 0.5649, 0.0009, 2, 0.48, 0.2, 510, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rel_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_model = self.related.model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L658_C8", "label": "superclass =", "type": "assigned_variable", "loc": [658, 658], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [14, 2, 0.5658, 0.0009, 2, 0.48, 0.4, 770, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "superclass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " superclass = rel_model._default_manager.__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L659_C8", "label": "RelatedManager = create_many_related_manager()", "type": "assigned_variable", "loc": [659, 659], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [14, 2, 0.5666, 0.0009, 2, 0.48, 0.6, 865, 3, 2, 0, 0, 978, 10, 1], "semantic": {"name": "RelatedManager", "arg_names": [], "import_names": [], "rhs_call_name": "create_many_related_manager", "annotation": ""}, "snippet": " RelatedManager = create_many_related_manager(superclass, self.related.field.rel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L661_C8", "label": "manager = RelatedManager()", "type": "assigned_variable", "loc": [661, 669], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [14, 2, 0.5718, 0.0077, 2, 0.48, 0.8, 748, 3, 7, 0, 0, 865, 10, 4], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "RelatedManager", "annotation": ""}, "snippet": " manager = RelatedManager(\n model=rel_model,\n core_filters={'%s__pk' % self.related.field.name: instance._get_pk_val()},\n instance=instance,\n symmetrical=False,\n source_field_name=self.related.field.m2m_reverse_field_name(),\n target_field_name=self.related.field.m2m_field_name(),\n reverse=True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L671_C8", "label": "return", "type": "return", "loc": [671, 671], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "vector": [13, 2, 0.577, 0.0009, 2, 0.48, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "label": "__set__", "type": "function", "loc": [673, 683], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "vector": [2, 1, 0.583, 0.0095, 1, 0.02, 1.0, 145, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")\n\n if not self.related.field.rel.through._meta.auto_created:\n opts = self.related.field.rel.through._meta\n raise AttributeError(\"Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L674_C8", "label": "if", "type": "if", "loc": [674, 675], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "vector": [4, 2, 0.58, 0.0017, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L677_C8", "label": "if", "type": "if", "loc": [677, 679], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "vector": [4, 2, 0.583, 0.0026, 2, 0.66, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.related.field.rel.through._meta.auto_created:\n opts = self.related.field.rel.through._meta\n raise AttributeError(\"Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L678_C12", "label": "opts =", "type": "assigned_variable", "loc": [678, 678], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L677_C8", "vector": [14, 3, 0.583, 0.0009, 3, 0.92, 0.0, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = self.related.field.rel.through._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L681_C8", "label": "manager = __get__()", "type": "assigned_variable", "loc": [681, 681], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "vector": [14, 2, 0.5856, 0.0009, 2, 0.66, 0.5, 748, 3, 1, 0, 0, 93, 10, 1], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "__get__", "annotation": ""}, "snippet": " manager = self.__get__(instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L682_C8", "label": "clear()", "type": "expression", "loc": [682, 682], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "vector": [8, 2, 0.5864, 0.0009, 2, 0.66, 0.75, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " manager.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L683_C8", "label": "add()", "type": "expression", "loc": [683, 683], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "vector": [8, 2, 0.5873, 0.0009, 2, 0.66, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " manager.add(*value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "label": "ReverseManyRelatedObjectsDescriptor", "type": "class", "loc": [686, 735], "level": 0, "parent": null, "vector": [3, 0, 0.6109, 0.043, 0, 0.66, 0.7812, 940, 0, 4, 0, 0, 186, 0, 12], "semantic": {"name": "ReverseManyRelatedObjectsDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ReverseManyRelatedObjectsDescriptor(object):\n # This class provides the functionality that makes the related-object\n # managers available as attributes on a model class, for fields that have\n # multiple \"remote\" values and have a ManyToManyField defined in their\n # model (rather than having another model pointed *at* them).\n # In the example \"article.publications\", the publications attribute is a\n # ReverseManyRelatedObjectsDescriptor instance.\n def __init__(self, m2m_field):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L693_C4", "label": "__init__", "type": "function", "loc": [693, 694], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "vector": [2, 1, 0.5963, 0.0017, 1, 0.7, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "m2m_field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, m2m_field):\n self.field = m2m_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L694_C8", "label": "self.field =", "type": "assigned_variable", "loc": [694, 694], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L693_C4", "vector": [14, 2, 0.5967, 0.0009, 2, 0.6, 0.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = m2m_field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L696_C4", "label": "_through", "type": "function", "loc": [696, 700], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "vector": [2, 1, 0.6002, 0.0043, 1, 0.7, 0.25, 684, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_through", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _through(self):\n # through is provided so that you have easy access to the through\n # model (Book.authors.through) for inlines, etc. This is done as\n # a property to ensure that the fully resolved value is returned.\n return self.field.rel.through"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L700_C8", "label": "return", "type": "return", "loc": [700, 700], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L696_C4", "vector": [13, 2, 0.6019, 0.0009, 2, 0.73, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.field.rel.through"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L701_C4", "label": "through = property()", "type": "assigned_variable", "loc": [701, 701], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "vector": [14, 1, 0.6028, 0.0009, 1, 0.7, 0.5, 14, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "through", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " through = property(_through)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "label": "__get__", "type": "function", "loc": [703, 723], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "vector": [2, 1, 0.6131, 0.0181, 1, 0.7, 0.75, 93, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "instance_type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, instance_type=None):\n if instance is None:\n return self\n\n # Dynamically create a class that subclasses the related\n # model's default manager.\n rel_model=self.field.rel.to\n superclass = rel_model._default_manager.__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L704_C8", "label": "if", "type": "if", "loc": [704, 705], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [4, 2, 0.6058, 0.0017, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L705_C12", "label": "return", "type": "return", "loc": [705, 705], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L704_C8", "vector": [13, 3, 0.6062, 0.0009, 3, 0.84, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L709_C8", "label": "rel_model =", "type": "assigned_variable", "loc": [709, 709], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [14, 2, 0.6096, 0.0009, 2, 0.98, 0.2, 510, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "rel_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rel_model=self.field.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L710_C8", "label": "superclass =", "type": "assigned_variable", "loc": [710, 710], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [14, 2, 0.6105, 0.0009, 2, 0.98, 0.4, 770, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "superclass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " superclass = rel_model._default_manager.__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L711_C8", "label": "RelatedManager = create_many_related_manager()", "type": "assigned_variable", "loc": [711, 711], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [14, 2, 0.6113, 0.0009, 2, 0.98, 0.6, 865, 3, 2, 0, 0, 978, 10, 1], "semantic": {"name": "RelatedManager", "arg_names": [], "import_names": [], "rhs_call_name": "create_many_related_manager", "annotation": ""}, "snippet": " RelatedManager = create_many_related_manager(superclass, self.field.rel)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L713_C8", "label": "manager = RelatedManager()", "type": "assigned_variable", "loc": [713, 721], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [14, 2, 0.6165, 0.0077, 2, 0.98, 0.8, 748, 3, 7, 0, 0, 865, 10, 5], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "RelatedManager", "annotation": ""}, "snippet": " manager = RelatedManager(\n model=rel_model,\n core_filters={'%s__pk' % self.field.related_query_name(): instance._get_pk_val()},\n instance=instance,\n symmetrical=self.field.rel.symmetrical,\n source_field_name=self.field.m2m_field_name(),\n target_field_name=self.field.m2m_reverse_field_name(),\n reverse=False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L723_C8", "label": "return", "type": "return", "loc": [723, 723], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "vector": [13, 2, 0.6217, 0.0009, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "label": "__set__", "type": "function", "loc": [725, 735], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "vector": [2, 1, 0.6277, 0.0095, 1, 0.7, 1.0, 145, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")\n\n if not self.field.rel.through._meta.auto_created:\n opts = self.field.rel.through._meta\n raise AttributeError(\"Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L726_C8", "label": "if", "type": "if", "loc": [726, 727], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "vector": [4, 2, 0.6247, 0.0017, 2, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance is None:\n raise AttributeError(\"Manager must be accessed via instance\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L729_C8", "label": "if", "type": "if", "loc": [729, 731], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "vector": [4, 2, 0.6277, 0.0026, 2, 0.32, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.field.rel.through._meta.auto_created:\n opts = self.field.rel.through._meta\n raise AttributeError(\"Cannot set values on a ManyToManyField which specifies an intermediary model. Use %s.%s's Manager instead.\" % (opts.app_label, opts.object_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L730_C12", "label": "opts =", "type": "assigned_variable", "loc": [730, 730], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L729_C8", "vector": [14, 3, 0.6277, 0.0009, 3, 0.11, 0.0, 631, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " opts = self.field.rel.through._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L733_C8", "label": "manager = __get__()", "type": "assigned_variable", "loc": [733, 733], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "vector": [14, 2, 0.6303, 0.0009, 2, 0.32, 0.5, 748, 3, 1, 0, 0, 93, 10, 1], "semantic": {"name": "manager", "arg_names": [], "import_names": [], "rhs_call_name": "__get__", "annotation": ""}, "snippet": " manager = self.__get__(instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L734_C8", "label": "clear()", "type": "expression", "loc": [734, 734], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "vector": [8, 2, 0.6311, 0.0009, 2, 0.32, 0.75, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " manager.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L735_C8", "label": "add()", "type": "expression", "loc": [735, 735], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "vector": [8, 2, 0.632, 0.0009, 2, 0.32, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " manager.add(*value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "label": "ManyToOneRel", "type": "class", "loc": [737, 766], "level": 0, "parent": null, "vector": [3, 0, 0.6462, 0.0258, 0, 0.66, 0.8125, 163, 0, 3, 0, 0, 186, 0, 3], "semantic": {"name": "ManyToOneRel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ManyToOneRel(object):\n def __init__(self, to, field_name, related_name=None, limit_choices_to=None,\n parent_link=False, on_delete=None):\n try:\n to._meta\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"'to' must be either a model, a model name or the string %r\" % RECURSIVE_RELATIONSHIP_CONSTANT\n self.to, self.field_name = to, field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "label": "__init__", "type": "function", "loc": [738, 751], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "vector": [2, 1, 0.6402, 0.012, 1, 0.92, 0.0, 555, 0, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "to", "field_name", "related_name", "limit_choices_to", "parent_link", "on_delete"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, field_name, related_name=None, limit_choices_to=None,\n parent_link=False, on_delete=None):\n try:\n to._meta\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"'to' must be either a model, a model name or the string %r\" % RECURSIVE_RELATIONSHIP_CONSTANT\n self.to, self.field_name = to, field_name\n self.related_name = related_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L740_C8", "label": "try", "type": "try", "loc": [740, 743], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [7, 2, 0.6376, 0.0034, 2, 0.8, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n to._meta\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"'to' must be either a model, a model name or the string %r\" % RECURSIVE_RELATIONSHIP_CONSTANT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L741_C12", "label": "expression", "type": "expression", "loc": [741, 741], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L740_C8", "vector": [8, 3, 0.6371, 0.0009, 3, 0.52, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L744_C8", "label": "assign", "type": "assigned_variable", "loc": [744, 744], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.6397, 0.0009, 2, 0.8, 0.1429, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.to, self.field_name = to, field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L745_C8", "label": "self.related_name =", "type": "assigned_variable", "loc": [745, 745], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.6406, 0.0009, 2, 0.8, 0.2857, 929, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.related_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related_name = related_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L746_C8", "label": "if", "type": "if", "loc": [746, 747], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [4, 2, 0.6419, 0.0017, 2, 0.8, 0.4286, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if limit_choices_to is None:\n limit_choices_to = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L747_C12", "label": "limit_choices_to =", "type": "assigned_variable", "loc": [747, 747], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L746_C8", "vector": [14, 3, 0.6423, 0.0009, 3, 0.35, 0.0, 53, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "limit_choices_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " limit_choices_to = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L748_C8", "label": "self.limit_choices_to =", "type": "assigned_variable", "loc": [748, 748], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.6432, 0.0009, 2, 0.8, 0.5714, 991, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.limit_choices_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.limit_choices_to = limit_choices_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L749_C8", "label": "self.multiple =", "type": "assigned_variable", "loc": [749, 749], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.644, 0.0009, 2, 0.8, 0.7143, 731, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.multiple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.multiple = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L750_C8", "label": "self.parent_link =", "type": "assigned_variable", "loc": [750, 750], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.6449, 0.0009, 2, 0.8, 0.8571, 902, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent_link = parent_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L751_C8", "label": "self.on_delete =", "type": "assigned_variable", "loc": [751, 751], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "vector": [14, 2, 0.6457, 0.0009, 2, 0.8, 1.0, 186, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.on_delete", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.on_delete = on_delete"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4", "label": "is_hidden", "type": "function", "loc": [753, 755], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "vector": [2, 1, 0.6483, 0.0026, 1, 0.92, 0.5, 524, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_hidden", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_hidden(self):\n \"Should the related object be hidden?\"\n return self.related_name and self.related_name[-1] == '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L754_C8", "label": "expression", "type": "expression", "loc": [754, 754], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4", "vector": [8, 2, 0.6483, 0.0009, 2, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Should the related object be hidden?\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L755_C8", "label": "return", "type": "return", "loc": [755, 755], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4", "vector": [13, 2, 0.6492, 0.0009, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.related_name and self.related_name[-1] == '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "label": "get_related_field", "type": "function", "loc": [757, 766], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "vector": [2, 1, 0.6548, 0.0086, 1, 0.92, 1.0, 383, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_related_field", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_related_field(self):\n \"\"\"\n Returns the Field in the 'to' object to which this relationship is\n tied.\n \"\"\"\n data = self.to._meta.get_field_by_name(self.field_name)\n if not data[2]:\n raise FieldDoesNotExist(\"No related field named '%s'\" %"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L758_C8", "label": "expression", "type": "expression", "loc": [758, 761], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "vector": [8, 2, 0.6531, 0.0034, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the Field in the 'to' object to which this relationship is\n tied.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L762_C8", "label": "data = get_field_by_name()", "type": "assigned_variable", "loc": [762, 762], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "vector": [14, 2, 0.6552, 0.0009, 2, 0.93, 0.3333, 929, 3, 1, 0, 0, 779, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "get_field_by_name", "annotation": ""}, "snippet": " data = self.to._meta.get_field_by_name(self.field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L763_C8", "label": "if", "type": "if", "loc": [763, 765], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "vector": [4, 2, 0.6569, 0.0026, 2, 0.93, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data[2]:\n raise FieldDoesNotExist(\"No related field named '%s'\" %\n self.field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L766_C8", "label": "return", "type": "return", "loc": [766, 766], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "vector": [13, 2, 0.6586, 0.0009, 2, 0.93, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L768_C0", "label": "OneToOneRel", "type": "class", "loc": [768, 775], "level": 0, "parent": null, "vector": [3, 0, 0.6634, 0.0069, 0, 0.66, 0.8438, 509, 0, 1, 0, 0, 163, 0, 2], "semantic": {"name": "OneToOneRel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OneToOneRel(ManyToOneRel):\n def __init__(self, to, field_name, related_name=None, limit_choices_to=None,\n parent_link=False, on_delete=None):\n super(OneToOneRel, self).__init__(to, field_name,\n related_name=related_name, limit_choices_to=limit_choices_to,\n parent_link=parent_link, on_delete=on_delete\n )\n self.multiple = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4", "label": "__init__", "type": "function", "loc": [769, 775], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L768_C0", "vector": [2, 1, 0.6638, 0.006, 1, 0.8, 0.0, 555, 0, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "to", "field_name", "related_name", "limit_choices_to", "parent_link", "on_delete"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, field_name, related_name=None, limit_choices_to=None,\n parent_link=False, on_delete=None):\n super(OneToOneRel, self).__init__(to, field_name,\n related_name=related_name, limit_choices_to=limit_choices_to,\n parent_link=parent_link, on_delete=on_delete\n )\n self.multiple = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L771_C8", "label": "__init__()", "type": "expression", "loc": [771, 774], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4", "vector": [8, 2, 0.6642, 0.0034, 2, 0.55, 0.0, 555, 3, 6, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(OneToOneRel, self).__init__(to, field_name,\n related_name=related_name, limit_choices_to=limit_choices_to,\n parent_link=parent_link, on_delete=on_delete\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L775_C8", "label": "self.multiple =", "type": "assigned_variable", "loc": [775, 775], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4", "vector": [14, 2, 0.6664, 0.0009, 2, 0.55, 1.0, 731, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.multiple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.multiple = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "label": "ManyToManyRel", "type": "class", "loc": [777, 799], "level": 0, "parent": null, "vector": [3, 0, 0.6776, 0.0198, 0, 0.66, 0.875, 767, 0, 3, 0, 0, 186, 0, 0], "semantic": {"name": "ManyToManyRel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ManyToManyRel(object):\n def __init__(self, to, related_name=None, limit_choices_to=None,\n symmetrical=True, through=None):\n self.to = to\n self.related_name = related_name\n if limit_choices_to is None:\n limit_choices_to = {}\n self.limit_choices_to = limit_choices_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "label": "__init__", "type": "function", "loc": [778, 787], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "vector": [2, 1, 0.6728, 0.0086, 1, 0.1, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "to", "related_name", "limit_choices_to", "symmetrical", "through"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, related_name=None, limit_choices_to=None,\n symmetrical=True, through=None):\n self.to = to\n self.related_name = related_name\n if limit_choices_to is None:\n limit_choices_to = {}\n self.limit_choices_to = limit_choices_to\n self.symmetrical = symmetrical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L780_C8", "label": "self.to =", "type": "assigned_variable", "loc": [780, 780], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.6707, 0.0009, 2, 0.54, 0.0, 807, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.to = to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L781_C8", "label": "self.related_name =", "type": "assigned_variable", "loc": [781, 781], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.6715, 0.0009, 2, 0.54, 0.1667, 929, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.related_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.related_name = related_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L782_C8", "label": "if", "type": "if", "loc": [782, 783], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [4, 2, 0.6728, 0.0017, 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 limit_choices_to is None:\n limit_choices_to = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L783_C12", "label": "limit_choices_to =", "type": "assigned_variable", "loc": [783, 783], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L782_C8", "vector": [14, 3, 0.6733, 0.0009, 3, 0.9, 0.0, 53, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "limit_choices_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " limit_choices_to = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L784_C8", "label": "self.limit_choices_to =", "type": "assigned_variable", "loc": [784, 784], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.6741, 0.0009, 2, 0.54, 0.5, 991, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.limit_choices_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.limit_choices_to = limit_choices_to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L785_C8", "label": "self.symmetrical =", "type": "assigned_variable", "loc": [785, 785], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.675, 0.0009, 2, 0.54, 0.6667, 77, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.symmetrical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.symmetrical = symmetrical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L786_C8", "label": "self.multiple =", "type": "assigned_variable", "loc": [786, 786], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.6758, 0.0009, 2, 0.54, 0.8333, 731, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.multiple", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.multiple = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L787_C8", "label": "self.through =", "type": "assigned_variable", "loc": [787, 787], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "vector": [14, 2, 0.6767, 0.0009, 2, 0.54, 1.0, 654, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.through", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.through = through"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4", "label": "is_hidden", "type": "function", "loc": [789, 791], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "vector": [2, 1, 0.6793, 0.0026, 1, 0.1, 0.5, 524, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_hidden", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_hidden(self):\n \"Should the related object be hidden?\"\n return self.related_name and self.related_name[-1] == '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L790_C8", "label": "expression", "type": "expression", "loc": [790, 790], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4", "vector": [8, 2, 0.6793, 0.0009, 2, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Should the related object be hidden?\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L791_C8", "label": "return", "type": "return", "loc": [791, 791], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4", "vector": [13, 2, 0.6801, 0.0009, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.related_name and self.related_name[-1] == '+'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4", "label": "get_related_field", "type": "function", "loc": [793, 799], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "vector": [2, 1, 0.6844, 0.006, 1, 0.1, 1.0, 383, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_related_field", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_related_field(self):\n \"\"\"\n Returns the field in the to' object to which this relationship is tied\n (this is always the primary key on the target model). Provided for\n symmetry with ManyToOneRel.\n \"\"\"\n return self.to._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L794_C8", "label": "expression", "type": "expression", "loc": [794, 798], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4", "vector": [8, 2, 0.6844, 0.0043, 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 field in the to' object to which this relationship is tied\n (this is always the primary key on the target model). Provided for\n symmetry with ManyToOneRel.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L799_C8", "label": "return", "type": "return", "loc": [799, 799], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4", "vector": [13, 2, 0.687, 0.0009, 2, 0.78, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.to._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "label": "ForeignKey", "type": "class", "loc": [801, 911], "level": 0, "parent": null, "vector": [3, 0, 0.736, 0.0954, 0, 0.66, 0.9062, 140, 0, 11, 0, 0, 878, 0, 48], "semantic": {"name": "ForeignKey", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ForeignKey(RelatedField, Field):\n empty_strings_allowed = False\n default_error_messages = {\n 'invalid': _('Model %(model)s with pk %(pk)r does not exist.')\n }\n description = _(\"Foreign Key (type determined by related field)\")\n def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L802_C4", "label": "empty_strings_allowed =", "type": "assigned_variable", "loc": [802, 802], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [14, 1, 0.6896, 0.0009, 1, 0.28, 0.0, 336, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "empty_strings_allowed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " empty_strings_allowed = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L803_C4", "label": "default_error_messages =", "type": "assigned_variable", "loc": [803, 805], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [14, 1, 0.6913, 0.0026, 1, 0.28, 0.0769, 166, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "default_error_messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default_error_messages = {\n 'invalid': _('Model %(model)s with pk %(pk)r does not exist.')\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L806_C4", "label": "description = _()", "type": "assigned_variable", "loc": [806, 806], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [14, 1, 0.693, 0.0009, 1, 0.28, 0.1538, 306, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "_", "annotation": ""}, "snippet": " description = _(\"Foreign Key (type determined by related field)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "label": "__init__", "type": "function", "loc": [807, 829], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7034, 0.0198, 1, 0.28, 0.2308, 555, 0, 5, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "to", "to_field", "rel_class", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, to_field=None, rel_class=ManyToOneRel, **kwargs):\n try:\n to_name = to._meta.object_name.lower()\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"%s(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r\" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)\n else:\n assert not to._meta.abstract, \"%s cannot define a relation with abstract class %s\" % (self.__class__.__name__, to._meta.object_name)\n # For backwards compatibility purposes, we need to *try* and set"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8", "label": "try", "type": "try", "loc": [808, 817], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "vector": [7, 2, 0.6986, 0.0086, 2, 0.73, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n to_name = to._meta.object_name.lower()\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"%s(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r\" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)\n else:\n assert not to._meta.abstract, \"%s cannot define a relation with abstract class %s\" % (self.__class__.__name__, to._meta.object_name)\n # For backwards compatibility purposes, we need to *try* and set\n # the to_field during FK construction. It won't be guaranteed to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L809_C12", "label": "to_name = lower()", "type": "assigned_variable", "loc": [809, 809], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8", "vector": [14, 3, 0.6956, 0.0009, 3, 0.28, 0.0, 394, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "to_name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " to_name = to._meta.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L817_C12", "label": "to_field =", "type": "assigned_variable", "loc": [817, 817], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8", "vector": [14, 3, 0.7025, 0.0009, 3, 0.28, 1.0, 646, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_field = to_field or (to._meta.pk and to._meta.pk.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L818_C8", "label": " = get()", "type": "assigned_variable", "loc": [818, 818], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "vector": [14, 2, 0.7034, 0.0009, 2, 0.73, 0.25, 0, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " kwargs['verbose_name'] = kwargs.get('verbose_name', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L820_C8", "label": "if", "type": "if", "loc": [820, 821], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "vector": [4, 2, 0.7055, 0.0017, 2, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'db_index' not in kwargs:\n kwargs['db_index'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L821_C12", "label": "assign", "type": "assigned_variable", "loc": [821, 821], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L820_C8", "vector": [14, 3, 0.7059, 0.0009, 3, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['db_index'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L823_C8", "label": " = rel_class()", "type": "assigned_variable", "loc": [823, 828], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "vector": [14, 2, 0.7098, 0.0052, 2, 0.73, 0.75, 0, 3, 6, 0, 0, 297, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "rel_class", "annotation": ""}, "snippet": " kwargs['rel'] = rel_class(to, to_field,\n related_name=kwargs.pop('related_name', None),\n limit_choices_to=kwargs.pop('limit_choices_to', None),\n parent_link=kwargs.pop('parent_link', False),\n on_delete=kwargs.pop('on_delete', CASCADE),\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L829_C8", "label": "__init__()", "type": "expression", "loc": [829, 829], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "vector": [8, 2, 0.7128, 0.0009, 2, 0.73, 1.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Field.__init__(self, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "label": "validate", "type": "function", "loc": [831, 842], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7193, 0.0103, 1, 0.28, 0.3077, 628, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "validate", "arg_names": ["self", "value", "model_instance"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def validate(self, value, model_instance):\n if self.rel.parent_link:\n return\n super(ForeignKey, self).validate(value, model_instance)\n if value is None:\n return\n\n qs = self.rel.to._default_manager.filter(**{self.rel.field_name:value})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L832_C8", "label": "if", "type": "if", "loc": [832, 833], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [4, 2, 0.7158, 0.0017, 2, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.rel.parent_link:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L833_C12", "label": "return", "type": "return", "loc": [833, 833], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L832_C8", "vector": [13, 3, 0.7163, 0.0009, 3, 0.68, 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_99021:Expr_L834_C8", "label": "validate()", "type": "expression", "loc": [834, 834], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [8, 2, 0.7171, 0.0009, 2, 0.95, 0.2, 628, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "validate", "arg_names": [], "import_names": [], "rhs_call_name": "validate", "annotation": ""}, "snippet": " super(ForeignKey, self).validate(value, model_instance)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L835_C8", "label": "if", "type": "if", "loc": [835, 836], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [4, 2, 0.7184, 0.0017, 2, 0.95, 0.4, 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"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L836_C12", "label": "return", "type": "return", "loc": [836, 836], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L835_C8", "vector": [13, 3, 0.7188, 0.0009, 3, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L838_C8", "label": "qs = filter()", "type": "assigned_variable", "loc": [838, 838], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [14, 2, 0.7206, 0.0009, 2, 0.95, 0.6, 251, 3, 1, 0, 0, 526, 10, 1], "semantic": {"name": "qs", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": " qs = self.rel.to._default_manager.filter(**{self.rel.field_name:value})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L839_C8", "label": "qs = complex_filter()", "type": "assigned_variable", "loc": [839, 839], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [14, 2, 0.7214, 0.0009, 2, 0.95, 0.8, 251, 3, 1, 0, 0, 165, 10, 1], "semantic": {"name": "qs", "arg_names": [], "import_names": [], "rhs_call_name": "complex_filter", "annotation": ""}, "snippet": " qs = qs.complex_filter(self.rel.limit_choices_to)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L840_C8", "label": "if", "type": "if", "loc": [840, 842], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "vector": [4, 2, 0.7231, 0.0026, 2, 0.95, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not qs.exists():\n raise exceptions.ValidationError(self.error_messages['invalid'] % {\n 'model': self.rel.to._meta.verbose_name, 'pk': value})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L844_C4", "label": "get_attname", "type": "function", "loc": [844, 845], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7261, 0.0017, 1, 0.28, 0.3846, 404, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_attname", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_attname(self):\n return '%s_id' % self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L845_C8", "label": "return", "type": "return", "loc": [845, 845], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L844_C4", "vector": [13, 2, 0.7266, 0.0009, 2, 0.73, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s_id' % self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L847_C4", "label": "get_validator_unique_lookup_type", "type": "function", "loc": [847, 848], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7287, 0.0017, 1, 0.28, 0.4615, 695, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_validator_unique_lookup_type", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_validator_unique_lookup_type(self):\n return '%s__%s__exact' % (self.name, self.rel.get_related_field().name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L848_C8", "label": "return", "type": "return", "loc": [848, 848], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L847_C4", "vector": [13, 2, 0.7291, 0.0009, 2, 0.97, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s__%s__exact' % (self.name, self.rel.get_related_field().name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "label": "get_default", "type": "function", "loc": [850, 855], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.733, 0.0052, 1, 0.28, 0.5385, 119, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "get_default", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_default(self):\n \"Here we check if the default value is an object and return the to_field if so.\"\n field_default = super(ForeignKey, self).get_default()\n if isinstance(field_default, self.rel.to):\n return getattr(field_default, self.rel.get_related_field().attname)\n return field_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L851_C8", "label": "expression", "type": "expression", "loc": [851, 851], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "vector": [8, 2, 0.7317, 0.0009, 2, 0.61, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Here we check if the default value is an object and return the to_field if so.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L852_C8", "label": "field_default = get_default()", "type": "assigned_variable", "loc": [852, 852], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "vector": [14, 2, 0.7326, 0.0009, 2, 0.61, 0.3333, 43, 3, 0, 0, 0, 119, 10, 2], "semantic": {"name": "field_default", "arg_names": [], "import_names": [], "rhs_call_name": "get_default", "annotation": ""}, "snippet": " field_default = super(ForeignKey, self).get_default()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L853_C8", "label": "if", "type": "if", "loc": [853, 854], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "vector": [4, 2, 0.7339, 0.0017, 2, 0.61, 0.6667, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(field_default, self.rel.to):\n return getattr(field_default, self.rel.get_related_field().attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L854_C12", "label": "return", "type": "return", "loc": [854, 854], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L853_C8", "vector": [13, 3, 0.7343, 0.0009, 3, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(field_default, self.rel.get_related_field().attname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L855_C8", "label": "return", "type": "return", "loc": [855, 855], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "vector": [13, 2, 0.7352, 0.0009, 2, 0.61, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return field_default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L857_C4", "label": "get_db_prep_save", "type": "function", "loc": [857, 862], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.739, 0.0052, 1, 0.28, 0.6154, 337, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_db_prep_save", "arg_names": ["self", "value", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_save(self, value, connection):\n if value == '' or value == None:\n return None\n else:\n return self.rel.get_related_field().get_db_prep_save(value,\n connection=connections[router.db_for_read(self.rel.to)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8", "label": "if", "type": "if", "loc": [858, 862], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L857_C4", "vector": [4, 2, 0.7395, 0.0043, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value == '' or value == None:\n return None\n else:\n return self.rel.get_related_field().get_db_prep_save(value,\n connection=connections[router.db_for_read(self.rel.to)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L859_C12", "label": "return", "type": "return", "loc": [859, 859], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8", "vector": [13, 3, 0.7386, 0.0009, 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_99021:Return_L861_C12", "label": "return", "type": "return", "loc": [861, 862], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8", "vector": [13, 3, 0.7408, 0.0017, 3, 0.67, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.rel.get_related_field().get_db_prep_save(value,\n connection=connections[router.db_for_read(self.rel.to)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4", "label": "value_to_string", "type": "function", "loc": [864, 874], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7472, 0.0095, 1, 0.28, 0.6923, 303, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "value_to_string", "arg_names": ["self", "obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_string(self, obj):\n if not obj:\n # In required many-to-one fields with only one available choice,\n # select that one available choice. Note: For SelectFields\n # we have to check that the length of choices is *2*, not 1,\n # because SelectFields always have an initial \"blank\" value.\n if not self.blank and self.choices:\n choice_list = self.get_choices_default()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L865_C8", "label": "if", "type": "if", "loc": [865, 873], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4", "vector": [4, 2, 0.7472, 0.0077, 2, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not obj:\n # In required many-to-one fields with only one available choice,\n # select that one available choice. Note: For SelectFields\n # we have to check that the length of choices is *2*, not 1,\n # because SelectFields always have an initial \"blank\" value.\n if not self.blank and self.choices:\n choice_list = self.get_choices_default()\n if len(choice_list) == 2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12", "label": "if", "type": "if", "loc": [870, 873], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L865_C8", "vector": [4, 3, 0.7494, 0.0034, 3, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.blank and self.choices:\n choice_list = self.get_choices_default()\n if len(choice_list) == 2:\n return smart_unicode(choice_list[1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L871_C16", "label": "choice_list = get_choices_default()", "type": "assigned_variable", "loc": [871, 871], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12", "vector": [14, 4, 0.7489, 0.0009, 4, 0.16, 0.0, 576, 3, 0, 0, 0, 314, 10, 1], "semantic": {"name": "choice_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_choices_default", "annotation": ""}, "snippet": " choice_list = self.get_choices_default()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L872_C16", "label": "if", "type": "if", "loc": [872, 873], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12", "vector": [4, 4, 0.7502, 0.0017, 4, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(choice_list) == 2:\n return smart_unicode(choice_list[1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L873_C20", "label": "return", "type": "return", "loc": [873, 873], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L872_C16", "vector": [13, 5, 0.7506, 0.0009, 5, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return smart_unicode(choice_list[1][0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L874_C8", "label": "return", "type": "return", "loc": [874, 874], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4", "vector": [13, 2, 0.7515, 0.0009, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Field.value_to_string(self, obj)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "label": "contribute_to_class", "type": "function", "loc": [876, 883], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7562, 0.0069, 1, 0.28, 0.7692, 973, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n super(ForeignKey, self).contribute_to_class(cls, name)\n setattr(cls, self.name, ReverseSingleRelatedObjectDescriptor(self))\n if isinstance(self.rel.to, basestring):\n target = self.rel.to\n else:\n target = self.rel.to._meta.db_table\n cls._meta.duplicate_targets[self.column] = (target, \"o2m\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L877_C8", "label": "contribute_to_class()", "type": "expression", "loc": [877, 877], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "vector": [8, 2, 0.7541, 0.0009, 2, 0.37, 0.0, 973, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " super(ForeignKey, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L878_C8", "label": "setattr()", "type": "expression", "loc": [878, 878], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "vector": [8, 2, 0.7549, 0.0009, 2, 0.37, 0.3333, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, self.name, ReverseSingleRelatedObjectDescriptor(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8", "label": "if", "type": "if", "loc": [879, 882], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "vector": [4, 2, 0.7571, 0.0034, 2, 0.37, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.rel.to, basestring):\n target = self.rel.to\n else:\n target = self.rel.to._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L880_C12", "label": "target =", "type": "assigned_variable", "loc": [880, 880], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8", "vector": [14, 3, 0.7567, 0.0009, 3, 0.25, 0.0, 766, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target = self.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L882_C12", "label": "target =", "type": "assigned_variable", "loc": [882, 882], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8", "vector": [14, 3, 0.7584, 0.0009, 3, 0.25, 1.0, 766, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target = self.rel.to._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L883_C8", "label": "assign", "type": "assigned_variable", "loc": [883, 883], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "vector": [14, 2, 0.7592, 0.0009, 2, 0.37, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls._meta.duplicate_targets[self.column] = (target, \"o2m\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4", "label": "contribute_to_related_class", "type": "function", "loc": [885, 891], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7635, 0.006, 1, 0.28, 0.8462, 722, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "contribute_to_related_class", "arg_names": ["self", "cls", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_related_class(self, cls, related):\n # Internal FK's - i.e., those with a related name ending with '+' -\n # don't get a related descriptor.\n if not self.rel.is_hidden():\n setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))\n if self.rel.field_name is None:\n self.rel.field_name = cls._meta.pk.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L888_C8", "label": "if", "type": "if", "loc": [888, 889], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4", "vector": [4, 2, 0.764, 0.0017, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.rel.is_hidden():\n setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L889_C12", "label": "setattr()", "type": "expression", "loc": [889, 889], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L888_C8", "vector": [8, 3, 0.7644, 0.0009, 3, 0.66, 0.0, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, related.get_accessor_name(), ForeignRelatedObjectsDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L890_C8", "label": "if", "type": "if", "loc": [890, 891], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4", "vector": [4, 2, 0.7657, 0.0017, 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 self.rel.field_name is None:\n self.rel.field_name = cls._meta.pk.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L891_C12", "label": "self.rel.field_name =", "type": "assigned_variable", "loc": [891, 891], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L890_C8", "vector": [14, 3, 0.7661, 0.0009, 3, 0.77, 0.0, 889, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rel.field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rel.field_name = cls._meta.pk.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "label": "formfield", "type": "function", "loc": [893, 901], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7713, 0.0077, 1, 0.28, 0.9231, 732, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "formfield", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formfield(self, **kwargs):\n db = kwargs.pop('using', None)\n defaults = {\n 'form_class': forms.ModelChoiceField,\n 'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to),\n 'to_field_name': self.rel.field_name,\n }\n defaults.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L894_C8", "label": "db = pop()", "type": "assigned_variable", "loc": [894, 894], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "vector": [14, 2, 0.7687, 0.0009, 2, 0.4, 0.0, 761, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " db = kwargs.pop('using', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L895_C8", "label": "defaults =", "type": "assigned_variable", "loc": [895, 899], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "vector": [14, 2, 0.7713, 0.0043, 2, 0.4, 0.3333, 233, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {\n 'form_class': forms.ModelChoiceField,\n 'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to),\n 'to_field_name': self.rel.field_name,\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L900_C8", "label": "update()", "type": "expression", "loc": [900, 900], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "vector": [8, 2, 0.7739, 0.0009, 2, 0.4, 0.6667, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " defaults.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L901_C8", "label": "return", "type": "return", "loc": [901, 901], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "vector": [13, 2, 0.7747, 0.0009, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(ForeignKey, self).formfield(**defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4", "label": "db_type", "type": "function", "loc": [903, 911], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "vector": [2, 1, 0.7799, 0.0077, 1, 0.28, 1.0, 976, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "db_type", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self, connection):\n # The database column type of a ForeignKey is the column type\n # of the field to which it points. An exception is if the ForeignKey\n # points to an AutoField/PositiveIntegerField/PositiveSmallIntegerField,\n # in which case the column type is simply that of an IntegerField.\n # If the database needs similar types for key fields however, the only\n # thing we can do is making AutoField an IntegerField.\n rel_field = self.rel.get_related_field()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L910_C8", "label": "rel_field = get_related_field()", "type": "assigned_variable", "loc": [910, 910], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4", "vector": [14, 2, 0.7825, 0.0009, 2, 0.44, 0.0, 889, 3, 0, 0, 0, 383, 10, 1], "semantic": {"name": "rel_field", "arg_names": [], "import_names": [], "rhs_call_name": "get_related_field", "annotation": ""}, "snippet": " rel_field = self.rel.get_related_field()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L911_C8", "label": "return", "type": "return", "loc": [911, 911], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4", "vector": [13, 2, 0.7833, 0.0009, 2, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rel_field.related_db_type(connection=connections[router.db_for_read(rel_field.model)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "label": "OneToOneField", "type": "class", "loc": [913, 938], "level": 0, "parent": null, "vector": [3, 0, 0.7958, 0.0224, 0, 0.66, 0.9375, 199, 0, 4, 0, 0, 140, 0, 11], "semantic": {"name": "OneToOneField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OneToOneField(ForeignKey):\n \"\"\"\n A OneToOneField is essentially the same as a ForeignKey, with the exception\n that always carries a \"unique\" constraint with it and the reverse relation\n always returns the object pointed to (since there will only ever be one),\n rather than returning a list.\n \"\"\"\n description = _(\"One-to-one relationship\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L914_C4", "label": "expression", "type": "expression", "loc": [914, 919], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [8, 1, 0.788, 0.0052, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A OneToOneField is essentially the same as a ForeignKey, with the exception\n that always carries a \"unique\" constraint with it and the reverse relation\n always returns the object pointed to (since there will only ever be one),\n rather than returning a list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L920_C4", "label": "description = _()", "type": "assigned_variable", "loc": [920, 920], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [14, 1, 0.7911, 0.0009, 1, 0.55, 0.2, 306, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "_", "annotation": ""}, "snippet": " description = _(\"One-to-one relationship\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4", "label": "__init__", "type": "function", "loc": [921, 923], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [2, 1, 0.7928, 0.0026, 1, 0.55, 0.4, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "to", "to_field", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, to_field=None, **kwargs):\n kwargs['unique'] = True\n super(OneToOneField, self).__init__(to, to_field, OneToOneRel, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L922_C8", "label": "assign", "type": "assigned_variable", "loc": [922, 922], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4", "vector": [14, 2, 0.7928, 0.0009, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['unique'] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L923_C8", "label": "__init__()", "type": "expression", "loc": [923, 923], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4", "vector": [8, 2, 0.7936, 0.0009, 2, 0.9, 1.0, 555, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(OneToOneField, self).__init__(to, to_field, OneToOneRel, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L925_C4", "label": "contribute_to_related_class", "type": "function", "loc": [925, 927], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [2, 1, 0.7962, 0.0026, 1, 0.55, 0.6, 722, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "contribute_to_related_class", "arg_names": ["self", "cls", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_related_class(self, cls, related):\n setattr(cls, related.get_accessor_name(),\n SingleRelatedObjectDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L926_C8", "label": "setattr()", "type": "expression", "loc": [926, 927], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L925_C4", "vector": [8, 2, 0.7966, 0.0017, 2, 0.54, 0.0, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, related.get_accessor_name(),\n SingleRelatedObjectDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4", "label": "formfield", "type": "function", "loc": [929, 932], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [2, 1, 0.8001, 0.0034, 1, 0.55, 0.8, 732, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "formfield", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formfield(self, **kwargs):\n if self.rel.parent_link:\n return None\n return super(OneToOneField, self).formfield(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L930_C8", "label": "if", "type": "if", "loc": [930, 931], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4", "vector": [4, 2, 0.8001, 0.0017, 2, 0.08, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.rel.parent_link:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L931_C12", "label": "return", "type": "return", "loc": [931, 931], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L930_C8", "vector": [13, 3, 0.8005, 0.0009, 3, 0.65, 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_99021:Return_L932_C8", "label": "return", "type": "return", "loc": [932, 932], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4", "vector": [13, 2, 0.8014, 0.0009, 2, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(OneToOneField, self).formfield(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L934_C4", "label": "save_form_data", "type": "function", "loc": [934, 938], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "vector": [2, 1, 0.8048, 0.0043, 1, 0.55, 1.0, 198, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "save_form_data", "arg_names": ["self", "instance", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_form_data(self, instance, data):\n if isinstance(data, self.rel.to):\n setattr(instance, self.name, data)\n else:\n setattr(instance, self.attname, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8", "label": "if", "type": "if", "loc": [935, 938], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L934_C4", "vector": [4, 2, 0.8052, 0.0034, 2, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(data, self.rel.to):\n setattr(instance, self.name, data)\n else:\n setattr(instance, self.attname, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L936_C12", "label": "setattr()", "type": "expression", "loc": [936, 936], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8", "vector": [8, 3, 0.8048, 0.0009, 3, 0.47, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.name, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L938_C12", "label": "setattr()", "type": "expression", "loc": [938, 938], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8", "vector": [8, 3, 0.8065, 0.0009, 3, 0.47, 1.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.attname, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "label": "create_many_to_many_intermediary_model", "type": "function", "loc": [940, 979], "level": 0, "parent": null, "vector": [2, 0, 0.825, 0.0344, 0, 0.66, 0.9688, 284, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "create_many_to_many_intermediary_model", "arg_names": ["field", "klass"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_many_to_many_intermediary_model(field, klass):\n from django.db import models\n managed = True\n if isinstance(field.rel.to, basestring) and field.rel.to != RECURSIVE_RELATIONSHIP_CONSTANT:\n to_model = field.rel.to\n to = to_model.split('.')[-1]\n def set_managed(field, model, cls):\n field.rel.through._meta.managed = model._meta.managed or cls._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L941_C4", "label": "from django.db import models", "type": "import", "loc": [941, 941], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [1, 1, 0.8091, 0.0009, 1, 0.13, 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_99021:Assign_L942_C4", "label": "managed =", "type": "assigned_variable", "loc": [942, 942], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [14, 1, 0.81, 0.0009, 1, 0.13, 0.1667, 503, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " managed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "label": "if", "type": "if", "loc": [943, 956], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [4, 1, 0.8164, 0.012, 1, 0.13, 0.3333, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(field.rel.to, basestring) and field.rel.to != RECURSIVE_RELATIONSHIP_CONSTANT:\n to_model = field.rel.to\n to = to_model.split('.')[-1]\n def set_managed(field, model, cls):\n field.rel.through._meta.managed = model._meta.managed or cls._meta.managed\n add_lazy_relation(klass, field, to_model, set_managed)\n elif isinstance(field.rel.to, basestring):\n to = klass._meta.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L944_C8", "label": "to_model =", "type": "assigned_variable", "loc": [944, 944], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "vector": [14, 2, 0.8117, 0.0009, 2, 0.95, 0.0, 582, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_model = field.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L945_C8", "label": "to =", "type": "assigned_variable", "loc": [945, 945], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "vector": [14, 2, 0.8126, 0.0009, 2, 0.95, 0.25, 550, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to = to_model.split('.')[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L946_C8", "label": "set_managed", "type": "function", "loc": [946, 947], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "vector": [2, 2, 0.8138, 0.0017, 2, 0.95, 0.5, 564, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "set_managed", "arg_names": ["field", "model", "cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_managed(field, model, cls):\n field.rel.through._meta.managed = model._meta.managed or cls._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L947_C12", "label": "field.rel.through._meta.managed =", "type": "assigned_variable", "loc": [947, 947], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L946_C8", "vector": [14, 3, 0.8143, 0.0009, 3, 0.96, 0.0, 592, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field.rel.through._meta.managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field.rel.through._meta.managed = model._meta.managed or cls._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L948_C8", "label": "add_lazy_relation()", "type": "expression", "loc": [948, 948], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "vector": [8, 2, 0.8151, 0.0009, 2, 0.95, 0.75, 283, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_lazy_relation", "arg_names": [], "import_names": [], "rhs_call_name": "add_lazy_relation", "annotation": ""}, "snippet": " add_lazy_relation(klass, field, to_model, set_managed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "label": "if", "type": "if", "loc": [949, 956], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "vector": [4, 2, 0.819, 0.0069, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(field.rel.to, basestring):\n to = klass._meta.object_name\n to_model = klass\n managed = klass._meta.managed\n else:\n to = field.rel.to._meta.object_name\n to_model = field.rel.to\n managed = klass._meta.managed or to_model._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L950_C8", "label": "to =", "type": "assigned_variable", "loc": [950, 950], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.8169, 0.0009, 3, 0.11, 0.0, 550, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to = klass._meta.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L951_C8", "label": "to_model =", "type": "assigned_variable", "loc": [951, 951], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.8177, 0.0009, 3, 0.11, 0.2, 582, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_model = klass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L952_C8", "label": "managed =", "type": "assigned_variable", "loc": [952, 952], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.8186, 0.0009, 3, 0.11, 0.4, 503, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " managed = klass._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L954_C8", "label": "to =", "type": "assigned_variable", "loc": [954, 954], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.8203, 0.0009, 3, 0.11, 0.6, 550, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to = field.rel.to._meta.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L955_C8", "label": "to_model =", "type": "assigned_variable", "loc": [955, 955], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.8212, 0.0009, 3, 0.11, 0.8, 582, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_model = field.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L956_C8", "label": "managed =", "type": "assigned_variable", "loc": [956, 956], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "vector": [14, 3, 0.822, 0.0009, 3, 0.11, 1.0, 503, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " managed = klass._meta.managed or to_model._meta.managed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L957_C4", "label": "name =", "type": "assigned_variable", "loc": [957, 957], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [14, 1, 0.8229, 0.0009, 1, 0.13, 0.5, 57, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = '%s_%s' % (klass._meta.object_name, field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "label": "if", "type": "if", "loc": [958, 963], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [4, 1, 0.8259, 0.0052, 1, 0.13, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or to == klass._meta.object_name:\n from_ = 'from_%s' % to.lower()\n to = 'to_%s' % to.lower()\n else:\n from_ = klass._meta.object_name.lower()\n to = to.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L959_C8", "label": "from_ =", "type": "assigned_variable", "loc": [959, 959], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "vector": [14, 2, 0.8246, 0.0009, 2, 0.56, 0.0, 67, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "from_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " from_ = 'from_%s' % to.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L960_C8", "label": "to =", "type": "assigned_variable", "loc": [960, 960], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "vector": [14, 2, 0.8255, 0.0009, 2, 0.56, 0.3333, 550, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to = 'to_%s' % to.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L962_C8", "label": "from_ = lower()", "type": "assigned_variable", "loc": [962, 962], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "vector": [14, 2, 0.8272, 0.0009, 2, 0.56, 0.6667, 67, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "from_", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " from_ = klass._meta.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L963_C8", "label": "to = lower()", "type": "assigned_variable", "loc": [963, 963], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "vector": [14, 2, 0.828, 0.0009, 2, 0.56, 1.0, 550, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "to", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " to = to.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L964_C4", "label": "meta = type()", "type": "assigned_variable", "loc": [964, 972], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [14, 1, 0.8323, 0.0077, 1, 0.13, 0.8333, 329, 3, 3, 0, 0, 801, 10, 2], "semantic": {"name": "meta", "arg_names": [], "import_names": [], "rhs_call_name": "type", "annotation": ""}, "snippet": " meta = type('Meta', (object,), {\n 'db_table': field._get_m2m_db_table(klass._meta),\n 'managed': managed,\n 'auto_created': klass,\n 'app_label': klass._meta.app_label,\n 'unique_together': (from_, to),\n 'verbose_name': '%(from)s-%(to)s relationship' % {'from': from_, 'to': to},\n 'verbose_name_plural': '%(from)s-%(to)s relationships' % {'from': from_, 'to': to},"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L974_C4", "label": "return", "type": "return", "loc": [974, 979], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "vector": [13, 1, 0.8396, 0.0052, 1, 0.13, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type(name, (models.Model,), {\n 'Meta': meta,\n '__module__': klass.__module__,\n from_: models.ForeignKey(klass, related_name='%s+' % name),\n to: models.ForeignKey(to_model, related_name='%s+' % name)\n })"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "label": "ManyToManyField", "type": "class", "loc": [981, 1163], "level": 0, "parent": null, "vector": [3, 0, 0.9218, 0.1574, 0, 0.66, 1.0, 941, 0, 15, 0, 0, 878, 0, 75], "semantic": {"name": "ManyToManyField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ManyToManyField(RelatedField, Field):\n description = _(\"Many-to-many relationship\")\n def __init__(self, to, **kwargs):\n try:\n assert not to._meta.abstract, \"%s cannot define a relation with abstract class %s\" % (self.__class__.__name__, to._meta.object_name)\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"%s(%r) is invalid. First parameter to ManyToManyField must be either a model, a model name, or the string %r\" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L982_C4", "label": "description = _()", "type": "assigned_variable", "loc": [982, 982], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [14, 1, 0.8444, 0.0009, 1, 0.01, 0.0, 306, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "_", "annotation": ""}, "snippet": " description = _(\"Many-to-many relationship\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "label": "__init__", "type": "function", "loc": [983, 1003], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.8538, 0.0181, 1, 0.01, 0.0714, 555, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "__init__", "arg_names": ["self", "to", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, to, **kwargs):\n try:\n assert not to._meta.abstract, \"%s cannot define a relation with abstract class %s\" % (self.__class__.__name__, to._meta.object_name)\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"%s(%r) is invalid. First parameter to ManyToManyField must be either a model, a model name, or the string %r\" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)\n\n kwargs['verbose_name'] = kwargs.get('verbose_name', None)\n kwargs['rel'] = ManyToManyRel(to,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L984_C8", "label": "try", "type": "try", "loc": [984, 987], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [7, 2, 0.8474, 0.0034, 2, 0.38, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n assert not to._meta.abstract, \"%s cannot define a relation with abstract class %s\" % (self.__class__.__name__, to._meta.object_name)\n except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT\n assert isinstance(to, basestring), \"%s(%r) is invalid. First parameter to ManyToManyField must be either a model, a model name, or the string %r\" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L989_C8", "label": " = get()", "type": "assigned_variable", "loc": [989, 989], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [14, 2, 0.8504, 0.0009, 2, 0.38, 0.1429, 0, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " kwargs['verbose_name'] = kwargs.get('verbose_name', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L990_C8", "label": " = ManyToManyRel()", "type": "assigned_variable", "loc": [990, 994], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [14, 2, 0.853, 0.0043, 2, 0.38, 0.2857, 0, 3, 5, 0, 0, 767, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "ManyToManyRel", "annotation": ""}, "snippet": " kwargs['rel'] = ManyToManyRel(to,\n related_name=kwargs.pop('related_name', None),\n limit_choices_to=kwargs.pop('limit_choices_to', None),\n symmetrical=kwargs.pop('symmetrical', to==RECURSIVE_RELATIONSHIP_CONSTANT),\n through=kwargs.pop('through', None))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L996_C8", "label": "self.db_table = pop()", "type": "assigned_variable", "loc": [996, 996], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [14, 2, 0.8564, 0.0009, 2, 0.38, 0.4286, 223, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "self.db_table", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.db_table = kwargs.pop('db_table', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L997_C8", "label": "if", "type": "if", "loc": [997, 998], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [4, 2, 0.8577, 0.0017, 2, 0.38, 0.5714, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kwargs['rel'].through is not None:\n assert self.db_table is None, \"Cannot specify a db_table if an intermediary model is used.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1000_C8", "label": "__init__()", "type": "expression", "loc": [1000, 1000], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [8, 2, 0.8598, 0.0009, 2, 0.38, 0.7143, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Field.__init__(self, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1002_C8", "label": "msg = _()", "type": "assigned_variable", "loc": [1002, 1002], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [14, 2, 0.8616, 0.0009, 2, 0.38, 0.8571, 712, 3, 1, 0, 0, 660, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "_", "annotation": ""}, "snippet": " msg = _('Hold down \"Control\", or \"Command\" on a Mac, to select more than one.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1003_C8", "label": "self.help_text = string_concat()", "type": "assigned_variable", "loc": [1003, 1003], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "vector": [14, 2, 0.8624, 0.0009, 2, 0.38, 1.0, 958, 3, 3, 0, 0, 690, 10, 1], "semantic": {"name": "self.help_text", "arg_names": [], "import_names": [], "rhs_call_name": "string_concat", "annotation": ""}, "snippet": " self.help_text = string_concat(self.help_text, ' ', msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1005_C4", "label": "get_choices_default", "type": "function", "loc": [1005, 1006], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.8646, 0.0017, 1, 0.01, 0.1429, 314, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_choices_default", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_choices_default(self):\n return Field.get_choices(self, include_blank=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1006_C8", "label": "return", "type": "return", "loc": [1006, 1006], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1005_C4", "vector": [13, 2, 0.865, 0.0009, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Field.get_choices(self, include_blank=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4", "label": "_get_m2m_db_table", "type": "function", "loc": [1008, 1016], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.8702, 0.0077, 1, 0.01, 0.2143, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_m2m_db_table", "arg_names": ["self", "opts"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_m2m_db_table(self, opts):\n \"Function that can be curried to provide the m2m table name for this relation\"\n if self.rel.through is not None:\n return self.rel.through._meta.db_table\n elif self.db_table:\n return self.db_table\n else:\n return util.truncate_name('%s_%s' % (opts.db_table, self.name),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1009_C8", "label": "expression", "type": "expression", "loc": [1009, 1009], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4", "vector": [8, 2, 0.8676, 0.0009, 2, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Function that can be curried to provide the m2m table name for this relation\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8", "label": "if", "type": "if", "loc": [1010, 1016], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4", "vector": [4, 2, 0.871, 0.006, 2, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.rel.through is not None:\n return self.rel.through._meta.db_table\n elif self.db_table:\n return self.db_table\n else:\n return util.truncate_name('%s_%s' % (opts.db_table, self.name),\n connection.ops.max_name_length())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1011_C12", "label": "return", "type": "return", "loc": [1011, 1011], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8", "vector": [13, 3, 0.8693, 0.0009, 3, 0.32, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.rel.through._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8", "label": "if", "type": "if", "loc": [1012, 1016], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8", "vector": [4, 3, 0.8719, 0.0043, 3, 0.32, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.db_table:\n return self.db_table\n else:\n return util.truncate_name('%s_%s' % (opts.db_table, self.name),\n connection.ops.max_name_length())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1013_C12", "label": "return", "type": "return", "loc": [1013, 1013], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8", "vector": [13, 4, 0.871, 0.0009, 4, 0.62, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1015_C12", "label": "return", "type": "return", "loc": [1015, 1016], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8", "vector": [13, 4, 0.8732, 0.0017, 4, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return util.truncate_name('%s_%s' % (opts.db_table, self.name),\n connection.ops.max_name_length())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "label": "_get_m2m_attr", "type": "function", "loc": [1018, 1026], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.8788, 0.0077, 1, 0.01, 0.2857, 141, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_get_m2m_attr", "arg_names": ["self", "related", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_m2m_attr(self, related, attr):\n \"Function that can be curried to provide the source accessor or DB column name for the m2m table\"\n cache_attr = '_m2m_%s_cache' % attr\n if hasattr(self, cache_attr):\n return getattr(self, cache_attr)\n for f in self.rel.through._meta.fields:\n if hasattr(f,'rel') and f.rel and f.rel.to == related.model:\n setattr(self, cache_attr, getattr(f, attr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1019_C8", "label": "expression", "type": "expression", "loc": [1019, 1019], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "vector": [8, 2, 0.8762, 0.0009, 2, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Function that can be curried to provide the source accessor or DB column name for the m2m table\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1020_C8", "label": "cache_attr =", "type": "assigned_variable", "loc": [1020, 1020], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "vector": [14, 2, 0.877, 0.0009, 2, 0.63, 0.3333, 34, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cache_attr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache_attr = '_m2m_%s_cache' % attr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1021_C8", "label": "if", "type": "if", "loc": [1021, 1022], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "vector": [4, 2, 0.8783, 0.0017, 2, 0.63, 0.6667, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, cache_attr):\n return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1022_C12", "label": "return", "type": "return", "loc": [1022, 1022], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1021_C8", "vector": [13, 3, 0.8788, 0.0009, 3, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1023_C8", "label": "for f", "type": "for", "loc": [1023, 1026], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "vector": [6, 2, 0.8809, 0.0034, 2, 0.63, 1.0, 899, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in self.rel.through._meta.fields:\n if hasattr(f,'rel') and f.rel and f.rel.to == related.model:\n setattr(self, cache_attr, getattr(f, attr))\n return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12", "label": "if", "type": "if", "loc": [1024, 1026], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1023_C8", "vector": [4, 3, 0.8813, 0.0026, 3, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(f,'rel') and f.rel and f.rel.to == related.model:\n setattr(self, cache_attr, getattr(f, attr))\n return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1025_C16", "label": "setattr()", "type": "expression", "loc": [1025, 1025], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12", "vector": [8, 4, 0.8813, 0.0009, 4, 0.11, 0.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, cache_attr, getattr(f, attr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1026_C16", "label": "return", "type": "return", "loc": [1026, 1026], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12", "vector": [13, 4, 0.8822, 0.0009, 4, 0.11, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "label": "_get_m2m_reverse_attr", "type": "function", "loc": [1028, 1049], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.8929, 0.0189, 1, 0.01, 0.3571, 499, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "_get_m2m_reverse_attr", "arg_names": ["self", "related", "attr"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_m2m_reverse_attr(self, related, attr):\n \"Function that can be curried to provide the related accessor or DB column name for the m2m table\"\n cache_attr = '_m2m_reverse_%s_cache' % attr\n if hasattr(self, cache_attr):\n return getattr(self, cache_attr)\n found = False\n for f in self.rel.through._meta.fields:\n if hasattr(f,'rel') and f.rel and f.rel.to == related.parent_model:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1029_C8", "label": "expression", "type": "expression", "loc": [1029, 1029], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [8, 2, 0.8848, 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": " \"Function that can be curried to provide the related accessor or DB column name for the m2m table\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1030_C8", "label": "cache_attr =", "type": "assigned_variable", "loc": [1030, 1030], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [14, 2, 0.8856, 0.0009, 2, 0.2, 0.2, 34, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cache_attr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache_attr = '_m2m_reverse_%s_cache' % attr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1031_C8", "label": "if", "type": "if", "loc": [1031, 1032], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [4, 2, 0.8869, 0.0017, 2, 0.2, 0.4, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, cache_attr):\n return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1032_C12", "label": "return", "type": "return", "loc": [1032, 1032], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1031_C8", "vector": [13, 3, 0.8874, 0.0009, 3, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1033_C8", "label": "found =", "type": "assigned_variable", "loc": [1033, 1033], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [14, 2, 0.8882, 0.0009, 2, 0.2, 0.6, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1034_C8", "label": "for f", "type": "for", "loc": [1034, 1048], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [6, 2, 0.8951, 0.0129, 2, 0.2, 0.8, 899, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in self.rel.through._meta.fields:\n if hasattr(f,'rel') and f.rel and f.rel.to == related.parent_model:\n if related.model == related.parent_model:\n # If this is an m2m-intermediate to self,\n # the first foreign key you find will be\n # the source column. Keep searching for\n # the second foreign key.\n if found:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1035_C12", "label": "if", "type": "if", "loc": [1035, 1048], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1034_C8", "vector": [4, 3, 0.8955, 0.012, 3, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(f,'rel') and f.rel and f.rel.to == related.parent_model:\n if related.model == related.parent_model:\n # If this is an m2m-intermediate to self,\n # the first foreign key you find will be\n # the source column. Keep searching for\n # the second foreign key.\n if found:\n setattr(self, cache_attr, getattr(f, attr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16", "label": "if", "type": "if", "loc": [1036, 1048], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1035_C12", "vector": [4, 4, 0.896, 0.0112, 4, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if related.model == related.parent_model:\n # If this is an m2m-intermediate to self,\n # the first foreign key you find will be\n # the source column. Keep searching for\n # the second foreign key.\n if found:\n setattr(self, cache_attr, getattr(f, attr))\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20", "label": "if", "type": "if", "loc": [1041, 1045], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16", "vector": [4, 5, 0.8968, 0.0043, 5, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if found:\n setattr(self, cache_attr, getattr(f, attr))\n break\n else:\n found = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1042_C24", "label": "setattr()", "type": "expression", "loc": [1042, 1042], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20", "vector": [8, 6, 0.896, 0.0009, 6, 0.83, 0.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, cache_attr, getattr(f, attr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1045_C24", "label": "found =", "type": "assigned_variable", "loc": [1045, 1045], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20", "vector": [14, 6, 0.8985, 0.0009, 6, 0.83, 1.0, 841, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "found", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " found = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1047_C20", "label": "setattr()", "type": "expression", "loc": [1047, 1047], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16", "vector": [8, 5, 0.9003, 0.0009, 5, 0.98, 1.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, cache_attr, getattr(f, attr))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1049_C8", "label": "return", "type": "return", "loc": [1049, 1049], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "vector": [13, 2, 0.902, 0.0009, 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 getattr(self, cache_attr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "label": "isValidIDList", "type": "function", "loc": [1051, 1068], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.911, 0.0155, 1, 0.01, 0.4286, 251, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "isValidIDList", "arg_names": ["self", "field_data", "all_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def isValidIDList(self, field_data, all_data):\n \"Validates that the value is a valid list of foreign keys\"\n mod = self.rel.to\n try:\n pks = map(int, field_data.split(','))\n except ValueError:\n # the CommaSeparatedIntegerField validator will catch this error\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1052_C8", "label": "expression", "type": "expression", "loc": [1052, 1052], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "vector": [8, 2, 0.9046, 0.0009, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Validates that the value is a valid list of foreign keys\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1053_C8", "label": "mod =", "type": "assigned_variable", "loc": [1053, 1053], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "vector": [14, 2, 0.9054, 0.0009, 2, 0.88, 0.25, 25, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mod = self.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8", "label": "try", "type": "try", "loc": [1054, 1058], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "vector": [7, 2, 0.908, 0.0043, 2, 0.88, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n pks = map(int, field_data.split(','))\n except ValueError:\n # the CommaSeparatedIntegerField validator will catch this error\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1055_C12", "label": "pks = map()", "type": "assigned_variable", "loc": [1055, 1055], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8", "vector": [14, 3, 0.9071, 0.0009, 3, 0.55, 0.0, 837, 3, 2, 0, 0, 53, 10, 2], "semantic": {"name": "pks", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " pks = map(int, field_data.split(','))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1058_C12", "label": "return", "type": "return", "loc": [1058, 1058], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8", "vector": [13, 3, 0.9097, 0.0009, 3, 0.55, 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_99021:Assign_L1059_C8", "label": "objects = in_bulk()", "type": "assigned_variable", "loc": [1059, 1059], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "vector": [14, 2, 0.9106, 0.0009, 2, 0.88, 0.75, 550, 3, 1, 0, 0, 851, 10, 1], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "in_bulk", "annotation": ""}, "snippet": " objects = mod._default_manager.in_bulk(pks)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1060_C8", "label": "if", "type": "if", "loc": [1060, 1068], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "vector": [4, 2, 0.9149, 0.0077, 2, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(objects) != len(pks):\n badkeys = [k for k in pks if k not in objects]\n raise exceptions.ValidationError(\n ungettext(\"Please enter valid %(self)s IDs. The value %(value)r is invalid.\",\n \"Please enter valid %(self)s IDs. The values %(value)r are invalid.\",\n len(badkeys)) % {\n 'self': self.verbose_name,\n 'value': len(badkeys) == 1 and badkeys[0] or tuple(badkeys),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1061_C12", "label": "badkeys =", "type": "assigned_variable", "loc": [1061, 1061], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1060_C8", "vector": [14, 3, 0.9123, 0.0009, 3, 0.25, 0.0, 392, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "badkeys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " badkeys = [k for k in pks if k not in objects]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "label": "value_to_string", "type": "function", "loc": [1070, 1082], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9252, 0.0112, 1, 0.01, 0.5, 303, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "value_to_string", "arg_names": ["self", "obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_to_string(self, obj):\n data = ''\n if obj:\n qs = getattr(obj, self.name).all()\n data = [instance._get_pk_val() for instance in qs]\n else:\n # In required many-to-many fields with only one available choice,\n # select that one available choice."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1071_C8", "label": "data =", "type": "assigned_variable", "loc": [1071, 1071], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "vector": [14, 2, 0.9209, 0.0009, 2, 0.0, 0.0, 929, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "label": "if", "type": "if", "loc": [1072, 1081], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "vector": [4, 2, 0.9256, 0.0086, 2, 0.0, 0.5, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj:\n qs = getattr(obj, self.name).all()\n data = [instance._get_pk_val() for instance in qs]\n else:\n # In required many-to-many fields with only one available choice,\n # select that one available choice.\n if not self.blank:\n choices_list = self.get_choices_default()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1073_C12", "label": "qs = all()", "type": "assigned_variable", "loc": [1073, 1073], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "vector": [14, 3, 0.9226, 0.0009, 3, 0.63, 0.0, 251, 3, 0, 0, 0, 895, 10, 2], "semantic": {"name": "qs", "arg_names": [], "import_names": [], "rhs_call_name": "all", "annotation": ""}, "snippet": " qs = getattr(obj, self.name).all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1074_C12", "label": "data =", "type": "assigned_variable", "loc": [1074, 1074], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "vector": [14, 3, 0.9235, 0.0009, 3, 0.63, 0.5, 929, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = [instance._get_pk_val() for instance in qs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12", "label": "if", "type": "if", "loc": [1078, 1081], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "vector": [4, 3, 0.9282, 0.0034, 3, 0.63, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.blank:\n choices_list = self.get_choices_default()\n if len(choices_list) == 1:\n data = [choices_list[0][0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1079_C16", "label": "choices_list = get_choices_default()", "type": "assigned_variable", "loc": [1079, 1079], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12", "vector": [14, 4, 0.9278, 0.0009, 4, 0.82, 0.0, 453, 3, 0, 0, 0, 314, 10, 1], "semantic": {"name": "choices_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_choices_default", "annotation": ""}, "snippet": " choices_list = self.get_choices_default()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1080_C16", "label": "if", "type": "if", "loc": [1080, 1081], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12", "vector": [4, 4, 0.9291, 0.0017, 4, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(choices_list) == 1:\n data = [choices_list[0][0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1081_C20", "label": "data =", "type": "assigned_variable", "loc": [1081, 1081], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1080_C16", "vector": [14, 5, 0.9295, 0.0009, 5, 0.03, 0.0, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = [choices_list[0][0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1082_C8", "label": "return", "type": "return", "loc": [1082, 1082], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "vector": [13, 2, 0.9304, 0.0009, 2, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return smart_unicode(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "label": "contribute_to_class", "type": "function", "loc": [1084, 1119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9471, 0.031, 1, 0.01, 0.5714, 973, 0, 3, 0, 0, 0, 0, 9], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n # To support multiple relations to self, it's useful to have a non-None\n # related name on symmetrical relations for internal reasons. The\n # concept doesn't make a lot of sense externally (\"you want me to\n # specify *what* on my non-reversible relation?!\"), so we set it up\n # automatically. The funky name reduces the chance of an accidental\n # clash.\n if self.rel.symmetrical and (self.rel.to == \"self\" or self.rel.to == cls._meta.object_name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1091_C8", "label": "if", "type": "if", "loc": [1091, 1092], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [4, 2, 0.9385, 0.0017, 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 self.rel.symmetrical and (self.rel.to == \"self\" or self.rel.to == cls._meta.object_name):\n self.rel.related_name = \"%s_rel_+\" % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1092_C12", "label": "self.rel.related_name =", "type": "assigned_variable", "loc": [1092, 1092], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1091_C8", "vector": [14, 3, 0.939, 0.0009, 3, 0.04, 0.0, 339, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.rel.related_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.rel.related_name = \"%s_rel_+\" % name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1094_C8", "label": "contribute_to_class()", "type": "expression", "loc": [1094, 1094], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [8, 2, 0.9407, 0.0009, 2, 0.83, 0.1429, 973, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " super(ManyToManyField, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1099_C8", "label": "if", "type": "if", "loc": [1099, 1100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [4, 2, 0.9454, 0.0017, 2, 0.83, 0.2857, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.rel.through and not cls._meta.abstract:\n self.rel.through = create_many_to_many_intermediary_model(self, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1100_C12", "label": "self.rel.through = create_many_to_many_intermediary_model()", "type": "assigned_variable", "loc": [1100, 1100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1099_C8", "vector": [14, 3, 0.9458, 0.0009, 3, 0.97, 0.0, 455, 3, 2, 0, 0, 284, 10, 1], "semantic": {"name": "self.rel.through", "arg_names": [], "import_names": [], "rhs_call_name": "create_many_to_many_intermediary_model", "annotation": ""}, "snippet": " self.rel.through = create_many_to_many_intermediary_model(self, cls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1103_C8", "label": "setattr()", "type": "expression", "loc": [1103, 1103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [8, 2, 0.9484, 0.0009, 2, 0.83, 0.4286, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, self.name, ReverseManyRelatedObjectsDescriptor(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1106_C8", "label": "self.m2m_db_table = curry()", "type": "assigned_variable", "loc": [1106, 1106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [14, 2, 0.951, 0.0009, 2, 0.83, 0.5714, 783, 3, 2, 0, 0, 553, 10, 1], "semantic": {"name": "self.m2m_db_table", "arg_names": [], "import_names": [], "rhs_call_name": "curry", "annotation": ""}, "snippet": " self.m2m_db_table = curry(self._get_m2m_db_table, cls._meta)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8", "label": "if", "type": "if", "loc": [1110, 1113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [4, 2, 0.9557, 0.0034, 2, 0.83, 0.7143, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.rel.through, basestring):\n def resolve_through_model(field, model, cls):\n field.rel.through = model\n add_lazy_relation(cls, self, self.rel.through, resolve_through_model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1111_C12", "label": "resolve_through_model", "type": "function", "loc": [1111, 1112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8", "vector": [2, 3, 0.9557, 0.0017, 3, 0.21, 0.0, 430, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "resolve_through_model", "arg_names": ["field", "model", "cls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def resolve_through_model(field, model, cls):\n field.rel.through = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1112_C16", "label": "field.rel.through =", "type": "assigned_variable", "loc": [1112, 1112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1111_C12", "vector": [14, 4, 0.9561, 0.0009, 4, 0.66, 0.0, 442, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field.rel.through", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field.rel.through = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1113_C12", "label": "add_lazy_relation()", "type": "expression", "loc": [1113, 1113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8", "vector": [8, 3, 0.957, 0.0009, 3, 0.21, 1.0, 283, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "add_lazy_relation", "arg_names": [], "import_names": [], "rhs_call_name": "add_lazy_relation", "annotation": ""}, "snippet": " add_lazy_relation(cls, self, self.rel.through, resolve_through_model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8", "label": "if", "type": "if", "loc": [1115, 1118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [4, 2, 0.96, 0.0034, 2, 0.83, 0.8571, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(self.rel.to, basestring):\n target = self.rel.to\n else:\n target = self.rel.to._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1116_C12", "label": "target =", "type": "assigned_variable", "loc": [1116, 1116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8", "vector": [14, 3, 0.9596, 0.0009, 3, 0.13, 0.0, 766, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target = self.rel.to"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1118_C12", "label": "target =", "type": "assigned_variable", "loc": [1118, 1118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8", "vector": [14, 3, 0.9613, 0.0009, 3, 0.13, 1.0, 766, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target = self.rel.to._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1119_C8", "label": "assign", "type": "assigned_variable", "loc": [1119, 1119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "vector": [14, 2, 0.9622, 0.0009, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls._meta.duplicate_targets[self.column] = (target, \"m2m\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "label": "contribute_to_related_class", "type": "function", "loc": [1121, 1132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9686, 0.0103, 1, 0.01, 0.6429, 722, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "contribute_to_related_class", "arg_names": ["self", "cls", "related"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_related_class(self, cls, related):\n # Internal M2Ms (i.e., those with a related name ending with '+')\n # don't get a related descriptor.\n if not self.rel.is_hidden():\n setattr(cls, related.get_accessor_name(), ManyRelatedObjectsDescriptor(related))\n\n # Set up the accessors for the column names on the m2m table\n self.m2m_column_name = curry(self._get_m2m_attr, related, 'column')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1124_C8", "label": "if", "type": "if", "loc": [1124, 1125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "vector": [4, 2, 0.9669, 0.0017, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.rel.is_hidden():\n setattr(cls, related.get_accessor_name(), ManyRelatedObjectsDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1125_C12", "label": "setattr()", "type": "expression", "loc": [1125, 1125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1124_C8", "vector": [8, 3, 0.9673, 0.0009, 3, 0.04, 0.0, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, related.get_accessor_name(), ManyRelatedObjectsDescriptor(related))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1128_C8", "label": "self.m2m_column_name = curry()", "type": "assigned_variable", "loc": [1128, 1128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "vector": [14, 2, 0.9699, 0.0009, 2, 0.02, 0.25, 443, 3, 3, 0, 0, 553, 10, 1], "semantic": {"name": "self.m2m_column_name", "arg_names": [], "import_names": [], "rhs_call_name": "curry", "annotation": ""}, "snippet": " self.m2m_column_name = curry(self._get_m2m_attr, related, 'column')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1129_C8", "label": "self.m2m_reverse_name = curry()", "type": "assigned_variable", "loc": [1129, 1129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "vector": [14, 2, 0.9708, 0.0009, 2, 0.02, 0.5, 606, 3, 3, 0, 0, 553, 10, 1], "semantic": {"name": "self.m2m_reverse_name", "arg_names": [], "import_names": [], "rhs_call_name": "curry", "annotation": ""}, "snippet": " self.m2m_reverse_name = curry(self._get_m2m_reverse_attr, related, 'column')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1131_C8", "label": "self.m2m_field_name = curry()", "type": "assigned_variable", "loc": [1131, 1131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "vector": [14, 2, 0.9725, 0.0009, 2, 0.02, 0.75, 390, 3, 3, 0, 0, 553, 10, 1], "semantic": {"name": "self.m2m_field_name", "arg_names": [], "import_names": [], "rhs_call_name": "curry", "annotation": ""}, "snippet": " self.m2m_field_name = curry(self._get_m2m_attr, related, 'name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1132_C8", "label": "self.m2m_reverse_field_name = curry()", "type": "assigned_variable", "loc": [1132, 1132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "vector": [14, 2, 0.9733, 0.0009, 2, 0.02, 1.0, 369, 3, 3, 0, 0, 553, 10, 1], "semantic": {"name": "self.m2m_reverse_field_name", "arg_names": [], "import_names": [], "rhs_call_name": "curry", "annotation": ""}, "snippet": " self.m2m_reverse_field_name = curry(self._get_m2m_reverse_attr, related, 'name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1134_C4", "label": "set_attributes_from_rel", "type": "function", "loc": [1134, 1135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9755, 0.0017, 1, 0.01, 0.7143, 796, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "set_attributes_from_rel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_attributes_from_rel(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4", "label": "value_from_object", "type": "function", "loc": [1137, 1139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9785, 0.0026, 1, 0.01, 0.7857, 444, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "value_from_object", "arg_names": ["self", "obj"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def value_from_object(self, obj):\n \"Returns the value of this field in the given model instance.\"\n return getattr(obj, self.attname).all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1138_C8", "label": "expression", "type": "expression", "loc": [1138, 1138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4", "vector": [8, 2, 0.9785, 0.0009, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns the value of this field in the given model instance.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1139_C8", "label": "return", "type": "return", "loc": [1139, 1139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4", "vector": [13, 2, 0.9794, 0.0009, 2, 0.05, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(obj, self.attname).all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1141_C4", "label": "save_form_data", "type": "function", "loc": [1141, 1142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9815, 0.0017, 1, 0.01, 0.8571, 198, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "save_form_data", "arg_names": ["self", "instance", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def save_form_data(self, instance, data):\n setattr(instance, self.attname, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1142_C8", "label": "setattr()", "type": "expression", "loc": [1142, 1142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1141_C4", "vector": [8, 2, 0.9819, 0.0009, 2, 0.12, 0.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(instance, self.attname, data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "label": "formfield", "type": "function", "loc": [1144, 1158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9897, 0.0129, 1, 0.01, 0.9286, 732, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "formfield", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def formfield(self, **kwargs):\n db = kwargs.pop('using', None)\n defaults = {\n 'form_class': forms.ModelMultipleChoiceField,\n 'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to)\n }\n defaults.update(kwargs)\n # If initial is passed in, it's a list of related objects, but the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1145_C8", "label": "db = pop()", "type": "assigned_variable", "loc": [1145, 1145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "vector": [14, 2, 0.9845, 0.0009, 2, 0.45, 0.0, 761, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "db", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " db = kwargs.pop('using', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1146_C8", "label": "defaults =", "type": "assigned_variable", "loc": [1146, 1149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "vector": [14, 2, 0.9867, 0.0034, 2, 0.45, 0.25, 233, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "defaults", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults = {\n 'form_class': forms.ModelMultipleChoiceField,\n 'queryset': self.rel.to._default_manager.using(db).complex_filter(self.rel.limit_choices_to)\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1150_C8", "label": "update()", "type": "expression", "loc": [1150, 1150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "vector": [8, 2, 0.9888, 0.0009, 2, 0.45, 0.5, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " defaults.update(kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "label": "if", "type": "if", "loc": [1153, 1157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "vector": [4, 2, 0.9931, 0.0043, 2, 0.45, 0.75, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if defaults.get('initial') is not None:\n initial = defaults['initial']\n if callable(initial):\n initial = initial()\n defaults['initial'] = [i._get_pk_val() for i in initial]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1154_C12", "label": "initial =", "type": "assigned_variable", "loc": [1154, 1154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "vector": [14, 3, 0.9923, 0.0009, 3, 0.99, 0.0, 838, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " initial = defaults['initial']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1155_C12", "label": "if", "type": "if", "loc": [1155, 1156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "vector": [4, 3, 0.9936, 0.0017, 3, 0.99, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if callable(initial):\n initial = initial()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1156_C16", "label": "initial = initial()", "type": "assigned_variable", "loc": [1156, 1156], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1155_C12", "vector": [14, 4, 0.994, 0.0009, 4, 0.52, 0.0, 838, 3, 0, 0, 0, 838, 10, 1], "semantic": {"name": "initial", "arg_names": [], "import_names": [], "rhs_call_name": "initial", "annotation": ""}, "snippet": " initial = initial()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1157_C12", "label": "assign", "type": "assigned_variable", "loc": [1157, 1157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "vector": [14, 3, 0.9948, 0.0009, 3, 0.99, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " defaults['initial'] = [i._get_pk_val() for i in initial]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1158_C8", "label": "return", "type": "return", "loc": [1158, 1158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "vector": [13, 2, 0.9957, 0.0009, 2, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return super(ManyToManyField, self).formfield(**defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1160_C4", "label": "db_type", "type": "function", "loc": [1160, 1163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "vector": [2, 1, 0.9987, 0.0034, 1, 0.01, 1.0, 976, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "db_type", "arg_names": ["self", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_type(self, connection):\n # A ManyToManyField is not represented by a single column,\n # so return None.\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1163_C8", "label": "return", "type": "return", "loc": [1163, 1163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1160_C4", "vector": [13, 2, 1.0, 0.0009, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return None"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L138_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L137_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L151_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L152_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L153_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L154_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L153_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L166_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L183_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:While_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L89_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L221_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L222_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L224_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L226_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L223_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L230_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L242_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L245_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L249_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L251_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L250_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L253_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L252_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L254_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L255_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L278_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L279_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L283_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L286_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L288_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L288_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L289_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L293_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L292_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L295_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L299_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L300_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L302_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L301_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L304_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L305_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L282_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L306_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L268_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L314_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L317_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L321_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L323_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L322_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L325_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L324_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L326_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L326_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L327_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L342_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L335_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L348_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L347_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L349_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L349_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L350_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L356_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L355_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L359_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L372_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L372_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L376_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L377_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L389_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L390_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L382_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L393_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L399_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L366_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L403_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L411_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L410_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L412_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L414_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L414_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L416_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L418_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L415_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L419_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L420_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L423_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L424_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L422_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L425_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L426_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L431_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L432_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L428_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L433_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L434_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L439_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L438_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L440_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L440_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L443_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L442_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L444_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L447_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L449_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L449_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L451_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L450_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L452_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L453_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L456_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L457_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L459_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L402_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L464_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L471_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L473_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L474_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L475_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L476_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L478_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L479_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L480_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L481_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L485_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L484_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L486_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L492_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L491_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L495_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L495_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L496_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L497_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L500_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L499_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L503_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L503_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L504_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L490_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L505_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L508_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L507_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L511_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L511_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L512_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L513_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L518_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L518_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L519_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L521_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L522_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L523_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L515_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L524_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L525_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L528_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L529_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L533_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L533_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L534_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L527_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L535_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L536_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L545_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L538_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L547_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L548_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L548_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L550_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L553_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L549_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L554_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L554_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L557_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L558_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L559_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L560_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L564_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L566_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L566_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L569_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L573_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L573_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L574_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L546_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L578_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L578_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L581_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L585_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L585_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L593_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L594_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L594_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L596_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L595_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L598_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L600_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L602_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L602_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L605_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L609_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L591_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L613_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L613_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L616_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L467_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L621_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L623_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L623_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L626_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L629_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L620_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L632_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L632_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L635_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L463_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L639_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L648_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L648_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L649_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L652_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L652_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L653_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L657_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L658_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L659_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L661_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L651_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L671_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L641_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L674_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L677_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L677_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L678_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L681_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L682_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L673_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L683_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L693_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L693_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L694_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L696_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L696_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L700_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L701_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L704_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L704_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L705_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L709_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L710_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L711_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L713_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L703_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L723_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L686_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L726_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L729_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L729_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L730_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L733_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L734_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L725_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L735_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L740_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L740_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L741_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L744_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L745_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L746_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L746_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L747_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L748_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L749_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L750_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L738_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L751_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L754_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L753_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L755_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L737_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L758_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L762_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L763_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L757_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L766_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L768_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L771_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L769_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L775_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L780_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L781_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L782_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L782_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L783_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L784_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L785_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L786_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L778_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L787_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L790_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L789_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L791_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L777_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L794_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L793_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L799_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L802_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L803_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L806_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L809_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L808_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L817_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L818_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L820_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L820_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L821_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L823_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L807_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L829_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L832_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L832_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L833_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L834_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L835_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L835_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L836_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L838_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L839_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L831_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L840_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L844_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L844_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L845_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L847_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L847_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L848_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L851_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L852_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L853_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L853_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L854_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L850_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L855_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L857_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L857_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L859_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L858_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L861_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L865_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L865_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L871_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L870_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L872_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L872_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L873_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L864_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L874_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L877_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L878_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L880_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L879_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L882_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L876_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L883_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L888_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L888_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L889_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L885_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L890_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L890_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L891_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L894_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L895_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L900_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L893_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L901_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L801_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L910_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L903_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L911_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L914_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L920_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L922_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L921_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L923_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L925_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L925_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L926_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L930_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L930_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L931_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L929_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L932_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L913_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L934_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L934_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L936_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L935_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L938_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:ImportFrom_L941_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L942_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L944_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L945_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L946_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L946_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L947_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L948_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L943_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L950_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L951_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L952_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L954_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L955_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L949_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L956_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L957_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L959_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L960_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L962_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L958_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L963_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L964_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L940_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L974_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L982_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L984_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L989_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L990_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L996_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L997_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1000_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1002_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L983_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1003_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1005_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1005_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1006_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1009_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1008_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1011_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1010_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1013_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1012_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1015_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1019_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1020_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1021_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1021_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1022_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1018_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1023_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1023_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1025_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1024_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1026_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1029_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1030_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1031_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1031_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1032_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1033_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1034_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:For_L1034_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1035_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1035_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1042_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1041_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1045_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1036_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1047_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1028_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1049_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1052_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1053_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1055_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:Try_L1054_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1058_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1059_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1051_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1060_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1060_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1061_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1071_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1073_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1074_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1072_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1079_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1078_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1080_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1080_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1081_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1070_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1082_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1091_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1091_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1092_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1094_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1099_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1099_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1111_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1118_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1084_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1124_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1125_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Expr_L1150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1155_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1156_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:If_L1153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Assign_L1157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:ClassDef_L981_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99021:FunctionDef_L1160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99021:Return_L1163_C8"}] |
"""
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the __metaclass__ for your Field subclass, implement
to_python() and the other necessary methods and everything will work seamlessly.
"""
from inspect import getargspec
from warnings import warn
def call_with_connection(func):
arg_names, varargs, varkwargs, defaults = getargspec(func)
updated = ('connection' in arg_names or varkwargs)
if not updated:
warn("A Field class whose %s method hasn't been updated to take a "
"`connection` argument." % func.__name__,
DeprecationWarning, stacklevel=3)
def inner(*args, **kwargs):
if 'connection' not in kwargs:
from django.db import connection
kwargs['connection'] = connection
warn("%s has been called without providing a connection argument. " %
func.__name__, DeprecationWarning,
stacklevel=2)
if updated:
return func(*args, **kwargs)
if 'connection' in kwargs:
del kwargs['connection']
return func(*args, **kwargs)
return inner
def call_with_connection_and_prepared(func):
arg_names, varargs, varkwargs, defaults = getargspec(func)
updated = (
('connection' in arg_names or varkwargs) and
('prepared' in arg_names or varkwargs)
)
if not updated:
warn("A Field class whose %s method hasn't been updated to take "
"`connection` and `prepared` arguments." % func.__name__,
DeprecationWarning, stacklevel=3)
def inner(*args, **kwargs):
if 'connection' not in kwargs:
from django.db import connection
kwargs['connection'] = connection
warn("%s has been called without providing a connection argument. " %
func.__name__, DeprecationWarning,
stacklevel=2)
if updated:
return func(*args, **kwargs)
if 'connection' in kwargs:
del kwargs['connection']
if 'prepared' in kwargs:
del kwargs['prepared']
return func(*args, **kwargs)
return inner
class LegacyConnection(type):
"""
A metaclass to normalize arguments give to the get_db_prep_* and db_type
methods on fields.
"""
def __new__(cls, names, bases, attrs):
new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)
for attr in ('db_type', 'get_db_prep_save'):
setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))
for attr in ('get_db_prep_lookup', 'get_db_prep_value'):
setattr(new_cls, attr, call_with_connection_and_prepared(getattr(new_cls, attr)))
return new_cls
class SubfieldBase(LegacyConnection):
"""
A metaclass for custom Field subclasses. This ensures the model's attribute
has the descriptor protocol attached to it.
"""
def __new__(cls, base, name, attrs):
new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)
new_class.contribute_to_class = make_contrib(
new_class, attrs.get('contribute_to_class')
)
return new_class
class Creator(object):
"""
A placeholder class that provides a way to set the attribute on the model.
"""
def __init__(self, field):
self.field = field
def __get__(self, obj, type=None):
if obj is None:
raise AttributeError('Can only be accessed via an instance.')
return obj.__dict__[self.field.name]
def __set__(self, obj, value):
obj.__dict__[self.field.name] = self.field.to_python(value)
def make_contrib(superclass, func=None):
"""
Returns a suitable contribute_to_class() method for the Field subclass.
If 'func' is passed in, it is the existing contribute_to_class() method on
the subclass and it is called before anything else. It is assumed in this
case that the existing contribute_to_class() calls all the necessary
superclass methods.
"""
def contribute_to_class(self, cls, name):
if func:
func(self, cls, name)
else:
super(superclass, self).contribute_to_class(cls, name)
setattr(cls, self.name, Creator(self))
return contribute_to_class
| ajibawa-2023/Python-Code-Large/train/row_99022 | 66 | 117 | 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_99022:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0342, 0.0598, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nConvenience routines for creating non-trivial Field subclasses, as well as\nbackwards compatibility utilities.\n\nAdd SubfieldBase as the __metaclass__ for your Field subclass, implement\nto_python() and the other necessary methods and everything will work seamlessly.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L9_C0", "label": "from inspect import getargspec", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0769, 0.0085, 0, 0.66, 0.125, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["getargspec"], "rhs_call_name": "", "annotation": ""}, "snippet": "from inspect import getargspec"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L10_C0", "label": "from warnings import warn", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0855, 0.0085, 0, 0.66, 0.25, 358, 0, 1, 0, 0, 358, 0, 0], "semantic": {"name": "warnings", "arg_names": [], "import_names": ["warn"], "rhs_call_name": "", "annotation": ""}, "snippet": "from warnings import warn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "label": "call_with_connection", "type": "function", "loc": [12, 32], "level": 0, "parent": null, "vector": [2, 0, 0.188, 0.1795, 0, 0.66, 0.375, 769, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "call_with_connection", "arg_names": ["func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def call_with_connection(func):\n arg_names, varargs, varkwargs, defaults = getargspec(func)\n updated = ('connection' in arg_names or varkwargs)\n if not updated:\n warn(\"A Field class whose %s method hasn't been updated to take a \"\n \"`connection` argument.\" % func.__name__,\n DeprecationWarning, stacklevel=3)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L13_C4", "label": "arg_names, varargs, varkwargs, defaults = getargspec()", "type": "assigned_variable", "loc": [13, 13], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "vector": [14, 1, 0.1111, 0.0085, 1, 0.74, 0.0, 800, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "arg_names, varargs, varkwargs, defaults", "arg_names": [], "import_names": [], "rhs_call_name": "getargspec", "annotation": ""}, "snippet": " arg_names, varargs, varkwargs, defaults = getargspec(func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L14_C4", "label": "updated =", "type": "assigned_variable", "loc": [14, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "vector": [14, 1, 0.1197, 0.0085, 1, 0.74, 0.25, 599, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " updated = ('connection' in arg_names or varkwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L15_C4", "label": "if", "type": "if", "loc": [15, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "vector": [4, 1, 0.141, 0.0342, 1, 0.74, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not updated:\n warn(\"A Field class whose %s method hasn't been updated to take a \"\n \"`connection` argument.\" % func.__name__,\n DeprecationWarning, stacklevel=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L16_C8", "label": "warn()", "type": "expression", "loc": [16, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L15_C4", "vector": [8, 2, 0.1453, 0.0256, 2, 0.32, 0.0, 960, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warn(\"A Field class whose %s method hasn't been updated to take a \"\n \"`connection` argument.\" % func.__name__,\n DeprecationWarning, stacklevel=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "label": "inner", "type": "function", "loc": [20, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "vector": [2, 1, 0.2179, 0.1026, 1, 0.74, 0.75, 763, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "inner", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def inner(*args, **kwargs):\n if 'connection' not in kwargs:\n from django.db import connection\n kwargs['connection'] = connection\n warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)\n if updated:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "label": "if", "type": "if", "loc": [21, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "vector": [4, 2, 0.2009, 0.0513, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'connection' not in kwargs:\n from django.db import connection\n kwargs['connection'] = connection\n warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L22_C12", "label": "from django.db import connection", "type": "import", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "vector": [1, 3, 0.188, 0.0085, 3, 0.08, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connection"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L23_C12", "label": "assign", "type": "assigned_variable", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "vector": [14, 3, 0.1966, 0.0085, 3, 0.08, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['connection'] = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L24_C12", "label": "warn()", "type": "expression", "loc": [24, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "vector": [8, 3, 0.2137, 0.0256, 3, 0.08, 1.0, 960, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L27_C8", "label": "if", "type": "if", "loc": [27, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "vector": [4, 2, 0.235, 0.0171, 2, 0.51, 0.3333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if updated:\n return func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L27_C8", "vector": [13, 3, 0.2393, 0.0085, 3, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L29_C8", "label": "if", "type": "if", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "vector": [4, 2, 0.2521, 0.0171, 2, 0.51, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'connection' in kwargs:\n del kwargs['connection']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "vector": [13, 2, 0.265, 0.0085, 2, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L32_C4", "label": "return", "type": "return", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "vector": [13, 1, 0.2735, 0.0085, 1, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return inner"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "label": "call_with_connection_and_prepared", "type": "function", "loc": [34, 59], "level": 0, "parent": null, "vector": [2, 0, 0.3974, 0.2222, 0, 0.66, 0.5, 745, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "call_with_connection_and_prepared", "arg_names": ["func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def call_with_connection_and_prepared(func):\n arg_names, varargs, varkwargs, defaults = getargspec(func)\n updated = (\n ('connection' in arg_names or varkwargs) and\n ('prepared' in arg_names or varkwargs)\n )\n if not updated:\n warn(\"A Field class whose %s method hasn't been updated to take \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L35_C4", "label": "arg_names, varargs, varkwargs, defaults = getargspec()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "vector": [14, 1, 0.2991, 0.0085, 1, 0.59, 0.0, 800, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "arg_names, varargs, varkwargs, defaults", "arg_names": [], "import_names": [], "rhs_call_name": "getargspec", "annotation": ""}, "snippet": " arg_names, varargs, varkwargs, defaults = getargspec(func)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L36_C4", "label": "updated =", "type": "assigned_variable", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "vector": [14, 1, 0.3205, 0.0342, 1, 0.59, 0.25, 599, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "updated", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " updated = (\n ('connection' in arg_names or varkwargs) and\n ('prepared' in arg_names or varkwargs)\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L40_C4", "label": "if", "type": "if", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "vector": [4, 1, 0.3547, 0.0342, 1, 0.59, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not updated:\n warn(\"A Field class whose %s method hasn't been updated to take \"\n \"`connection` and `prepared` arguments.\" % func.__name__,\n DeprecationWarning, stacklevel=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L41_C8", "label": "warn()", "type": "expression", "loc": [41, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L40_C4", "vector": [8, 2, 0.359, 0.0256, 2, 0.35, 0.0, 960, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warn(\"A Field class whose %s method hasn't been updated to take \"\n \"`connection` and `prepared` arguments.\" % func.__name__,\n DeprecationWarning, stacklevel=3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "label": "inner", "type": "function", "loc": [45, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "vector": [2, 1, 0.4402, 0.1197, 1, 0.59, 0.75, 763, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "inner", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def inner(*args, **kwargs):\n if 'connection' not in kwargs:\n from django.db import connection\n kwargs['connection'] = connection\n warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)\n if updated:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "label": "if", "type": "if", "loc": [46, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "vector": [4, 2, 0.4145, 0.0513, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'connection' not in kwargs:\n from django.db import connection\n kwargs['connection'] = connection\n warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L47_C12", "label": "from django.db import connection", "type": "import", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "vector": [1, 3, 0.4017, 0.0085, 3, 0.97, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connection"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L48_C12", "label": "assign", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "vector": [14, 3, 0.4103, 0.0085, 3, 0.97, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kwargs['connection'] = connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L49_C12", "label": "warn()", "type": "expression", "loc": [49, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "vector": [8, 3, 0.4274, 0.0256, 3, 0.97, 1.0, 960, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " warn(\"%s has been called without providing a connection argument. \" %\n func.__name__, DeprecationWarning,\n stacklevel=2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "vector": [4, 2, 0.4487, 0.0171, 2, 0.71, 0.25, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if updated:\n return func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L52_C8", "vector": [13, 3, 0.453, 0.0085, 3, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L54_C8", "label": "if", "type": "if", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "vector": [4, 2, 0.4658, 0.0171, 2, 0.71, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'connection' in kwargs:\n del kwargs['connection']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L56_C8", "label": "if", "type": "if", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "vector": [4, 2, 0.4829, 0.0171, 2, 0.71, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'prepared' in kwargs:\n del kwargs['prepared']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "vector": [13, 2, 0.4957, 0.0085, 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 func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L59_C4", "label": "return", "type": "return", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "vector": [13, 1, 0.5043, 0.0085, 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 inner"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L61_C0", "label": "LegacyConnection", "type": "class", "loc": [61, 72], "level": 0, "parent": null, "vector": [3, 0, 0.5684, 0.1026, 0, 0.66, 0.625, 965, 0, 1, 0, 0, 801, 0, 8], "semantic": {"name": "LegacyConnection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LegacyConnection(type):\n \"\"\"\n A metaclass to normalize arguments give to the get_db_prep_* and db_type\n methods on fields.\n \"\"\"\n def __new__(cls, names, bases, attrs):\n new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)\n for attr in ('db_type', 'get_db_prep_save'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L62_C4", "label": "expression", "type": "expression", "loc": [62, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L61_C0", "vector": [8, 1, 0.5427, 0.0342, 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 A metaclass to normalize arguments give to the get_db_prep_* and db_type\n methods on fields.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "label": "__new__", "type": "function", "loc": [66, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L61_C0", "vector": [2, 1, 0.5897, 0.0598, 1, 0.34, 1.0, 42, 0, 4, 1, 0, 0, 0, 8], "semantic": {"name": "__new__", "arg_names": ["cls", "names", "bases", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __new__(cls, names, bases, attrs):\n new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)\n for attr in ('db_type', 'get_db_prep_save'):\n setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))\n for attr in ('get_db_prep_lookup', 'get_db_prep_value'):\n setattr(new_cls, attr, call_with_connection_and_prepared(getattr(new_cls, attr)))\n return new_cls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L67_C8", "label": "new_cls = __new__()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "vector": [14, 2, 0.5726, 0.0085, 2, 0.45, 0.0, 290, 3, 4, 0, 0, 42, 10, 2], "semantic": {"name": "new_cls", "arg_names": [], "import_names": [], "rhs_call_name": "__new__", "annotation": ""}, "snippet": " new_cls = super(LegacyConnection, cls).__new__(cls, names, bases, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L68_C8", "label": "for attr", "type": "for", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "vector": [6, 2, 0.5855, 0.0171, 2, 0.45, 0.3333, 400, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for attr in ('db_type', 'get_db_prep_save'):\n setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L69_C12", "label": "setattr()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L68_C8", "vector": [8, 3, 0.5897, 0.0085, 3, 0.49, 0.0, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(new_cls, attr, call_with_connection(getattr(new_cls, attr)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L70_C8", "label": "for attr", "type": "for", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "vector": [6, 2, 0.6026, 0.0171, 2, 0.45, 0.6667, 400, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "attr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for attr in ('get_db_prep_lookup', 'get_db_prep_value'):\n setattr(new_cls, attr, call_with_connection_and_prepared(getattr(new_cls, attr)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L71_C12", "label": "setattr()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L70_C8", "vector": [8, 3, 0.6068, 0.0085, 3, 0.47, 0.0, 501, 3, 3, 0, 0, 0, 0, 3], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(new_cls, attr, call_with_connection_and_prepared(getattr(new_cls, attr)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L72_C8", "label": "return", "type": "return", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "vector": [13, 2, 0.6154, 0.0085, 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 new_cls"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L74_C0", "label": "SubfieldBase", "type": "class", "loc": [74, 84], "level": 0, "parent": null, "vector": [3, 0, 0.6752, 0.094, 0, 0.66, 0.75, 66, 0, 1, 0, 0, 965, 0, 4], "semantic": {"name": "SubfieldBase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SubfieldBase(LegacyConnection):\n \"\"\"\n A metaclass for custom Field subclasses. This ensures the model's attribute\n has the descriptor protocol attached to it.\n \"\"\"\n def __new__(cls, base, name, attrs):\n new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)\n new_class.contribute_to_class = make_contrib("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L75_C4", "label": "expression", "type": "expression", "loc": [75, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L74_C0", "vector": [8, 1, 0.6538, 0.0342, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A metaclass for custom Field subclasses. This ensures the model's attribute\n has the descriptor protocol attached to it.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "label": "__new__", "type": "function", "loc": [79, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L74_C0", "vector": [2, 1, 0.6966, 0.0513, 1, 0.32, 1.0, 42, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "__new__", "arg_names": ["cls", "base", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __new__(cls, base, name, attrs):\n new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)\n new_class.contribute_to_class = make_contrib(\n new_class, attrs.get('contribute_to_class')\n )\n return new_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L80_C8", "label": "new_class = __new__()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "vector": [14, 2, 0.6838, 0.0085, 2, 0.41, 0.0, 746, 3, 4, 0, 0, 42, 10, 2], "semantic": {"name": "new_class", "arg_names": [], "import_names": [], "rhs_call_name": "__new__", "annotation": ""}, "snippet": " new_class = super(SubfieldBase, cls).__new__(cls, base, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L81_C8", "label": "new_class.contribute_to_class = make_contrib()", "type": "assigned_variable", "loc": [81, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "vector": [14, 2, 0.7009, 0.0256, 2, 0.41, 0.5, 443, 3, 2, 0, 0, 926, 10, 2], "semantic": {"name": "new_class.contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "make_contrib", "annotation": ""}, "snippet": " new_class.contribute_to_class = make_contrib(\n new_class, attrs.get('contribute_to_class')\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "vector": [13, 2, 0.7179, 0.0085, 2, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return new_class"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "label": "Creator", "type": "class", "loc": [86, 99], "level": 0, "parent": null, "vector": [3, 0, 0.7906, 0.1197, 0, 0.66, 0.875, 117, 0, 3, 0, 0, 186, 0, 2], "semantic": {"name": "Creator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Creator(object):\n \"\"\"\n A placeholder class that provides a way to set the attribute on the model.\n \"\"\"\n def __init__(self, field):\n self.field = field\n\n def __get__(self, obj, type=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L87_C4", "label": "expression", "type": "expression", "loc": [87, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "vector": [8, 1, 0.7521, 0.0256, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A placeholder class that provides a way to set the attribute on the model.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L90_C4", "label": "__init__", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "vector": [2, 1, 0.7735, 0.0171, 1, 0.44, 0.3333, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, field):\n self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L91_C8", "label": "self.field =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L90_C4", "vector": [14, 2, 0.7778, 0.0085, 2, 0.43, 0.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4", "label": "__get__", "type": "function", "loc": [93, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "vector": [2, 1, 0.8077, 0.0342, 1, 0.44, 0.6667, 93, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "__get__", "arg_names": ["self", "obj", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, obj, type=None):\n if obj is None:\n raise AttributeError('Can only be accessed via an instance.')\n return obj.__dict__[self.field.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4", "vector": [4, 2, 0.8077, 0.0171, 2, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj is None:\n raise AttributeError('Can only be accessed via an instance.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4", "vector": [13, 2, 0.8205, 0.0085, 2, 0.12, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj.__dict__[self.field.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L98_C4", "label": "__set__", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "vector": [2, 1, 0.8419, 0.0171, 1, 0.44, 1.0, 145, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__set__", "arg_names": ["self", "obj", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, obj, value):\n obj.__dict__[self.field.name] = self.field.to_python(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L99_C8", "label": " = to_python()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L98_C4", "vector": [14, 2, 0.8462, 0.0085, 2, 0.22, 0.0, 0, 3, 1, 0, 0, 800, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "to_python", "annotation": ""}, "snippet": " obj.__dict__[self.field.name] = self.field.to_python(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "label": "make_contrib", "type": "function", "loc": [101, 117], "level": 0, "parent": null, "vector": [2, 0, 0.9316, 0.1453, 0, 0.66, 1.0, 926, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "make_contrib", "arg_names": ["superclass", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def make_contrib(superclass, func=None):\n \"\"\"\n Returns a suitable contribute_to_class() method for the Field subclass.\n\n If 'func' is passed in, it is the existing contribute_to_class() method on\n the subclass and it is called before anything else. It is assumed in this\n case that the existing contribute_to_class() calls all the necessary\n superclass methods."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L102_C4", "label": "expression", "type": "expression", "loc": [102, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "vector": [8, 1, 0.9017, 0.0684, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a suitable contribute_to_class() method for the Field subclass.\n\n If 'func' is passed in, it is the existing contribute_to_class() method on\n the subclass and it is called before anything else. It is assumed in this\n case that the existing contribute_to_class() calls all the necessary\n superclass methods.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4", "label": "contribute_to_class", "type": "function", "loc": [110, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "vector": [2, 1, 0.9615, 0.0513, 1, 0.65, 0.5, 973, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n if func:\n func(self, cls, name)\n else:\n super(superclass, self).contribute_to_class(cls, name)\n setattr(cls, self.name, Creator(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8", "label": "if", "type": "if", "loc": [111, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4", "vector": [4, 2, 0.9615, 0.0342, 2, 0.65, 0.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if func:\n func(self, cls, name)\n else:\n super(superclass, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L112_C12", "label": "func()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8", "vector": [8, 3, 0.9573, 0.0085, 3, 0.1, 0.0, 856, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "func", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " func(self, cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L114_C12", "label": "contribute_to_class()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8", "vector": [8, 3, 0.9744, 0.0085, 3, 0.1, 1.0, 973, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "contribute_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "contribute_to_class", "annotation": ""}, "snippet": " super(superclass, self).contribute_to_class(cls, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L115_C8", "label": "setattr()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4", "vector": [8, 2, 0.9829, 0.0085, 2, 0.65, 1.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(cls, self.name, Creator(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "vector": [13, 1, 1.0, 0.0085, 1, 0.65, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return contribute_to_class"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:ImportFrom_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L61_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L74_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:ClassDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:If_L111_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99022:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99022:Return_L117_C4"}] |
"Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
import imp
import sys
import os
import threading
__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models',
'load_app', 'app_cache_ready')
class AppCache(object):
"""
A cache that stores installed applications and their models. Used to
provide reverse-relations and for app introspection (e.g. admin).
"""
# Use the Borg pattern to share state between all instances. Details at
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531.
__shared_state = dict(
# Keys of app_store are the model modules for each application.
app_store = SortedDict(),
# Mapping of app_labels to a dictionary of model names to model code.
app_models = SortedDict(),
# Mapping of app_labels to errors raised when trying to import the app.
app_errors = {},
# -- Everything below here is only used when populating the cache --
loaded = False,
handled = {},
postponed = [],
nesting_level = 0,
write_lock = threading.RLock(),
_get_models_cache = {},
)
def __init__(self):
self.__dict__ = self.__shared_state
def _populate(self):
"""
Fill in all the cache information. This method is threadsafe, in the
sense that every caller will see the same state upon return, and if the
cache is already initialised, it does no work.
"""
if self.loaded:
return
self.write_lock.acquire()
try:
if self.loaded:
return
for app_name in settings.INSTALLED_APPS:
if app_name in self.handled:
continue
self.load_app(app_name, True)
if not self.nesting_level:
for app_name in self.postponed:
self.load_app(app_name)
self.loaded = True
finally:
self.write_lock.release()
def load_app(self, app_name, can_postpone=False):
"""
Loads the app with the provided fully qualified name, and returns the
model module.
"""
self.handled[app_name] = None
self.nesting_level += 1
app_module = import_module(app_name)
try:
models = import_module('.models', app_name)
except ImportError:
self.nesting_level -= 1
# If the app doesn't have a models module, we can just ignore the
# ImportError and return no models for it.
if not module_has_submodule(app_module, 'models'):
return None
# But if the app does have a models module, we need to figure out
# whether to suppress or propagate the error. If can_postpone is
# True then it may be that the package is still being imported by
# Python and the models module isn't available yet. So we add the
# app to the postponed list and we'll try it again after all the
# recursion has finished (in populate). If can_postpone is False
# then it's time to raise the ImportError.
else:
if can_postpone:
self.postponed.append(app_name)
return None
else:
raise
self.nesting_level -= 1
if models not in self.app_store:
self.app_store[models] = len(self.app_store)
return models
def app_cache_ready(self):
"""
Returns true if the model cache is fully populated.
Useful for code that wants to cache the results of get_models() for
themselves once it is safe to do so.
"""
return self.loaded
def get_apps(self):
"Returns a list of all installed modules that contain models."
self._populate()
# Ensure the returned list is always in the same order (with new apps
# added at the end). This avoids unstable ordering on the admin app
# list page, for example.
apps = [(v, k) for k, v in self.app_store.items()]
apps.sort()
return [elt[1] for elt in apps]
def get_app(self, app_label, emptyOK=False):
"""
Returns the module containing the models for the given app_label. If
the app has no models in it and 'emptyOK' is True, returns None.
"""
self._populate()
self.write_lock.acquire()
try:
for app_name in settings.INSTALLED_APPS:
if app_label == app_name.split('.')[-1]:
mod = self.load_app(app_name, False)
if mod is None:
if emptyOK:
return None
else:
return mod
raise ImproperlyConfigured("App with label %s could not be found" % app_label)
finally:
self.write_lock.release()
def get_app_errors(self):
"Returns the map of known problems with the INSTALLED_APPS."
self._populate()
return self.app_errors
def get_models(self, app_mod=None, include_auto_created=False, include_deferred=False):
"""
Given a module containing models, returns a list of the models.
Otherwise returns a list of all installed models.
By default, auto-created models (i.e., m2m models without an
explicit intermediate table) are not included. However, if you
specify include_auto_created=True, they will be.
By default, models created to satisfy deferred attribute
queries are *not* included in the list of models. However, if
you specify include_deferred, they will be.
"""
cache_key = (app_mod, include_auto_created, include_deferred)
try:
return self._get_models_cache[cache_key]
except KeyError:
pass
self._populate()
if app_mod:
app_list = [self.app_models.get(app_mod.__name__.split('.')[-2], SortedDict())]
else:
app_list = self.app_models.itervalues()
model_list = []
for app in app_list:
model_list.extend(
model for model in app.values()
if ((not model._deferred or include_deferred)
and (not model._meta.auto_created or include_auto_created))
)
self._get_models_cache[cache_key] = model_list
return model_list
def get_model(self, app_label, model_name, seed_cache=True):
"""
Returns the model matching the given app_label and case-insensitive
model_name.
Returns None if no model is found.
"""
if seed_cache:
self._populate()
return self.app_models.get(app_label, SortedDict()).get(model_name.lower())
def register_models(self, app_label, *models):
"""
Register a set of models as belonging to an app.
"""
for model in models:
# Store as 'name: model' pair in a dictionary
# in the app_models dictionary
model_name = model._meta.object_name.lower()
model_dict = self.app_models.setdefault(app_label, SortedDict())
if model_name in model_dict:
# The same model may be imported via different paths (e.g.
# appname.models and project.appname.models). We use the source
# filename as a means to detect identity.
fname1 = os.path.abspath(sys.modules[model.__module__].__file__)
fname2 = os.path.abspath(sys.modules[model_dict[model_name].__module__].__file__)
# Since the filename extension could be .py the first time and
# .pyc or .pyo the second time, ignore the extension when
# comparing.
if os.path.splitext(fname1)[0] == os.path.splitext(fname2)[0]:
continue
model_dict[model_name] = model
self._get_models_cache.clear()
cache = AppCache()
# These methods were always module level, so are kept that way for backwards
# compatibility.
get_apps = cache.get_apps
get_app = cache.get_app
get_app_errors = cache.get_app_errors
get_models = cache.get_models
get_model = cache.get_model
register_models = cache.register_models
load_app = cache.load_app
app_cache_ready = cache.app_cache_ready
| ajibawa-2023/Python-Code-Large/train/row_99024 | 111 | 227 | 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_99024:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0044, 0.0044, 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 loading models and the modules that contain them.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:ImportFrom_L3_C0", "label": "from django.conf import settings", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0132, 0.0044, 0, 0.66, 0.05, 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_99024:ImportFrom_L4_C0", "label": "from django.core.exceptions import ImproperlyConfigured", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0176, 0.0044, 0, 0.66, 0.1, 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_99024:ImportFrom_L5_C0", "label": "from django.utils.datastructures import SortedDict", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.022, 0.0044, 0, 0.66, 0.15, 757, 0, 1, 0, 0, 757, 0, 0], "semantic": {"name": "django.utils.datastructures", "arg_names": [], "import_names": ["SortedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.datastructures import SortedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:ImportFrom_L6_C0", "label": "from django.utils.importlib import import_module", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0264, 0.0044, 0, 0.66, 0.2, 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_99024:ImportFrom_L7_C0", "label": "from django.utils.module_loading import module_has_submodule", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0308, 0.0044, 0, 0.66, 0.25, 689, 0, 1, 0, 0, 689, 0, 0], "semantic": {"name": "django.utils.module_loading", "arg_names": [], "import_names": ["module_has_submodule"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.module_loading import module_has_submodule"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Import_L9_C0", "label": "imp import imp", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0396, 0.0044, 0, 0.66, 0.3, 201, 0, 1, 0, 0, 201, 0, 0], "semantic": {"name": "imp", "arg_names": [], "import_names": ["imp"], "rhs_call_name": "", "annotation": ""}, "snippet": "import imp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0441, 0.0044, 0, 0.66, 0.35, 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_99024:Import_L11_C0", "label": "os import os", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0485, 0.0044, 0, 0.66, 0.4, 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_99024:Import_L12_C0", "label": "threading import threading", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0529, 0.0044, 0, 0.66, 0.45, 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_99024:Assign_L14_C0", "label": "__all__ =", "type": "assigned_variable", "loc": [14, 15], "level": 0, "parent": null, "vector": [14, 0, 0.0639, 0.0088, 0, 0.66, 0.5, 272, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "__all__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models',\n 'load_app', 'app_cache_ready')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "label": "AppCache", "type": "class", "loc": [17, 214], "level": 0, "parent": null, "vector": [3, 0, 0.5088, 0.8722, 0, 0.66, 0.55, 670, 0, 10, 0, 0, 186, 0, 43], "semantic": {"name": "AppCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AppCache(object):\n \"\"\"\n A cache that stores installed applications and their models. Used to\n provide reverse-relations and for app introspection (e.g. admin).\n \"\"\"\n # Use the Borg pattern to share state between all instances. Details at\n # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531.\n __shared_state = dict("}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L18_C4", "label": "expression", "type": "expression", "loc": [18, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [8, 1, 0.0859, 0.0176, 1, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A cache that stores installed applications and their models. Used to\n provide reverse-relations and for app introspection (e.g. admin).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L24_C4", "label": "__shared_state = dict()", "type": "assigned_variable", "loc": [24, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [14, 1, 0.1432, 0.0793, 1, 0.2, 0.0909, 290, 3, 9, 0, 0, 827, 10, 4], "semantic": {"name": "__shared_state", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " __shared_state = dict(\n # Keys of app_store are the model modules for each application.\n app_store = SortedDict(),\n\n # Mapping of app_labels to a dictionary of model names to model code.\n app_models = SortedDict(),\n\n # Mapping of app_labels to errors raised when trying to import the app."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L43_C4", "label": "__init__", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.1916, 0.0088, 1, 0.2, 0.1818, 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.__dict__ = self.__shared_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L44_C8", "label": "self.__dict__ =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L43_C4", "vector": [14, 2, 0.1938, 0.0044, 2, 0.31, 0.0, 711, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__dict__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__dict__ = self.__shared_state"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "label": "_populate", "type": "function", "loc": [46, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.2489, 0.0969, 1, 0.2, 0.2727, 179, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_populate", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate(self):\n \"\"\"\n Fill in all the cache information. This method is threadsafe, in the\n sense that every caller will see the same state upon return, and if the\n cache is already initialised, it does no work.\n \"\"\"\n if self.loaded:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L47_C8", "label": "expression", "type": "expression", "loc": [47, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "vector": [8, 2, 0.2159, 0.022, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Fill in all the cache information. This method is threadsafe, in the\n sense that every caller will see the same state upon return, and if the\n cache is already initialised, it does no work.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "vector": [4, 2, 0.2313, 0.0088, 2, 0.92, 0.3333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.loaded:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L53_C12", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L52_C8", "vector": [13, 3, 0.2335, 0.0044, 3, 0.05, 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_99024:Expr_L54_C8", "label": "acquire()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "vector": [8, 2, 0.2379, 0.0044, 2, 0.92, 0.6667, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.write_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "label": "try", "type": "try", "loc": [55, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "vector": [7, 2, 0.2687, 0.0573, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if self.loaded:\n return\n for app_name in settings.INSTALLED_APPS:\n if app_name in self.handled:\n continue\n self.load_app(app_name, True)\n if not self.nesting_level:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L56_C12", "label": "if", "type": "if", "loc": [56, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "vector": [4, 3, 0.2489, 0.0088, 3, 0.83, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.loaded:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L57_C16", "label": "return", "type": "return", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L56_C12", "vector": [13, 4, 0.2511, 0.0044, 4, 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_99024:For_L58_C12", "label": "for app_name", "type": "for", "loc": [58, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "vector": [6, 3, 0.2621, 0.0176, 3, 0.83, 0.3333, 443, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "app_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app_name in settings.INSTALLED_APPS:\n if app_name in self.handled:\n continue\n self.load_app(app_name, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L59_C16", "label": "if", "type": "if", "loc": [59, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L58_C12", "vector": [4, 4, 0.2621, 0.0088, 4, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if app_name in self.handled:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L61_C16", "label": "load_app()", "type": "expression", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L58_C12", "vector": [8, 4, 0.2687, 0.0044, 4, 0.29, 1.0, 632, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "load_app", "arg_names": [], "import_names": [], "rhs_call_name": "load_app", "annotation": ""}, "snippet": " self.load_app(app_name, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12", "label": "if", "type": "if", "loc": [62, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "vector": [4, 3, 0.2797, 0.0176, 3, 0.83, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.nesting_level:\n for app_name in self.postponed:\n self.load_app(app_name)\n self.loaded = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L63_C16", "label": "for app_name", "type": "for", "loc": [63, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12", "vector": [6, 4, 0.2797, 0.0088, 4, 0.99, 0.0, 443, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "app_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app_name in self.postponed:\n self.load_app(app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L64_C20", "label": "load_app()", "type": "expression", "loc": [64, 64], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L63_C16", "vector": [8, 5, 0.2819, 0.0044, 5, 0.55, 0.0, 632, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load_app", "arg_names": [], "import_names": [], "rhs_call_name": "load_app", "annotation": ""}, "snippet": " self.load_app(app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L65_C16", "label": "self.loaded =", "type": "assigned_variable", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12", "vector": [14, 4, 0.2863, 0.0044, 4, 0.99, 1.0, 307, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.loaded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.loaded = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L67_C12", "label": "release()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "vector": [8, 3, 0.2952, 0.0044, 3, 0.83, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.write_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "label": "load_app", "type": "function", "loc": [69, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.3767, 0.1498, 1, 0.2, 0.3636, 632, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "load_app", "arg_names": ["self", "app_name", "can_postpone"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def load_app(self, app_name, can_postpone=False):\n \"\"\"\n Loads the app with the provided fully qualified name, and returns the\n model module.\n \"\"\"\n self.handled[app_name] = None\n self.nesting_level += 1\n app_module = import_module(app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L70_C8", "label": "expression", "type": "expression", "loc": [70, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [8, 2, 0.315, 0.0176, 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 Loads the app with the provided fully qualified name, and returns the\n model module.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L74_C8", "label": "assign", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [14, 2, 0.326, 0.0044, 2, 0.86, 0.2, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.handled[app_name] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L76_C8", "label": "app_module = import_module()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [14, 2, 0.3348, 0.0044, 2, 0.86, 0.4, 621, 3, 1, 0, 0, 637, 10, 1], "semantic": {"name": "app_module", "arg_names": [], "import_names": [], "rhs_call_name": "import_module", "annotation": ""}, "snippet": " app_module = import_module(app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8", "label": "try", "type": "try", "loc": [77, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [7, 2, 0.3833, 0.0925, 2, 0.86, 0.6, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n models = import_module('.models', app_name)\n except ImportError:\n self.nesting_level -= 1\n # If the app doesn't have a models module, we can just ignore the\n # ImportError and return no models for it.\n if not module_has_submodule(app_module, 'models'):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L78_C12", "label": "models = import_module()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8", "vector": [14, 3, 0.3436, 0.0044, 3, 0.37, 0.0, 495, 3, 2, 0, 0, 637, 10, 1], "semantic": {"name": "models", "arg_names": [], "import_names": [], "rhs_call_name": "import_module", "annotation": ""}, "snippet": " models = import_module('.models', app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12", "label": "if", "type": "if", "loc": [83, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8", "vector": [4, 3, 0.3965, 0.0661, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not module_has_submodule(app_module, 'models'):\n return None\n # But if the app does have a models module, we need to figure out\n # whether to suppress or propagate the error. If can_postpone is\n # True then it may be that the package is still being imported by\n # Python and the models module isn't available yet. So we add the\n # app to the postponed list and we'll try it again after all the\n # recursion has finished (in populate). If can_postpone is False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L84_C16", "label": "return", "type": "return", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12", "vector": [13, 4, 0.37, 0.0044, 4, 0.11, 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_99024:If_L93_C16", "label": "if", "type": "if", "loc": [93, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12", "vector": [4, 4, 0.4185, 0.022, 4, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if can_postpone:\n self.postponed.append(app_name)\n return None\n else:\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L94_C20", "label": "append()", "type": "expression", "loc": [94, 94], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L93_C16", "vector": [8, 5, 0.4141, 0.0044, 5, 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": " self.postponed.append(app_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L95_C20", "label": "return", "type": "return", "loc": [95, 95], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L93_C16", "vector": [13, 5, 0.4185, 0.0044, 5, 0.62, 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_99024:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [4, 2, 0.4427, 0.0088, 2, 0.86, 0.8, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if models not in self.app_store:\n self.app_store[models] = len(self.app_store)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L101_C12", "label": " = len()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L100_C8", "vector": [14, 3, 0.4449, 0.0044, 3, 0.77, 0.0, 0, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " self.app_store[models] = len(self.app_store)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "vector": [13, 2, 0.4493, 0.0044, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4", "label": "app_cache_ready", "type": "function", "loc": [104, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.4736, 0.0352, 1, 0.2, 0.4545, 943, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "app_cache_ready", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def app_cache_ready(self):\n \"\"\"\n Returns true if the model cache is fully populated.\n\n Useful for code that wants to cache the results of get_models() for\n themselves once it is safe to do so.\n \"\"\"\n return self.loaded"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L105_C8", "label": "expression", "type": "expression", "loc": [105, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4", "vector": [8, 2, 0.4736, 0.0264, 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 true if the model cache is fully populated.\n\n Useful for code that wants to cache the results of get_models() for\n themselves once it is safe to do so.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4", "vector": [13, 2, 0.489, 0.0044, 2, 0.13, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.loaded"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "label": "get_apps", "type": "function", "loc": [113, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.5176, 0.0441, 1, 0.2, 0.5455, 221, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_apps", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_apps(self):\n \"Returns a list of all installed modules that contain models.\"\n self._populate()\n\n # Ensure the returned list is always in the same order (with new apps\n # added at the end). This avoids unstable ordering on the admin app\n # list page, for example.\n apps = [(v, k) for k, v in self.app_store.items()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L114_C8", "label": "expression", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "vector": [8, 2, 0.5022, 0.0044, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns a list of all installed modules that contain models.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L115_C8", "label": "_populate()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "vector": [8, 2, 0.5066, 0.0044, 2, 0.19, 0.25, 179, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L120_C8", "label": "apps =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "vector": [14, 2, 0.5286, 0.0044, 2, 0.19, 0.5, 556, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "apps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " apps = [(v, k) for k, v in self.app_store.items()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L121_C8", "label": "sort()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "vector": [8, 2, 0.533, 0.0044, 2, 0.19, 0.75, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " apps.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L122_C8", "label": "return", "type": "return", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "vector": [13, 2, 0.5374, 0.0044, 2, 0.19, 1.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [elt[1] for elt in apps]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "label": "get_app", "type": "function", "loc": [124, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.5859, 0.0837, 1, 0.2, 0.6364, 333, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "get_app", "arg_names": ["self", "app_label", "emptyOK"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_app(self, app_label, emptyOK=False):\n \"\"\"\n Returns the module containing the models for the given app_label. If\n the app has no models in it and 'emptyOK' is True, returns None.\n \"\"\"\n self._populate()\n self.write_lock.acquire()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L125_C8", "label": "expression", "type": "expression", "loc": [125, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "vector": [8, 2, 0.5573, 0.0176, 2, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the module containing the models for the given app_label. If\n the app has no models in it and 'emptyOK' is True, returns None.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L129_C8", "label": "_populate()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "vector": [8, 2, 0.5683, 0.0044, 2, 0.33, 0.3333, 179, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L130_C8", "label": "acquire()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "vector": [8, 2, 0.5727, 0.0044, 2, 0.33, 0.6667, 229, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "acquire", "arg_names": [], "import_names": [], "rhs_call_name": "acquire", "annotation": ""}, "snippet": " self.write_lock.acquire()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8", "label": "try", "type": "try", "loc": [131, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "vector": [7, 2, 0.6013, 0.0529, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n for app_name in settings.INSTALLED_APPS:\n if app_label == app_name.split('.')[-1]:\n mod = self.load_app(app_name, False)\n if mod is None:\n if emptyOK:\n return None\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L132_C12", "label": "for app_name", "type": "for", "loc": [132, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8", "vector": [6, 3, 0.5969, 0.0352, 3, 0.84, 0.0, 443, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "app_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app_name in settings.INSTALLED_APPS:\n if app_label == app_name.split('.')[-1]:\n mod = self.load_app(app_name, False)\n if mod is None:\n if emptyOK:\n return None\n else:\n return mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16", "label": "if", "type": "if", "loc": [133, 139], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L132_C12", "vector": [4, 4, 0.5991, 0.0308, 4, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if app_label == app_name.split('.')[-1]:\n mod = self.load_app(app_name, False)\n if mod is None:\n if emptyOK:\n return None\n else:\n return mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L134_C20", "label": "mod = load_app()", "type": "assigned_variable", "loc": [134, 134], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16", "vector": [14, 5, 0.5903, 0.0044, 5, 0.82, 0.0, 25, 3, 2, 0, 0, 632, 10, 1], "semantic": {"name": "mod", "arg_names": [], "import_names": [], "rhs_call_name": "load_app", "annotation": ""}, "snippet": " mod = self.load_app(app_name, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20", "label": "if", "type": "if", "loc": [135, 139], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16", "vector": [4, 5, 0.6035, 0.022, 5, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mod is None:\n if emptyOK:\n return None\n else:\n return mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L136_C24", "label": "if", "type": "if", "loc": [136, 137], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20", "vector": [4, 6, 0.6013, 0.0088, 6, 0.41, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if emptyOK:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L137_C28", "label": "return", "type": "return", "loc": [137, 137], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L136_C24", "vector": [13, 7, 0.6035, 0.0044, 7, 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_99024:Return_L139_C24", "label": "return", "type": "return", "loc": [139, 139], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20", "vector": [13, 6, 0.6123, 0.0044, 6, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return mod"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L142_C12", "label": "release()", "type": "expression", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8", "vector": [8, 3, 0.6256, 0.0044, 3, 0.84, 1.0, 784, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "release", "arg_names": [], "import_names": [], "rhs_call_name": "release", "annotation": ""}, "snippet": " self.write_lock.release()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "label": "get_app_errors", "type": "function", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.641, 0.0176, 1, 0.2, 0.7273, 131, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_app_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_app_errors(self):\n \"Returns the map of known problems with the INSTALLED_APPS.\"\n self._populate()\n return self.app_errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L145_C8", "label": "expression", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "vector": [8, 2, 0.6388, 0.0044, 2, 0.15, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Returns the map of known problems with the INSTALLED_APPS.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L146_C8", "label": "_populate()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "vector": [8, 2, 0.6432, 0.0044, 2, 0.15, 0.5, 179, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "vector": [13, 2, 0.6476, 0.0044, 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.app_errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "label": "get_models", "type": "function", "loc": [149, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.7247, 0.141, 1, 0.2, 0.8182, 404, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "get_models", "arg_names": ["self", "app_mod", "include_auto_created", "include_deferred"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_models(self, app_mod=None, include_auto_created=False, include_deferred=False):\n \"\"\"\n Given a module containing models, returns a list of the models.\n Otherwise returns a list of all installed models.\n\n By default, auto-created models (i.e., m2m models without an\n explicit intermediate table) are not included. However, if you\n specify include_auto_created=True, they will be."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L150_C8", "label": "expression", "type": "expression", "loc": [150, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [8, 2, 0.685, 0.0529, 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 Given a module containing models, returns a list of the models.\n Otherwise returns a list of all installed models.\n\n By default, auto-created models (i.e., m2m models without an\n explicit intermediate table) are not included. However, if you\n specify include_auto_created=True, they will be.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L162_C8", "label": "cache_key =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [14, 2, 0.7137, 0.0044, 2, 0.73, 0.125, 62, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "cache_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache_key = (app_mod, include_auto_created, include_deferred)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L163_C8", "label": "try", "type": "try", "loc": [163, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [7, 2, 0.7247, 0.0176, 2, 0.73, 0.25, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._get_models_cache[cache_key]\n except KeyError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L164_C12", "label": "return", "type": "return", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L163_C8", "vector": [13, 3, 0.7225, 0.0044, 3, 0.25, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_models_cache[cache_key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L167_C8", "label": "_populate()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [8, 2, 0.7357, 0.0044, 2, 0.73, 0.375, 179, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8", "label": "if", "type": "if", "loc": [168, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [4, 2, 0.7467, 0.0176, 2, 0.73, 0.5, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if app_mod:\n app_list = [self.app_models.get(app_mod.__name__.split('.')[-2], SortedDict())]\n else:\n app_list = self.app_models.itervalues()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L169_C12", "label": "app_list =", "type": "assigned_variable", "loc": [169, 169], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8", "vector": [14, 3, 0.7445, 0.0044, 3, 0.62, 0.0, 975, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "app_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " app_list = [self.app_models.get(app_mod.__name__.split('.')[-2], SortedDict())]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L171_C12", "label": "app_list = itervalues()", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8", "vector": [14, 3, 0.7533, 0.0044, 3, 0.62, 1.0, 975, 3, 0, 0, 0, 288, 10, 1], "semantic": {"name": "app_list", "arg_names": [], "import_names": [], "rhs_call_name": "itervalues", "annotation": ""}, "snippet": " app_list = self.app_models.itervalues()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L172_C8", "label": "model_list =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [14, 2, 0.7577, 0.0044, 2, 0.73, 0.625, 393, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "model_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L173_C8", "label": "for app", "type": "for", "loc": [173, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [6, 2, 0.7731, 0.0264, 2, 0.73, 0.75, 494, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for app in app_list:\n model_list.extend(\n model for model in app.values()\n if ((not model._deferred or include_deferred)\n and (not model._meta.auto_created or include_auto_created))\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L174_C12", "label": "extend()", "type": "expression", "loc": [174, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L173_C8", "vector": [8, 3, 0.7753, 0.022, 3, 0.91, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " model_list.extend(\n model for model in app.values()\n if ((not model._deferred or include_deferred)\n and (not model._meta.auto_created or include_auto_created))\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L179_C8", "label": "assign", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [14, 2, 0.7885, 0.0044, 2, 0.73, 0.875, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._get_models_cache[cache_key] = model_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L180_C8", "label": "return", "type": "return", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "vector": [13, 2, 0.793, 0.0044, 2, 0.73, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return model_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "label": "get_model", "type": "function", "loc": [182, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.8216, 0.0441, 1, 0.2, 0.9091, 115, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "get_model", "arg_names": ["self", "app_label", "model_name", "seed_cache"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_model(self, app_label, model_name, seed_cache=True):\n \"\"\"\n Returns the model matching the given app_label and case-insensitive\n model_name.\n\n Returns None if no model is found.\n \"\"\"\n if seed_cache:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L183_C8", "label": "expression", "type": "expression", "loc": [183, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "vector": [8, 2, 0.8172, 0.0264, 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 Returns the model matching the given app_label and case-insensitive\n model_name.\n\n Returns None if no model is found.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L189_C8", "label": "if", "type": "if", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "vector": [4, 2, 0.8348, 0.0088, 2, 0.57, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if seed_cache:\n self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L190_C12", "label": "_populate()", "type": "expression", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L189_C8", "vector": [8, 3, 0.837, 0.0044, 3, 0.96, 0.0, 179, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate", "arg_names": [], "import_names": [], "rhs_call_name": "_populate", "annotation": ""}, "snippet": " self._populate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L191_C8", "label": "return", "type": "return", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "vector": [13, 2, 0.8414, 0.0044, 2, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.app_models.get(app_label, SortedDict()).get(model_name.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "label": "register_models", "type": "function", "loc": [193, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "vector": [2, 1, 0.8965, 0.0969, 1, 0.2, 1.0, 517, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "register_models", "arg_names": ["self", "app_label", "models"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_models(self, app_label, *models):\n \"\"\"\n Register a set of models as belonging to an app.\n \"\"\"\n for model in models:\n # Store as 'name: model' pair in a dictionary\n # in the app_models dictionary\n model_name = model._meta.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L194_C8", "label": "expression", "type": "expression", "loc": [194, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "vector": [8, 2, 0.859, 0.0132, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Register a set of models as belonging to an app.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "label": "for model", "type": "for", "loc": [197, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "vector": [6, 2, 0.9031, 0.0749, 2, 0.36, 0.5, 722, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for model in models:\n # Store as 'name: model' pair in a dictionary\n # in the app_models dictionary\n model_name = model._meta.object_name.lower()\n model_dict = self.app_models.setdefault(app_label, SortedDict())\n if model_name in model_dict:\n # The same model may be imported via different paths (e.g.\n # appname.models and project.appname.models). We use the source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L200_C12", "label": "model_name = lower()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "vector": [14, 3, 0.8811, 0.0044, 3, 0.47, 0.0, 131, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " model_name = model._meta.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L201_C12", "label": "model_dict = setdefault()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "vector": [14, 3, 0.8855, 0.0044, 3, 0.47, 0.3333, 553, 3, 2, 0, 0, 262, 10, 2], "semantic": {"name": "model_dict", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " model_dict = self.app_models.setdefault(app_label, SortedDict())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "label": "if", "type": "if", "loc": [202, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "vector": [4, 3, 0.9119, 0.0485, 3, 0.47, 0.6667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model_name in model_dict:\n # The same model may be imported via different paths (e.g.\n # appname.models and project.appname.models). We use the source\n # filename as a means to detect identity.\n fname1 = os.path.abspath(sys.modules[model.__module__].__file__)\n fname2 = os.path.abspath(sys.modules[model_dict[model_name].__module__].__file__)\n # Since the filename extension could be .py the first time and\n # .pyc or .pyo the second time, ignore the extension when"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L206_C16", "label": "fname1 = abspath()", "type": "assigned_variable", "loc": [206, 206], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "vector": [14, 4, 0.9075, 0.0044, 4, 0.1, 0.0, 165, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "fname1", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " fname1 = os.path.abspath(sys.modules[model.__module__].__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L207_C16", "label": "fname2 = abspath()", "type": "assigned_variable", "loc": [207, 207], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "vector": [14, 4, 0.9119, 0.0044, 4, 0.1, 0.5, 596, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "fname2", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " fname2 = os.path.abspath(sys.modules[model_dict[model_name].__module__].__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L211_C16", "label": "if", "type": "if", "loc": [211, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "vector": [4, 4, 0.9317, 0.0088, 4, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.splitext(fname1)[0] == os.path.splitext(fname2)[0]:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L213_C12", "label": "assign", "type": "assigned_variable", "loc": [213, 213], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "vector": [14, 3, 0.9383, 0.0044, 3, 0.47, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model_dict[model_name] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L214_C8", "label": "clear()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "vector": [8, 2, 0.9427, 0.0044, 2, 0.36, 1.0, 712, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear", "arg_names": [], "import_names": [], "rhs_call_name": "clear", "annotation": ""}, "snippet": " self._get_models_cache.clear()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L216_C0", "label": "cache = AppCache()", "type": "assigned_variable", "loc": [216, 216], "level": 0, "parent": null, "vector": [14, 0, 0.9515, 0.0044, 0, 0.66, 0.6, 419, 3, 0, 0, 0, 670, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "AppCache", "annotation": ""}, "snippet": "cache = AppCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L220_C0", "label": "get_apps =", "type": "assigned_variable", "loc": [220, 220], "level": 0, "parent": null, "vector": [14, 0, 0.9692, 0.0044, 0, 0.66, 0.65, 221, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_apps", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_apps = cache.get_apps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L221_C0", "label": "get_app =", "type": "assigned_variable", "loc": [221, 221], "level": 0, "parent": null, "vector": [14, 0, 0.9736, 0.0044, 0, 0.66, 0.7, 333, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_app = cache.get_app"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L222_C0", "label": "get_app_errors =", "type": "assigned_variable", "loc": [222, 222], "level": 0, "parent": null, "vector": [14, 0, 0.978, 0.0044, 0, 0.66, 0.75, 131, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_app_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_app_errors = cache.get_app_errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L223_C0", "label": "get_models =", "type": "assigned_variable", "loc": [223, 223], "level": 0, "parent": null, "vector": [14, 0, 0.9824, 0.0044, 0, 0.66, 0.8, 404, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_models = cache.get_models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L224_C0", "label": "get_model =", "type": "assigned_variable", "loc": [224, 224], "level": 0, "parent": null, "vector": [14, 0, 0.9868, 0.0044, 0, 0.66, 0.85, 115, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_model = cache.get_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L225_C0", "label": "register_models =", "type": "assigned_variable", "loc": [225, 225], "level": 0, "parent": null, "vector": [14, 0, 0.9912, 0.0044, 0, 0.66, 0.9, 517, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "register_models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "register_models = cache.register_models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L226_C0", "label": "load_app =", "type": "assigned_variable", "loc": [226, 226], "level": 0, "parent": null, "vector": [14, 0, 0.9956, 0.0044, 0, 0.66, 0.95, 632, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "load_app", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "load_app = cache.load_app"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L227_C0", "label": "app_cache_ready =", "type": "assigned_variable", "loc": [227, 227], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0044, 0, 0.66, 1.0, 943, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "app_cache_ready", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "app_cache_ready = cache.app_cache_ready"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L58_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L58_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L61_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L63_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L64_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L65_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L84_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L93_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L94_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L93_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L95_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L134_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L133_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L136_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L136_C24", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L137_C28"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L135_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L139_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:Try_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L169_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L168_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Return_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L206_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L207_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L202_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:If_L211_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:For_L197_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Assign_L213_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99024:FunctionDef_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99024:Expr_L214_C8"}] |
"""
Classes to represent the definitions of aggregate functions.
"""
class Aggregate(object):
"""
Default Aggregate definition.
"""
def __init__(self, lookup, **extra):
"""Instantiate a new aggregate.
* lookup is the field on which the aggregate operates.
* extra is a dictionary of additional data to provide for the
aggregate definition
Also utilizes the class variables:
* name, the identifier for this aggregate function.
"""
self.lookup = lookup
self.extra = extra
def _default_alias(self):
return '%s__%s' % (self.lookup, self.name.lower())
default_alias = property(_default_alias)
def add_to_query(self, query, alias, col, source, is_summary):
"""Add the aggregate to the nominated query.
This method is used to convert the generic Aggregate definition into a
backend-specific definition.
* query is the backend-specific query instance to which the aggregate
is to be added.
* col is a column reference describing the subject field
of the aggregate. It can be an alias, or a tuple describing
a table and column name.
* source is the underlying field or aggregate definition for
the column reference. If the aggregate is not an ordinal or
computed type, this reference is used to determine the coerced
output type of the aggregate.
* is_summary is a boolean that is set True if the aggregate is a
summary value rather than an annotation.
"""
klass = getattr(query.aggregates_module, self.name)
aggregate = klass(col, source=source, is_summary=is_summary, **self.extra)
query.aggregates[alias] = aggregate
class Avg(Aggregate):
name = 'Avg'
class Count(Aggregate):
name = 'Count'
class Max(Aggregate):
name = 'Max'
class Min(Aggregate):
name = 'Min'
class StdDev(Aggregate):
name = 'StdDev'
class Sum(Aggregate):
name = 'Sum'
class Variance(Aggregate):
name = 'Variance'
| ajibawa-2023/Python-Code-Large/train/row_99025 | 29 | 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_99025:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0299, 0.0448, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nClasses to represent the definitions of aggregate functions.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "label": "Aggregate", "type": "class", "loc": [5, 46], "level": 0, "parent": null, "vector": [3, 0, 0.3806, 0.6269, 0, 0.66, 0.125, 451, 0, 3, 0, 0, 186, 0, 4], "semantic": {"name": "Aggregate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Aggregate(object):\n \"\"\"\n Default Aggregate definition.\n \"\"\"\n def __init__(self, lookup, **extra):\n \"\"\"Instantiate a new aggregate.\n\n * lookup is the field on which the aggregate operates."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L6_C4", "label": "expression", "type": "expression", "loc": [6, 8], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "vector": [8, 1, 0.1045, 0.0448, 1, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Default Aggregate definition.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "label": "__init__", "type": "function", "loc": [9, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "vector": [2, 1, 0.2164, 0.1791, 1, 0.13, 0.25, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "lookup", "extra"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, lookup, **extra):\n \"\"\"Instantiate a new aggregate.\n\n * lookup is the field on which the aggregate operates.\n * extra is a dictionary of additional data to provide for the\n aggregate definition\n\n Also utilizes the class variables:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L10_C8", "label": "expression", "type": "expression", "loc": [10, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "vector": [8, 2, 0.209, 0.1343, 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 new aggregate.\n\n * lookup is the field on which the aggregate operates.\n * extra is a dictionary of additional data to provide for the\n aggregate definition\n\n Also utilizes the class variables:\n * name, the identifier for this aggregate function."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L19_C8", "label": "self.lookup =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "vector": [14, 2, 0.2836, 0.0149, 2, 0.78, 0.5, 22, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.lookup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.lookup = lookup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L20_C8", "label": "self.extra =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "vector": [14, 2, 0.2985, 0.0149, 2, 0.78, 1.0, 921, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.extra", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.extra = extra"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L22_C4", "label": "_default_alias", "type": "function", "loc": [22, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "vector": [2, 1, 0.3358, 0.0299, 1, 0.13, 0.5, 442, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_default_alias", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _default_alias(self):\n return '%s__%s' % (self.lookup, self.name.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L22_C4", "vector": [13, 2, 0.3433, 0.0149, 2, 0.66, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s__%s' % (self.lookup, self.name.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L24_C4", "label": "default_alias = property()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "vector": [14, 1, 0.3582, 0.0149, 1, 0.13, 0.75, 722, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "default_alias", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " default_alias = property(_default_alias)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "label": "add_to_query", "type": "function", "loc": [26, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "vector": [2, 1, 0.5373, 0.3134, 1, 0.13, 1.0, 125, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "add_to_query", "arg_names": ["self", "query", "alias", "col", "source", "is_summary"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_to_query(self, query, alias, col, source, is_summary):\n \"\"\"Add the aggregate to the nominated query.\n\n This method is used to convert the generic Aggregate definition into a\n backend-specific definition.\n\n * query is the backend-specific query instance to which the aggregate\n is to be added."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L27_C8", "label": "expression", "type": "expression", "loc": [27, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "vector": [8, 2, 0.5224, 0.2537, 2, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Add the aggregate to the nominated query.\n\n This method is used to convert the generic Aggregate definition into a\n backend-specific definition.\n\n * query is the backend-specific query instance to which the aggregate\n is to be added.\n * col is a column reference describing the subject field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L44_C8", "label": "klass = getattr()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "vector": [14, 2, 0.6567, 0.0149, 2, 0.35, 0.3333, 35, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "klass", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " klass = getattr(query.aggregates_module, self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L45_C8", "label": "aggregate = klass()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "vector": [14, 2, 0.6716, 0.0149, 2, 0.35, 0.6667, 583, 3, 4, 0, 0, 35, 10, 1], "semantic": {"name": "aggregate", "arg_names": [], "import_names": [], "rhs_call_name": "klass", "annotation": ""}, "snippet": " aggregate = klass(col, source=source, is_summary=is_summary, **self.extra)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L46_C8", "label": "assign", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "vector": [14, 2, 0.6866, 0.0149, 2, 0.35, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query.aggregates[alias] = aggregate"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L48_C0", "label": "Avg", "type": "class", "loc": [48, 49], "level": 0, "parent": null, "vector": [3, 0, 0.7239, 0.0299, 0, 0.66, 0.25, 50, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Avg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Avg(Aggregate):\n name = 'Avg'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L49_C4", "label": "name =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L48_C0", "vector": [14, 1, 0.7313, 0.0149, 1, 0.4, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Avg'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L51_C0", "label": "Count", "type": "class", "loc": [51, 52], "level": 0, "parent": null, "vector": [3, 0, 0.7687, 0.0299, 0, 0.66, 0.375, 783, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Count(Aggregate):\n name = 'Count'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L52_C4", "label": "name =", "type": "assigned_variable", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L51_C0", "vector": [14, 1, 0.7761, 0.0149, 1, 0.26, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Count'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L54_C0", "label": "Max", "type": "class", "loc": [54, 55], "level": 0, "parent": null, "vector": [3, 0, 0.8134, 0.0299, 0, 0.66, 0.5, 264, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Max", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Max(Aggregate):\n name = 'Max'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L55_C4", "label": "name =", "type": "assigned_variable", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L54_C0", "vector": [14, 1, 0.8209, 0.0149, 1, 0.49, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Max'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L57_C0", "label": "Min", "type": "class", "loc": [57, 58], "level": 0, "parent": null, "vector": [3, 0, 0.8582, 0.0299, 0, 0.66, 0.625, 261, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Min", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Min(Aggregate):\n name = 'Min'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L58_C4", "label": "name =", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L57_C0", "vector": [14, 1, 0.8657, 0.0149, 1, 0.83, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Min'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L60_C0", "label": "StdDev", "type": "class", "loc": [60, 61], "level": 0, "parent": null, "vector": [3, 0, 0.903, 0.0299, 0, 0.66, 0.75, 413, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "StdDev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StdDev(Aggregate):\n name = 'StdDev'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L61_C4", "label": "name =", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L60_C0", "vector": [14, 1, 0.9104, 0.0149, 1, 0.01, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'StdDev'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L63_C0", "label": "Sum", "type": "class", "loc": [63, 64], "level": 0, "parent": null, "vector": [3, 0, 0.9478, 0.0299, 0, 0.66, 0.875, 719, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Sum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Sum(Aggregate):\n name = 'Sum'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L64_C4", "label": "name =", "type": "assigned_variable", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L63_C0", "vector": [14, 1, 0.9552, 0.0149, 1, 0.68, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Sum'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L66_C0", "label": "Variance", "type": "class", "loc": [66, 67], "level": 0, "parent": null, "vector": [3, 0, 0.9925, 0.0299, 0, 0.66, 1.0, 771, 0, 0, 0, 0, 451, 0, 0], "semantic": {"name": "Variance", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Variance(Aggregate):\n name = 'Variance'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L67_C4", "label": "name =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L66_C0", "vector": [14, 1, 1.0, 0.0149, 1, 0.89, 0.0, 57, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = 'Variance'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L51_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99025:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99025:Assign_L67_C4"}] |
import re
from bisect import bisect
from django.conf import settings
from django.db.models.related import RelatedObject
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
from django.db.models.loading import get_models, app_cache_ready
from django.utils.translation import activate, deactivate_all, get_language, string_concat
from django.utils.encoding import force_unicode, smart_str
from django.utils.datastructures import SortedDict
try:
all
except NameError:
from django.utils.itercompat import all
# Calculate the verbose_name by converting from InitialCaps to "lowercase with spaces".
get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1', class_name).lower().strip()
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
'unique_together', 'permissions', 'get_latest_by',
'order_with_respect_to', 'app_label', 'db_tablespace',
'abstract', 'managed', 'proxy', 'auto_created')
class Options(object):
def __init__(self, meta, app_label=None):
self.local_fields, self.local_many_to_many = [], []
self.virtual_fields = []
self.module_name, self.verbose_name = None, None
self.verbose_name_plural = None
self.db_table = ''
self.ordering = []
self.unique_together = []
self.permissions = []
self.object_name, self.app_label = None, app_label
self.get_latest_by = None
self.order_with_respect_to = None
self.db_tablespace = settings.DEFAULT_TABLESPACE
self.admin = None
self.meta = meta
self.pk = None
self.has_auto_field, self.auto_field = False, None
self.abstract = False
self.managed = True
self.proxy = False
self.proxy_for_model = None
self.parents = SortedDict()
self.duplicate_targets = {}
self.auto_created = False
# To handle various inheritance situations, we need to track where
# managers came from (concrete or abstract base classes).
self.abstract_managers = []
self.concrete_managers = []
def contribute_to_class(self, cls, name):
from django.db import connection
from django.db.backends.util import truncate_name
cls._meta = self
self.installed = re.sub('\.models$', '', cls.__module__) in settings.INSTALLED_APPS
# First, construct the default values for these options.
self.object_name = cls.__name__
self.module_name = self.object_name.lower()
self.verbose_name = get_verbose_name(self.object_name)
# Next, apply any overridden values from 'class Meta'.
if self.meta:
meta_attrs = self.meta.__dict__.copy()
for name in self.meta.__dict__:
# Ignore any private attributes that Django doesn't care about.
# NOTE: We can't modify a dictionary's contents while looping
# over it, so we loop over the *original* dictionary instead.
if name.startswith('_'):
del meta_attrs[name]
for attr_name in DEFAULT_NAMES:
if attr_name in meta_attrs:
setattr(self, attr_name, meta_attrs.pop(attr_name))
elif hasattr(self.meta, attr_name):
setattr(self, attr_name, getattr(self.meta, attr_name))
# unique_together can be either a tuple of tuples, or a single
# tuple of two strings. Normalize it to a tuple of tuples, so that
# calling code can uniformly expect that.
ut = meta_attrs.pop('unique_together', self.unique_together)
if ut and not isinstance(ut[0], (tuple, list)):
ut = (ut,)
self.unique_together = ut
# verbose_name_plural is a special case because it uses a 's'
# by default.
self.verbose_name_plural = meta_attrs.pop('verbose_name_plural', string_concat(self.verbose_name, 's'))
# Any leftover attributes must be invalid.
if meta_attrs != {}:
raise TypeError("'class Meta' got invalid attribute(s): %s" % ','.join(meta_attrs.keys()))
else:
self.verbose_name_plural = string_concat(self.verbose_name, 's')
del self.meta
# If the db_table wasn't provided, use the app_label + module_name.
if not self.db_table:
self.db_table = "%s_%s" % (self.app_label, self.module_name)
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
def _prepare(self, model):
if self.order_with_respect_to:
self.order_with_respect_to = self.get_field(self.order_with_respect_to)
self.ordering = ('_order',)
model.add_to_class('_order', OrderWrt())
else:
self.order_with_respect_to = None
if self.pk is None:
if self.parents:
# Promote the first parent link in lieu of adding yet another
# field.
field = self.parents.value_for_index(0)
field.primary_key = True
self.setup_pk(field)
else:
auto = AutoField(verbose_name='ID', primary_key=True,
auto_created=True)
model.add_to_class('id', auto)
# Determine any sets of fields that are pointing to the same targets
# (e.g. two ForeignKeys to the same remote model). The query
# construction code needs to know this. At the end of this,
# self.duplicate_targets will map each duplicate field column to the
# columns it duplicates.
collections = {}
for column, target in self.duplicate_targets.iteritems():
try:
collections[target].add(column)
except KeyError:
collections[target] = set([column])
self.duplicate_targets = {}
for elt in collections.itervalues():
if len(elt) == 1:
continue
for column in elt:
self.duplicate_targets[column] = elt.difference(set([column]))
def add_field(self, field):
# Insert the given field in the order in which it was created, using
# the "creation_counter" attribute of the field.
# Move many-to-many related fields from self.fields into
# self.many_to_many.
if field.rel and isinstance(field.rel, ManyToManyRel):
self.local_many_to_many.insert(bisect(self.local_many_to_many, field), field)
if hasattr(self, '_m2m_cache'):
del self._m2m_cache
else:
self.local_fields.insert(bisect(self.local_fields, field), field)
self.setup_pk(field)
if hasattr(self, '_field_cache'):
del self._field_cache
del self._field_name_cache
if hasattr(self, '_name_map'):
del self._name_map
def add_virtual_field(self, field):
self.virtual_fields.append(field)
def setup_pk(self, field):
if not self.pk and field.primary_key:
self.pk = field
field.serialize = False
def setup_proxy(self, target):
"""
Does the internal setup so that the current model is a proxy for
"target".
"""
self.pk = target._meta.pk
self.proxy_for_model = target
self.db_table = target._meta.db_table
def __repr__(self):
return '<Options for %s>' % self.object_name
def __str__(self):
return "%s.%s" % (smart_str(self.app_label), smart_str(self.module_name))
def verbose_name_raw(self):
"""
There are a few places where the untranslated verbose name is needed
(so that we get the same value regardless of currently active
locale).
"""
lang = get_language()
deactivate_all()
raw = force_unicode(self.verbose_name)
activate(lang)
return raw
verbose_name_raw = property(verbose_name_raw)
def _fields(self):
"""
The getter for self.fields. This returns the list of field objects
available to this model (including through parent models).
Callers are not permitted to modify this list, since it's a reference
to this instance (not a copy).
"""
try:
self._field_name_cache
except AttributeError:
self._fill_fields_cache()
return self._field_name_cache
fields = property(_fields)
def get_fields_with_model(self):
"""
Returns a sequence of (field, model) pairs for all fields. The "model"
element is None for fields on the current model. Mostly of use when
constructing queries so that we know which model a field belongs to.
"""
try:
self._field_cache
except AttributeError:
self._fill_fields_cache()
return self._field_cache
def _fill_fields_cache(self):
cache = []
for parent in self.parents:
for field, model in parent._meta.get_fields_with_model():
if model:
cache.append((field, model))
else:
cache.append((field, parent))
cache.extend([(f, None) for f in self.local_fields])
self._field_cache = tuple(cache)
self._field_name_cache = [x for x, _ in cache]
def _many_to_many(self):
try:
self._m2m_cache
except AttributeError:
self._fill_m2m_cache()
return self._m2m_cache.keys()
many_to_many = property(_many_to_many)
def get_m2m_with_model(self):
"""
The many-to-many version of get_fields_with_model().
"""
try:
self._m2m_cache
except AttributeError:
self._fill_m2m_cache()
return self._m2m_cache.items()
def _fill_m2m_cache(self):
cache = SortedDict()
for parent in self.parents:
for field, model in parent._meta.get_m2m_with_model():
if model:
cache[field] = model
else:
cache[field] = parent
for field in self.local_many_to_many:
cache[field] = None
self._m2m_cache = cache
def get_field(self, name, many_to_many=True):
"""
Returns the requested field by name. Raises FieldDoesNotExist on error.
"""
to_search = many_to_many and (self.fields + self.many_to_many) or self.fields
for f in to_search:
if f.name == name:
return f
raise FieldDoesNotExist('%s has no field named %r' % (self.object_name, name))
def get_field_by_name(self, name):
"""
Returns the (field_object, model, direct, m2m), where field_object is
the Field instance for the given name, model is the model containing
this field (None for local fields), direct is True if the field exists
on this model, and m2m is True for many-to-many relations. When
'direct' is False, 'field_object' is the corresponding RelatedObject
for this field (since the field doesn't have an instance associated
with it).
Uses a cache internally, so after the first access, this is very fast.
"""
try:
try:
return self._name_map[name]
except AttributeError:
cache = self.init_name_map()
return cache[name]
except KeyError:
raise FieldDoesNotExist('%s has no field named %r'
% (self.object_name, name))
def get_all_field_names(self):
"""
Returns a list of all field names that are possible for this model
(including reverse relation names). This is used for pretty printing
debugging output (a list of choices), so any internal-only field names
are not included.
"""
try:
cache = self._name_map
except AttributeError:
cache = self.init_name_map()
names = cache.keys()
names.sort()
# Internal-only names end with "+" (symmetrical m2m related names being
# the main example). Trim them.
return [val for val in names if not val.endswith('+')]
def init_name_map(self):
"""
Initialises the field name -> field object mapping.
"""
cache = {}
# We intentionally handle related m2m objects first so that symmetrical
# m2m accessor names can be overridden, if necessary.
for f, model in self.get_all_related_m2m_objects_with_model():
cache[f.field.related_query_name()] = (f, model, False, True)
for f, model in self.get_all_related_objects_with_model():
cache[f.field.related_query_name()] = (f, model, False, False)
for f, model in self.get_m2m_with_model():
cache[f.name] = (f, model, True, True)
for f, model in self.get_fields_with_model():
cache[f.name] = (f, model, True, False)
if app_cache_ready():
self._name_map = cache
return cache
def get_add_permission(self):
return 'add_%s' % self.object_name.lower()
def get_change_permission(self):
return 'change_%s' % self.object_name.lower()
def get_delete_permission(self):
return 'delete_%s' % self.object_name.lower()
def get_all_related_objects(self, local_only=False, include_hidden=False):
return [k for k, v in self.get_all_related_objects_with_model(
local_only=local_only, include_hidden=include_hidden)]
def get_all_related_objects_with_model(self, local_only=False,
include_hidden=False):
"""
Returns a list of (related-object, model) pairs. Similar to
get_fields_with_model().
"""
try:
self._related_objects_cache
except AttributeError:
self._fill_related_objects_cache()
predicates = []
if local_only:
predicates.append(lambda k, v: not v)
if not include_hidden:
predicates.append(lambda k, v: not k.field.rel.is_hidden())
return filter(lambda t: all([p(*t) for p in predicates]),
self._related_objects_cache.items())
def _fill_related_objects_cache(self):
cache = SortedDict()
parent_list = self.get_parent_list()
for parent in self.parents:
for obj, model in parent._meta.get_all_related_objects_with_model():
if (obj.field.creation_counter < 0 or obj.field.rel.parent_link) and obj.model not in parent_list:
continue
if not model:
cache[obj] = parent
else:
cache[obj] = model
for klass in get_models(include_auto_created=True):
for f in klass._meta.local_fields:
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
cache[RelatedObject(f.rel.to, klass, f)] = None
self._related_objects_cache = cache
def get_all_related_many_to_many_objects(self, local_only=False):
try:
cache = self._related_many_to_many_cache
except AttributeError:
cache = self._fill_related_many_to_many_cache()
if local_only:
return [k for k, v in cache.items() if not v]
return cache.keys()
def get_all_related_m2m_objects_with_model(self):
"""
Returns a list of (related-m2m-object, model) pairs. Similar to
get_fields_with_model().
"""
try:
cache = self._related_many_to_many_cache
except AttributeError:
cache = self._fill_related_many_to_many_cache()
return cache.items()
def _fill_related_many_to_many_cache(self):
cache = SortedDict()
parent_list = self.get_parent_list()
for parent in self.parents:
for obj, model in parent._meta.get_all_related_m2m_objects_with_model():
if obj.field.creation_counter < 0 and obj.model not in parent_list:
continue
if not model:
cache[obj] = parent
else:
cache[obj] = model
for klass in get_models():
for f in klass._meta.local_many_to_many:
if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:
cache[RelatedObject(f.rel.to, klass, f)] = None
if app_cache_ready():
self._related_many_to_many_cache = cache
return cache
def get_base_chain(self, model):
"""
Returns a list of parent classes leading to 'model' (order from closet
to most distant ancestor). This has to handle the case were 'model' is
a granparent or even more distant relation.
"""
if not self.parents:
return
if model in self.parents:
return [model]
for parent in self.parents:
res = parent._meta.get_base_chain(model)
if res:
res.insert(0, parent)
return res
raise TypeError('%r is not an ancestor of this model'
% model._meta.module_name)
def get_parent_list(self):
"""
Returns a list of all the ancestor of this model as a list. Useful for
determining if something is an ancestor, regardless of lineage.
"""
result = set()
for parent in self.parents:
result.add(parent)
result.update(parent._meta.get_parent_list())
return result
def get_ancestor_link(self, ancestor):
"""
Returns the field on the current model which points to the given
"ancestor". This is possible an indirect link (a pointer to a parent
model, which points, eventually, to the ancestor). Used when
constructing table joins for model inheritance.
Returns None if the model isn't an ancestor of this one.
"""
if ancestor in self.parents:
return self.parents[ancestor]
for parent in self.parents:
# Tries to get a link field from the immediate parent
parent_link = parent._meta.get_ancestor_link(ancestor)
if parent_link:
# In case of a proxied model, the first link
# of the chain to the ancestor is that parent
# links
return self.parents[parent] or parent_link
def get_ordered_objects(self):
"Returns a list of Options objects that are ordered with respect to this object."
if not hasattr(self, '_ordered_objects'):
objects = []
# TODO
#for klass in get_models(get_app(self.app_label)):
# opts = klass._meta
# if opts.order_with_respect_to and opts.order_with_respect_to.rel \
# and self == opts.order_with_respect_to.rel.to._meta:
# objects.append(opts)
self._ordered_objects = objects
return self._ordered_objects
def pk_index(self):
"""
Returns the index of the primary key field in the self.fields list.
"""
return self.fields.index(self.pk)
| ajibawa-2023/Python-Code-Large/train/row_99026 | 301 | 491 | 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_99026:Import_L1_C0", "label": "re import re", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.002, 0.002, 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_99026:ImportFrom_L2_C0", "label": "from bisect import bisect", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0041, 0.002, 0, 0.66, 0.0714, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "bisect", "arg_names": [], "import_names": ["bisect"], "rhs_call_name": "", "annotation": ""}, "snippet": "from bisect import bisect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L4_C0", "label": "from django.conf import settings", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0081, 0.002, 0, 0.66, 0.1429, 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_99026:ImportFrom_L5_C0", "label": "from django.db.models.related import RelatedObject", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.002, 0, 0.66, 0.2143, 859, 0, 1, 0, 0, 859, 0, 0], "semantic": {"name": "django.db.models.related", "arg_names": [], "import_names": ["RelatedObject"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.related import RelatedObject"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L6_C0", "label": "from django.db.models.fields.related import ManyToManyRel", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0122, 0.002, 0, 0.66, 0.2857, 410, 0, 1, 0, 0, 410, 0, 0], "semantic": {"name": "django.db.models.fields.related", "arg_names": [], "import_names": ["ManyToManyRel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields.related import ManyToManyRel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L7_C0", "label": "from django.db.models.fields import AutoField, FieldDoesNotExist", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0143, 0.002, 0, 0.66, 0.3571, 5, 0, 2, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["AutoField", "FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import AutoField, FieldDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L8_C0", "label": "from django.db.models.fields.proxy import OrderWrt", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0163, 0.002, 0, 0.66, 0.4286, 945, 0, 1, 0, 0, 945, 0, 0], "semantic": {"name": "django.db.models.fields.proxy", "arg_names": [], "import_names": ["OrderWrt"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields.proxy import OrderWrt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L9_C0", "label": "from django.db.models.loading import get_models, app_cache_ready", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0183, 0.002, 0, 0.66, 0.5, 343, 0, 2, 0, 0, 343, 0, 0], "semantic": {"name": "django.db.models.loading", "arg_names": [], "import_names": ["get_models", "app_cache_ready"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.loading import get_models, app_cache_ready"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L10_C0", "label": "from django.utils.translation import activate, deactivate_all, get_language\u2026", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.002, 0, 0.66, 0.5714, 389, 0, 4, 0, 0, 389, 0, 0], "semantic": {"name": "django.utils.translation", "arg_names": [], "import_names": ["activate", "deactivate_all", "get_language", "string_concat"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.translation import activate, deactivate_all, get_language, string_concat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L11_C0", "label": "from django.utils.encoding import force_unicode, smart_str", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0224, 0.002, 0, 0.66, 0.6429, 96, 0, 2, 0, 0, 96, 0, 0], "semantic": {"name": "django.utils.encoding", "arg_names": [], "import_names": ["force_unicode", "smart_str"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.encoding import force_unicode, smart_str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L12_C0", "label": "from django.utils.datastructures import SortedDict", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0244, 0.002, 0, 0.66, 0.7143, 757, 0, 1, 0, 0, 757, 0, 0], "semantic": {"name": "django.utils.datastructures", "arg_names": [], "import_names": ["SortedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.datastructures import SortedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L14_C0", "label": "try", "type": "try", "loc": [14, 17], "level": 0, "parent": null, "vector": [7, 0, 0.0316, 0.0081, 0, 0.66, 0.7857, 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_99026:Expr_L15_C4", "label": "expression", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L14_C0", "vector": [8, 1, 0.0305, 0.002, 1, 0.36, 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_99026:ImportFrom_L17_C4", "label": "from django.utils.itercompat import all", "type": "import", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L14_C0", "vector": [1, 1, 0.0346, 0.002, 1, 0.36, 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_99026:Assign_L20_C0", "label": "get_verbose_name =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0407, 0.002, 0, 0.66, 0.8571, 510, 9, 0, 0, 0, 0, 0, 3], "semantic": {"name": "get_verbose_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\\\1', class_name).lower().strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L22_C0", "label": "DEFAULT_NAMES =", "type": "assigned_variable", "loc": [22, 25], "level": 0, "parent": null, "vector": [14, 0, 0.0479, 0.0081, 0, 0.66, 0.9286, 106, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "DEFAULT_NAMES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',\n 'unique_together', 'permissions', 'get_latest_by',\n 'order_with_respect_to', 'app_label', 'db_tablespace',\n 'abstract', 'managed', 'proxy', 'auto_created')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "label": "Options", "type": "class", "loc": [27, 491], "level": 0, "parent": null, "vector": [3, 0, 0.5275, 0.947, 0, 0.66, 1.0, 971, 0, 34, 0, 0, 186, 0, 99], "semantic": {"name": "Options", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Options(object):\n def __init__(self, meta, app_label=None):\n self.local_fields, self.local_many_to_many = [], []\n self.virtual_fields = []\n self.module_name, self.verbose_name = None, None\n self.verbose_name_plural = None\n self.db_table = ''\n self.ordering = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.0855, 0.0591, 1, 0.15, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "meta", "app_label"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, meta, app_label=None):\n self.local_fields, self.local_many_to_many = [], []\n self.virtual_fields = []\n self.module_name, self.verbose_name = None, None\n self.verbose_name_plural = None\n self.db_table = ''\n self.ordering = []\n self.unique_together = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L29_C8", "label": "assign", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0591, 0.002, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.local_fields, self.local_many_to_many = [], []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L30_C8", "label": "self.virtual_fields =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0611, 0.002, 2, 0.55, 0.0417, 194, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.virtual_fields", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.virtual_fields = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L31_C8", "label": "assign", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0631, 0.002, 2, 0.55, 0.0833, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.module_name, self.verbose_name = None, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L32_C8", "label": "self.verbose_name_plural =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0652, 0.002, 2, 0.55, 0.125, 966, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.verbose_name_plural", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.verbose_name_plural = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L33_C8", "label": "self.db_table =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0672, 0.002, 2, 0.55, 0.1667, 223, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.db_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db_table = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L34_C8", "label": "self.ordering =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0692, 0.002, 2, 0.55, 0.2083, 38, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.ordering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ordering = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L35_C8", "label": "self.unique_together =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0713, 0.002, 2, 0.55, 0.25, 801, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.unique_together", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.unique_together = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L36_C8", "label": "self.permissions =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0733, 0.002, 2, 0.55, 0.2917, 245, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.permissions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.permissions = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L37_C8", "label": "assign", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0754, 0.002, 2, 0.55, 0.3333, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_name, self.app_label = None, app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L38_C8", "label": "self.get_latest_by =", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0774, 0.002, 2, 0.55, 0.375, 15, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.get_latest_by", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.get_latest_by = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L39_C8", "label": "self.order_with_respect_to =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0794, 0.002, 2, 0.55, 0.4167, 588, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.order_with_respect_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.order_with_respect_to = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L40_C8", "label": "self.db_tablespace =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0815, 0.002, 2, 0.55, 0.4583, 358, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.db_tablespace", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db_tablespace = settings.DEFAULT_TABLESPACE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L41_C8", "label": "self.admin =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0835, 0.002, 2, 0.55, 0.5, 331, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.admin", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.admin = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L42_C8", "label": "self.meta =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0855, 0.002, 2, 0.55, 0.5417, 879, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.meta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.meta = meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L43_C8", "label": "self.pk =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0876, 0.002, 2, 0.55, 0.5833, 290, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.pk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pk = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L44_C8", "label": "assign", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0896, 0.002, 2, 0.55, 0.625, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.has_auto_field, self.auto_field = False, None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L45_C8", "label": "self.abstract =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0916, 0.002, 2, 0.55, 0.6667, 792, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abstract = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L46_C8", "label": "self.managed =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0937, 0.002, 2, 0.55, 0.7083, 980, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.managed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.managed = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L47_C8", "label": "self.proxy =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0957, 0.002, 2, 0.55, 0.75, 837, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.proxy = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L48_C8", "label": "self.proxy_for_model =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0978, 0.002, 2, 0.55, 0.7917, 528, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.proxy_for_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.proxy_for_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L49_C8", "label": "self.parents = SortedDict()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.0998, 0.002, 2, 0.55, 0.8333, 168, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "self.parents", "arg_names": [], "import_names": [], "rhs_call_name": "SortedDict", "annotation": ""}, "snippet": " self.parents = SortedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L50_C8", "label": "self.duplicate_targets =", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.1018, 0.002, 2, 0.55, 0.875, 114, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.duplicate_targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.duplicate_targets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L51_C8", "label": "self.auto_created =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.1039, 0.002, 2, 0.55, 0.9167, 257, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.auto_created", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.auto_created = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L55_C8", "label": "self.abstract_managers =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.112, 0.002, 2, 0.55, 0.9583, 461, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.abstract_managers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.abstract_managers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L56_C8", "label": "self.concrete_managers =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "vector": [14, 2, 0.1141, 0.002, 2, 0.55, 1.0, 945, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.concrete_managers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.concrete_managers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "label": "contribute_to_class", "type": "function", "loc": [58, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.167, 0.0998, 1, 0.15, 0.0278, 973, 0, 3, 0, 0, 0, 0, 20], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "cls", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, cls, name):\n from django.db import connection\n from django.db.backends.util import truncate_name\n\n cls._meta = self\n self.installed = re.sub('\\.models$', '', cls.__module__) in settings.INSTALLED_APPS\n # First, construct the default values for these options.\n self.object_name = cls.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L59_C8", "label": "from django.db import connection", "type": "import", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [1, 2, 0.1202, 0.002, 2, 0.73, 0.0, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connection"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db import connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L60_C8", "label": "from django.db.backends.util import truncate_name", "type": "import", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [1, 2, 0.1222, 0.002, 2, 0.73, 0.125, 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_99026:Assign_L62_C8", "label": "cls._meta =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [14, 2, 0.1263, 0.002, 2, 0.73, 0.25, 739, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cls._meta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls._meta = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L63_C8", "label": "self.installed =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [14, 2, 0.1283, 0.002, 2, 0.73, 0.375, 920, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.installed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.installed = re.sub('\\.models$', '', cls.__module__) in settings.INSTALLED_APPS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L65_C8", "label": "self.object_name =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [14, 2, 0.1324, 0.002, 2, 0.73, 0.5, 369, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.object_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.object_name = cls.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L66_C8", "label": "self.module_name = lower()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [14, 2, 0.1344, 0.002, 2, 0.73, 0.625, 837, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "self.module_name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " self.module_name = self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L67_C8", "label": "self.verbose_name = get_verbose_name()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [14, 2, 0.1365, 0.002, 2, 0.73, 0.75, 45, 3, 1, 0, 0, 510, 10, 1], "semantic": {"name": "self.verbose_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_verbose_name", "annotation": ""}, "snippet": " self.verbose_name = get_verbose_name(self.object_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "label": "if", "type": "if", "loc": [70, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [4, 2, 0.1731, 0.0631, 2, 0.73, 0.875, 0, 7, 0, 0, 0, 0, 0, 15], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.meta:\n meta_attrs = self.meta.__dict__.copy()\n for name in self.meta.__dict__:\n # Ignore any private attributes that Django doesn't care about.\n # NOTE: We can't modify a dictionary's contents while looping\n # over it, so we loop over the *original* dictionary instead.\n if name.startswith('_'):\n del meta_attrs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L71_C12", "label": "meta_attrs = copy()", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [14, 3, 0.1446, 0.002, 3, 0.68, 0.0, 145, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "meta_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " meta_attrs = self.meta.__dict__.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L72_C12", "label": "for name", "type": "for", "loc": [72, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [6, 3, 0.1517, 0.0122, 3, 0.68, 0.125, 57, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self.meta.__dict__:\n # Ignore any private attributes that Django doesn't care about.\n # NOTE: We can't modify a dictionary's contents while looping\n # over it, so we loop over the *original* dictionary instead.\n if name.startswith('_'):\n del meta_attrs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L76_C16", "label": "if", "type": "if", "loc": [76, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L72_C12", "vector": [4, 4, 0.1558, 0.0041, 4, 0.99, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('_'):\n del meta_attrs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L78_C12", "label": "for attr_name", "type": "for", "loc": [78, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [6, 3, 0.1629, 0.0102, 3, 0.68, 0.25, 722, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "attr_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for attr_name in DEFAULT_NAMES:\n if attr_name in meta_attrs:\n setattr(self, attr_name, meta_attrs.pop(attr_name))\n elif hasattr(self.meta, attr_name):\n setattr(self, attr_name, getattr(self.meta, attr_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16", "label": "if", "type": "if", "loc": [79, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L78_C12", "vector": [4, 4, 0.164, 0.0081, 4, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if attr_name in meta_attrs:\n setattr(self, attr_name, meta_attrs.pop(attr_name))\n elif hasattr(self.meta, attr_name):\n setattr(self, attr_name, getattr(self.meta, attr_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L80_C20", "label": "setattr()", "type": "expression", "loc": [80, 80], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16", "vector": [8, 5, 0.1629, 0.002, 5, 0.17, 0.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, attr_name, meta_attrs.pop(attr_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L81_C16", "label": "if", "type": "if", "loc": [81, 82], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16", "vector": [4, 5, 0.166, 0.0041, 5, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif hasattr(self.meta, attr_name):\n setattr(self, attr_name, getattr(self.meta, attr_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L82_C20", "label": "setattr()", "type": "expression", "loc": [82, 82], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L81_C16", "vector": [8, 6, 0.167, 0.002, 6, 0.33, 0.0, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, attr_name, getattr(self.meta, attr_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L87_C12", "label": "ut = pop()", "type": "assigned_variable", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [14, 3, 0.1772, 0.002, 3, 0.68, 0.375, 484, 3, 2, 0, 0, 969, 10, 1], "semantic": {"name": "ut", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " ut = meta_attrs.pop('unique_together', self.unique_together)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L88_C12", "label": "if", "type": "if", "loc": [88, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [4, 3, 0.1802, 0.0041, 3, 0.68, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ut and not isinstance(ut[0], (tuple, list)):\n ut = (ut,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L89_C16", "label": "ut =", "type": "assigned_variable", "loc": [89, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L88_C12", "vector": [14, 4, 0.1813, 0.002, 4, 0.08, 0.0, 484, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ut", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ut = (ut,)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L90_C12", "label": "self.unique_together =", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [14, 3, 0.1833, 0.002, 3, 0.68, 0.625, 801, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.unique_together", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.unique_together = ut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L94_C12", "label": "self.verbose_name_plural = pop()", "type": "assigned_variable", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [14, 3, 0.1914, 0.002, 3, 0.68, 0.75, 966, 3, 2, 0, 0, 969, 10, 2], "semantic": {"name": "self.verbose_name_plural", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.verbose_name_plural = meta_attrs.pop('verbose_name_plural', string_concat(self.verbose_name, 's'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L97_C12", "label": "if", "type": "if", "loc": [97, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [4, 3, 0.1986, 0.0041, 3, 0.68, 0.875, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if meta_attrs != {}:\n raise TypeError(\"'class Meta' got invalid attribute(s): %s\" % ','.join(meta_attrs.keys()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L100_C12", "label": "self.verbose_name_plural = string_concat()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "vector": [14, 3, 0.2037, 0.002, 3, 0.68, 1.0, 966, 3, 2, 0, 0, 690, 10, 1], "semantic": {"name": "self.verbose_name_plural", "arg_names": [], "import_names": [], "rhs_call_name": "string_concat", "annotation": ""}, "snippet": " self.verbose_name_plural = string_concat(self.verbose_name, 's')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8", "label": "if", "type": "if", "loc": [104, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "vector": [4, 2, 0.2138, 0.0061, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.db_table:\n self.db_table = \"%s_%s\" % (self.app_label, self.module_name)\n self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L105_C12", "label": "self.db_table =", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8", "vector": [14, 3, 0.2138, 0.002, 3, 0.76, 0.0, 223, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.db_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db_table = \"%s_%s\" % (self.app_label, self.module_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L106_C12", "label": "self.db_table = truncate_name()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8", "vector": [14, 3, 0.2159, 0.002, 3, 0.76, 1.0, 223, 3, 2, 0, 0, 927, 10, 2], "semantic": {"name": "self.db_table", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_name", "annotation": ""}, "snippet": " self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "label": "_prepare", "type": "function", "loc": [108, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.2566, 0.0754, 1, 0.15, 0.0556, 771, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "_prepare", "arg_names": ["self", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prepare(self, model):\n if self.order_with_respect_to:\n self.order_with_respect_to = self.get_field(self.order_with_respect_to)\n self.ordering = ('_order',)\n model.add_to_class('_order', OrderWrt())\n else:\n self.order_with_respect_to = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "label": "if", "type": "if", "loc": [109, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [4, 2, 0.2271, 0.0122, 2, 0.33, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.order_with_respect_to:\n self.order_with_respect_to = self.get_field(self.order_with_respect_to)\n self.ordering = ('_order',)\n model.add_to_class('_order', OrderWrt())\n else:\n self.order_with_respect_to = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L110_C12", "label": "self.order_with_respect_to = get_field()", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "vector": [14, 3, 0.224, 0.002, 3, 0.71, 0.0, 588, 3, 1, 0, 0, 389, 10, 1], "semantic": {"name": "self.order_with_respect_to", "arg_names": [], "import_names": [], "rhs_call_name": "get_field", "annotation": ""}, "snippet": " self.order_with_respect_to = self.get_field(self.order_with_respect_to)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L111_C12", "label": "self.ordering =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "vector": [14, 3, 0.2261, 0.002, 3, 0.71, 0.3333, 38, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.ordering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.ordering = ('_order',)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L112_C12", "label": "add_to_class()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "vector": [8, 3, 0.2281, 0.002, 3, 0.71, 0.6667, 811, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "add_to_class", "annotation": ""}, "snippet": " model.add_to_class('_order', OrderWrt())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L114_C12", "label": "self.order_with_respect_to =", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "vector": [14, 3, 0.2322, 0.002, 3, 0.71, 1.0, 588, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.order_with_respect_to", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.order_with_respect_to = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L116_C8", "label": "if", "type": "if", "loc": [116, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [4, 2, 0.2464, 0.0224, 2, 0.33, 0.2, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.pk is None:\n if self.parents:\n # Promote the first parent link in lieu of adding yet another\n # field.\n field = self.parents.value_for_index(0)\n field.primary_key = True\n self.setup_pk(field)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "label": "if", "type": "if", "loc": [117, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L116_C8", "vector": [4, 3, 0.2475, 0.0204, 3, 0.75, 0.0, 0, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parents:\n # Promote the first parent link in lieu of adding yet another\n # field.\n field = self.parents.value_for_index(0)\n field.primary_key = True\n self.setup_pk(field)\n else:\n auto = AutoField(verbose_name='ID', primary_key=True,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L120_C16", "label": "field = value_for_index()", "type": "assigned_variable", "loc": [120, 120], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "vector": [14, 4, 0.2444, 0.002, 4, 0.21, 0.0, 480, 3, 1, 0, 0, 398, 10, 1], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "value_for_index", "annotation": ""}, "snippet": " field = self.parents.value_for_index(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L121_C16", "label": "field.primary_key =", "type": "assigned_variable", "loc": [121, 121], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "vector": [14, 4, 0.2464, 0.002, 4, 0.21, 0.25, 828, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "field.primary_key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field.primary_key = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L122_C16", "label": "setup_pk()", "type": "expression", "loc": [122, 122], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "vector": [8, 4, 0.2485, 0.002, 4, 0.21, 0.5, 769, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_pk", "arg_names": [], "import_names": [], "rhs_call_name": "setup_pk", "annotation": ""}, "snippet": " self.setup_pk(field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L124_C16", "label": "auto = AutoField()", "type": "assigned_variable", "loc": [124, 125], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "vector": [14, 4, 0.2536, 0.0041, 4, 0.21, 0.75, 958, 3, 3, 0, 0, 962, 10, 1], "semantic": {"name": "auto", "arg_names": [], "import_names": [], "rhs_call_name": "AutoField", "annotation": ""}, "snippet": " auto = AutoField(verbose_name='ID', primary_key=True,\n auto_created=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L126_C16", "label": "add_to_class()", "type": "expression", "loc": [126, 126], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "vector": [8, 4, 0.2566, 0.002, 4, 0.21, 1.0, 811, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "add_to_class", "annotation": ""}, "snippet": " model.add_to_class('id', auto)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L133_C8", "label": "collections =", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [14, 2, 0.2709, 0.002, 2, 0.33, 0.4, 193, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "collections", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " collections = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L134_C8", "label": "for column, target", "type": "for", "loc": [134, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [6, 2, 0.277, 0.0102, 2, 0.33, 0.6, 711, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "column, target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for column, target in self.duplicate_targets.iteritems():\n try:\n collections[target].add(column)\n except KeyError:\n collections[target] = set([column])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12", "label": "try", "type": "try", "loc": [135, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L134_C8", "vector": [7, 3, 0.278, 0.0081, 3, 0.09, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n collections[target].add(column)\n except KeyError:\n collections[target] = set([column])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L136_C16", "label": "add()", "type": "expression", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12", "vector": [8, 4, 0.277, 0.002, 4, 0.09, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " collections[target].add(column)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L138_C16", "label": " = set()", "type": "assigned_variable", "loc": [138, 138], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12", "vector": [14, 4, 0.2811, 0.002, 4, 0.09, 0.0, 0, 3, 1, 0, 0, 21, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " collections[target] = set([column])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L139_C8", "label": "self.duplicate_targets =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [14, 2, 0.2831, 0.002, 2, 0.33, 0.8, 114, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.duplicate_targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.duplicate_targets = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8", "label": "for elt", "type": "for", "loc": [140, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "vector": [6, 2, 0.2892, 0.0102, 2, 0.33, 1.0, 459, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "elt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for elt in collections.itervalues():\n if len(elt) == 1:\n continue\n for column in elt:\n self.duplicate_targets[column] = elt.difference(set([column]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L141_C12", "label": "if", "type": "if", "loc": [141, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8", "vector": [4, 3, 0.2882, 0.0041, 3, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(elt) == 1:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L143_C12", "label": "for column", "type": "for", "loc": [143, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8", "vector": [6, 3, 0.2923, 0.0041, 3, 0.04, 1.0, 406, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "column", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for column in elt:\n self.duplicate_targets[column] = elt.difference(set([column]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L144_C16", "label": " = difference()", "type": "assigned_variable", "loc": [144, 144], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L143_C12", "vector": [14, 4, 0.2933, 0.002, 4, 0.02, 0.0, 0, 3, 1, 0, 0, 498, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "difference", "annotation": ""}, "snippet": " self.duplicate_targets[column] = elt.difference(set([column]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4", "label": "add_field", "type": "function", "loc": [146, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3147, 0.0367, 1, 0.15, 0.0833, 340, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "add_field", "arg_names": ["self", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_field(self, field):\n # Insert the given field in the order in which it was created, using\n # the \"creation_counter\" attribute of the field.\n # Move many-to-many related fields from self.fields into\n # self.many_to_many.\n if field.rel and isinstance(field.rel, ManyToManyRel):\n self.local_many_to_many.insert(bisect(self.local_many_to_many, field), field)\n if hasattr(self, '_m2m_cache'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "label": "if", "type": "if", "loc": [151, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4", "vector": [4, 2, 0.3167, 0.0204, 2, 0.95, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.rel and isinstance(field.rel, ManyToManyRel):\n self.local_many_to_many.insert(bisect(self.local_many_to_many, field), field)\n if hasattr(self, '_m2m_cache'):\n del self._m2m_cache\n else:\n self.local_fields.insert(bisect(self.local_fields, field), field)\n self.setup_pk(field)\n if hasattr(self, '_field_cache'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L152_C12", "label": "insert()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "vector": [8, 3, 0.3096, 0.002, 3, 0.91, 0.0, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " self.local_many_to_many.insert(bisect(self.local_many_to_many, field), field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L153_C12", "label": "if", "type": "if", "loc": [153, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "vector": [4, 3, 0.3126, 0.0041, 3, 0.91, 0.25, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_m2m_cache'):\n del self._m2m_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L156_C12", "label": "insert()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "vector": [8, 3, 0.3177, 0.002, 3, 0.91, 0.5, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " self.local_fields.insert(bisect(self.local_fields, field), field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L157_C12", "label": "setup_pk()", "type": "expression", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "vector": [8, 3, 0.3198, 0.002, 3, 0.91, 0.75, 769, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setup_pk", "arg_names": [], "import_names": [], "rhs_call_name": "setup_pk", "annotation": ""}, "snippet": " self.setup_pk(field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L158_C12", "label": "if", "type": "if", "loc": [158, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "vector": [4, 3, 0.3238, 0.0061, 3, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_field_cache'):\n del self._field_cache\n del self._field_name_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L162_C8", "label": "if", "type": "if", "loc": [162, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4", "vector": [4, 2, 0.331, 0.0041, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(self, '_name_map'):\n del self._name_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L165_C4", "label": "add_virtual_field", "type": "function", "loc": [165, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3371, 0.0041, 1, 0.15, 0.1111, 366, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_virtual_field", "arg_names": ["self", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_virtual_field(self, field):\n self.virtual_fields.append(field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L166_C8", "label": "append()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L165_C4", "vector": [8, 2, 0.3381, 0.002, 2, 0.16, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.virtual_fields.append(field)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L168_C4", "label": "setup_pk", "type": "function", "loc": [168, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3452, 0.0081, 1, 0.15, 0.1389, 769, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setup_pk", "arg_names": ["self", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_pk(self, field):\n if not self.pk and field.primary_key:\n self.pk = field\n field.serialize = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8", "label": "if", "type": "if", "loc": [169, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L168_C4", "vector": [4, 2, 0.3462, 0.0061, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.pk and field.primary_key:\n self.pk = field\n field.serialize = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L170_C12", "label": "self.pk =", "type": "assigned_variable", "loc": [170, 170], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8", "vector": [14, 3, 0.3462, 0.002, 3, 0.54, 0.0, 290, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pk = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L171_C12", "label": "field.serialize =", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8", "vector": [14, 3, 0.3483, 0.002, 3, 0.54, 1.0, 17, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "field.serialize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field.serialize = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "label": "setup_proxy", "type": "function", "loc": [173, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3595, 0.0163, 1, 0.15, 0.1667, 375, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setup_proxy", "arg_names": ["self", "target"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def setup_proxy(self, target):\n \"\"\"\n Does the internal setup so that the current model is a proxy for\n \"target\".\n \"\"\"\n self.pk = target._meta.pk\n self.proxy_for_model = target\n self.db_table = target._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L174_C8", "label": "expression", "type": "expression", "loc": [174, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "vector": [8, 2, 0.3574, 0.0081, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Does the internal setup so that the current model is a proxy for\n \"target\".\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L178_C8", "label": "self.pk =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "vector": [14, 2, 0.3625, 0.002, 2, 0.4, 0.3333, 290, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.pk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.pk = target._meta.pk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L179_C8", "label": "self.proxy_for_model =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "vector": [14, 2, 0.3646, 0.002, 2, 0.4, 0.6667, 528, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.proxy_for_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.proxy_for_model = target"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L180_C8", "label": "self.db_table =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "vector": [14, 2, 0.3666, 0.002, 2, 0.4, 1.0, 223, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.db_table", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.db_table = target._meta.db_table"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L182_C4", "label": "__repr__", "type": "function", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3717, 0.0041, 1, 0.15, 0.1944, 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 '<Options for %s>' % self.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L182_C4", "vector": [13, 2, 0.3727, 0.002, 2, 0.24, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<Options for %s>' % self.object_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L185_C4", "label": "__str__", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3778, 0.0041, 1, 0.15, 0.2222, 527, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return \"%s.%s\" % (smart_str(self.app_label), smart_str(self.module_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L185_C4", "vector": [13, 2, 0.3788, 0.002, 2, 0.18, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"%s.%s\" % (smart_str(self.app_label), smart_str(self.module_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "label": "verbose_name_raw", "type": "function", "loc": [188, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.3931, 0.0224, 1, 0.15, 0.25, 928, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "verbose_name_raw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def verbose_name_raw(self):\n \"\"\"\n There are a few places where the untranslated verbose name is needed\n (so that we get the same value regardless of currently active\n locale).\n \"\"\"\n lang = get_language()\n deactivate_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L189_C8", "label": "expression", "type": "expression", "loc": [189, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [8, 2, 0.389, 0.0102, 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 There are a few places where the untranslated verbose name is needed\n (so that we get the same value regardless of currently active\n locale).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L194_C8", "label": "lang = get_language()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [14, 2, 0.3951, 0.002, 2, 0.97, 0.2, 312, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "lang", "arg_names": [], "import_names": [], "rhs_call_name": "get_language", "annotation": ""}, "snippet": " lang = get_language()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L195_C8", "label": "deactivate_all()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [8, 2, 0.3971, 0.002, 2, 0.97, 0.4, 387, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "deactivate_all", "arg_names": [], "import_names": [], "rhs_call_name": "deactivate_all", "annotation": ""}, "snippet": " deactivate_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L196_C8", "label": "raw = force_unicode()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [14, 2, 0.3992, 0.002, 2, 0.97, 0.6, 23, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "raw", "arg_names": [], "import_names": [], "rhs_call_name": "force_unicode", "annotation": ""}, "snippet": " raw = force_unicode(self.verbose_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L197_C8", "label": "activate()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [8, 2, 0.4012, 0.002, 2, 0.97, 0.8, 177, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "activate", "arg_names": [], "import_names": [], "rhs_call_name": "activate", "annotation": ""}, "snippet": " activate(lang)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L198_C8", "label": "return", "type": "return", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "vector": [13, 2, 0.4033, 0.002, 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 raw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L199_C4", "label": "verbose_name_raw = property()", "type": "assigned_variable", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [14, 1, 0.4053, 0.002, 1, 0.15, 0.2778, 928, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "verbose_name_raw", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " verbose_name_raw = property(verbose_name_raw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "label": "_fields", "type": "function", "loc": [201, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.4216, 0.0265, 1, 0.15, 0.3056, 456, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_fields", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fields(self):\n \"\"\"\n The getter for self.fields. This returns the list of field objects\n available to this model (including through parent models).\n\n Callers are not permitted to modify this list, since it's a reference\n to this instance (not a copy).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L202_C8", "label": "expression", "type": "expression", "loc": [202, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "vector": [8, 2, 0.4175, 0.0143, 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 The getter for self.fields. This returns the list of field objects\n available to this model (including through parent models).\n\n Callers are not permitted to modify this list, since it's a reference\n to this instance (not a copy).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8", "label": "try", "type": "try", "loc": [209, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "vector": [7, 2, 0.4287, 0.0081, 2, 0.1, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._field_name_cache\n except AttributeError:\n self._fill_fields_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L210_C12", "label": "expression", "type": "expression", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8", "vector": [8, 3, 0.4277, 0.002, 3, 0.93, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._field_name_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L212_C12", "label": "_fill_fields_cache()", "type": "expression", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8", "vector": [8, 3, 0.4318, 0.002, 3, 0.93, 0.0, 322, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_fields_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_fields_cache", "annotation": ""}, "snippet": " self._fill_fields_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "vector": [13, 2, 0.4338, 0.002, 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 self._field_name_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L214_C4", "label": "fields = property()", "type": "assigned_variable", "loc": [214, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [14, 1, 0.4358, 0.002, 1, 0.15, 0.3333, 358, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " fields = property(_fields)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "label": "get_fields_with_model", "type": "function", "loc": [216, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.4501, 0.0224, 1, 0.15, 0.3611, 65, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_fields_with_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_fields_with_model(self):\n \"\"\"\n Returns a sequence of (field, model) pairs for all fields. The \"model\"\n element is None for fields on the current model. Mostly of use when\n constructing queries so that we know which model a field belongs to.\n \"\"\"\n try:\n self._field_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L217_C8", "label": "expression", "type": "expression", "loc": [217, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "vector": [8, 2, 0.446, 0.0102, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a sequence of (field, model) pairs for all fields. The \"model\"\n element is None for fields on the current model. Mostly of use when\n constructing queries so that we know which model a field belongs to.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8", "label": "try", "type": "try", "loc": [222, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "vector": [7, 2, 0.4552, 0.0081, 2, 0.6, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._field_cache\n except AttributeError:\n self._fill_fields_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L223_C12", "label": "expression", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8", "vector": [8, 3, 0.4542, 0.002, 3, 0.1, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._field_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L225_C12", "label": "_fill_fields_cache()", "type": "expression", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8", "vector": [8, 3, 0.4582, 0.002, 3, 0.1, 0.0, 322, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_fields_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_fields_cache", "annotation": ""}, "snippet": " self._fill_fields_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L226_C8", "label": "return", "type": "return", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "vector": [13, 2, 0.4603, 0.002, 2, 0.6, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._field_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "label": "_fill_fields_cache", "type": "function", "loc": [228, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.4745, 0.0224, 1, 0.15, 0.3889, 322, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_fill_fields_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fill_fields_cache(self):\n cache = []\n for parent in self.parents:\n for field, model in parent._meta.get_fields_with_model():\n if model:\n cache.append((field, model))\n else:\n cache.append((field, parent))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L229_C8", "label": "cache =", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "vector": [14, 2, 0.4664, 0.002, 2, 0.22, 0.0, 419, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L230_C8", "label": "for parent", "type": "for", "loc": [230, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "vector": [6, 2, 0.4735, 0.0122, 2, 0.22, 0.25, 80, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n for field, model in parent._meta.get_fields_with_model():\n if model:\n cache.append((field, model))\n else:\n cache.append((field, parent))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L231_C12", "label": "for field, model", "type": "for", "loc": [231, 235], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L230_C8", "vector": [6, 3, 0.4745, 0.0102, 3, 0.62, 0.0, 407, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "field, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, model in parent._meta.get_fields_with_model():\n if model:\n cache.append((field, model))\n else:\n cache.append((field, parent))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16", "label": "if", "type": "if", "loc": [232, 235], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L231_C12", "vector": [4, 4, 0.4756, 0.0081, 4, 0.31, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model:\n cache.append((field, model))\n else:\n cache.append((field, parent))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L233_C20", "label": "append()", "type": "expression", "loc": [233, 233], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16", "vector": [8, 5, 0.4745, 0.002, 5, 0.61, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cache.append((field, model))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L235_C20", "label": "append()", "type": "expression", "loc": [235, 235], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16", "vector": [8, 5, 0.4786, 0.002, 5, 0.61, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " cache.append((field, parent))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L236_C8", "label": "extend()", "type": "expression", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "vector": [8, 2, 0.4807, 0.002, 2, 0.22, 0.5, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " cache.extend([(f, None) for f in self.local_fields])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L237_C8", "label": "self._field_cache = tuple()", "type": "assigned_variable", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "vector": [14, 2, 0.4827, 0.002, 2, 0.22, 0.75, 717, 3, 1, 0, 0, 259, 10, 1], "semantic": {"name": "self._field_cache", "arg_names": [], "import_names": [], "rhs_call_name": "tuple", "annotation": ""}, "snippet": " self._field_cache = tuple(cache)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L238_C8", "label": "self._field_name_cache =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "vector": [14, 2, 0.4847, 0.002, 2, 0.22, 1.0, 147, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._field_name_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._field_name_cache = [x for x, _ in cache]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4", "label": "_many_to_many", "type": "function", "loc": [240, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.4939, 0.0122, 1, 0.15, 0.4167, 274, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_many_to_many", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _many_to_many(self):\n try:\n self._m2m_cache\n except AttributeError:\n self._fill_m2m_cache()\n return self._m2m_cache.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8", "label": "try", "type": "try", "loc": [241, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4", "vector": [7, 2, 0.4939, 0.0081, 2, 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 self._m2m_cache\n except AttributeError:\n self._fill_m2m_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L242_C12", "label": "expression", "type": "expression", "loc": [242, 242], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8", "vector": [8, 3, 0.4929, 0.002, 3, 0.42, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._m2m_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L244_C12", "label": "_fill_m2m_cache()", "type": "expression", "loc": [244, 244], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8", "vector": [8, 3, 0.4969, 0.002, 3, 0.42, 0.0, 958, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_m2m_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_m2m_cache", "annotation": ""}, "snippet": " self._fill_m2m_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4", "vector": [13, 2, 0.499, 0.002, 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._m2m_cache.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L246_C4", "label": "many_to_many = property()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [14, 1, 0.501, 0.002, 1, 0.15, 0.4444, 979, 3, 1, 0, 0, 244, 10, 1], "semantic": {"name": "many_to_many", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " many_to_many = property(_many_to_many)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "label": "get_m2m_with_model", "type": "function", "loc": [248, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.5132, 0.0183, 1, 0.15, 0.4722, 648, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_m2m_with_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_m2m_with_model(self):\n \"\"\"\n The many-to-many version of get_fields_with_model().\n \"\"\"\n try:\n self._m2m_cache\n except AttributeError:\n self._fill_m2m_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L249_C8", "label": "expression", "type": "expression", "loc": [249, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "vector": [8, 2, 0.5092, 0.0061, 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 The many-to-many version of get_fields_with_model().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8", "label": "try", "type": "try", "loc": [252, 255], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "vector": [7, 2, 0.5163, 0.0081, 2, 0.9, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._m2m_cache\n except AttributeError:\n self._fill_m2m_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L253_C12", "label": "expression", "type": "expression", "loc": [253, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8", "vector": [8, 3, 0.5153, 0.002, 3, 0.36, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._m2m_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L255_C12", "label": "_fill_m2m_cache()", "type": "expression", "loc": [255, 255], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8", "vector": [8, 3, 0.5193, 0.002, 3, 0.36, 0.0, 958, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_m2m_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_m2m_cache", "annotation": ""}, "snippet": " self._fill_m2m_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L256_C8", "label": "return", "type": "return", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "vector": [13, 2, 0.5214, 0.002, 2, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._m2m_cache.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "label": "_fill_m2m_cache", "type": "function", "loc": [258, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.5356, 0.0224, 1, 0.15, 0.5, 958, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_fill_m2m_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fill_m2m_cache(self):\n cache = SortedDict()\n for parent in self.parents:\n for field, model in parent._meta.get_m2m_with_model():\n if model:\n cache[field] = model\n else:\n cache[field] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L259_C8", "label": "cache = SortedDict()", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "vector": [14, 2, 0.5275, 0.002, 2, 0.38, 0.0, 419, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "SortedDict", "annotation": ""}, "snippet": " cache = SortedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L260_C8", "label": "for parent", "type": "for", "loc": [260, 265], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "vector": [6, 2, 0.5346, 0.0122, 2, 0.38, 0.3333, 80, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n for field, model in parent._meta.get_m2m_with_model():\n if model:\n cache[field] = model\n else:\n cache[field] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L261_C12", "label": "for field, model", "type": "for", "loc": [261, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L260_C8", "vector": [6, 3, 0.5356, 0.0102, 3, 0.93, 0.0, 407, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "field, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field, model in parent._meta.get_m2m_with_model():\n if model:\n cache[field] = model\n else:\n cache[field] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16", "label": "if", "type": "if", "loc": [262, 265], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L261_C12", "vector": [4, 4, 0.5367, 0.0081, 4, 0.46, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model:\n cache[field] = model\n else:\n cache[field] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L263_C20", "label": "assign", "type": "assigned_variable", "loc": [263, 263], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16", "vector": [14, 5, 0.5356, 0.002, 5, 0.94, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[field] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L265_C20", "label": "assign", "type": "assigned_variable", "loc": [265, 265], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16", "vector": [14, 5, 0.5397, 0.002, 5, 0.94, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[field] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L266_C8", "label": "for field", "type": "for", "loc": [266, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "vector": [6, 2, 0.5428, 0.0041, 2, 0.38, 0.6667, 480, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field in self.local_many_to_many:\n cache[field] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L267_C12", "label": "assign", "type": "assigned_variable", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L266_C8", "vector": [14, 3, 0.5438, 0.002, 3, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[field] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L268_C8", "label": "self._m2m_cache =", "type": "assigned_variable", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "vector": [14, 2, 0.5458, 0.002, 2, 0.38, 1.0, 419, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._m2m_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._m2m_cache = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "label": "get_field", "type": "function", "loc": [270, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.558, 0.0183, 1, 0.15, 0.5278, 389, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_field", "arg_names": ["self", "name", "many_to_many"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_field(self, name, many_to_many=True):\n \"\"\"\n Returns the requested field by name. Raises FieldDoesNotExist on error.\n \"\"\"\n to_search = many_to_many and (self.fields + self.many_to_many) or self.fields\n for f in to_search:\n if f.name == name:\n return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L271_C8", "label": "expression", "type": "expression", "loc": [271, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "vector": [8, 2, 0.554, 0.0061, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the requested field by name. Raises FieldDoesNotExist on error.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L274_C8", "label": "to_search =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "vector": [14, 2, 0.558, 0.002, 2, 0.36, 0.5, 872, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "to_search", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " to_search = many_to_many and (self.fields + self.many_to_many) or self.fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L275_C8", "label": "for f", "type": "for", "loc": [275, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "vector": [6, 2, 0.5621, 0.0061, 2, 0.36, 1.0, 899, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in to_search:\n if f.name == name:\n return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L276_C12", "label": "if", "type": "if", "loc": [276, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L275_C8", "vector": [4, 3, 0.5631, 0.0041, 3, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.name == name:\n return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L277_C16", "label": "return", "type": "return", "loc": [277, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L276_C12", "vector": [13, 4, 0.5642, 0.002, 4, 0.08, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return f"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4", "label": "get_field_by_name", "type": "function", "loc": [280, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.5906, 0.0428, 1, 0.15, 0.5556, 779, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_field_by_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_field_by_name(self, name):\n \"\"\"\n Returns the (field_object, model, direct, m2m), where field_object is\n the Field instance for the given name, model is the model containing\n this field (None for local fields), direct is True if the field exists\n on this model, and m2m is True for many-to-many relations. When\n 'direct' is False, 'field_object' is the corresponding RelatedObject\n for this field (since the field doesn't have an instance associated"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L281_C8", "label": "expression", "type": "expression", "loc": [281, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4", "vector": [8, 2, 0.5825, 0.0224, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the (field_object, model, direct, m2m), where field_object is\n the Field instance for the given name, model is the model containing\n this field (None for local fields), direct is True if the field exists\n on this model, and m2m is True for many-to-many relations. When\n 'direct' is False, 'field_object' is the corresponding RelatedObject\n for this field (since the field doesn't have an instance associated\n with it)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L292_C8", "label": "try", "type": "try", "loc": [292, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4", "vector": [7, 2, 0.6029, 0.0183, 2, 0.6, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n try:\n return self._name_map[name]\n except AttributeError:\n cache = self.init_name_map()\n return cache[name]\n except KeyError:\n raise FieldDoesNotExist('%s has no field named %r'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "label": "try", "type": "try", "loc": [293, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L292_C8", "vector": [7, 3, 0.6008, 0.0102, 3, 0.73, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._name_map[name]\n except AttributeError:\n cache = self.init_name_map()\n return cache[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L294_C16", "label": "return", "type": "return", "loc": [294, 294], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "vector": [13, 4, 0.5988, 0.002, 4, 0.65, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._name_map[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L296_C16", "label": "cache = init_name_map()", "type": "assigned_variable", "loc": [296, 296], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "vector": [14, 4, 0.6029, 0.002, 4, 0.65, 0.0, 419, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "init_name_map", "annotation": ""}, "snippet": " cache = self.init_name_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L297_C16", "label": "return", "type": "return", "loc": [297, 297], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "vector": [13, 4, 0.6049, 0.002, 4, 0.65, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cache[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "label": "get_all_field_names", "type": "function", "loc": [302, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.6303, 0.0326, 1, 0.15, 0.5833, 732, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_all_field_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_field_names(self):\n \"\"\"\n Returns a list of all field names that are possible for this model\n (including reverse relation names). This is used for pretty printing\n debugging output (a list of choices), so any internal-only field names\n are not included.\n \"\"\"\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L303_C8", "label": "expression", "type": "expression", "loc": [303, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "vector": [8, 2, 0.6222, 0.0122, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list of all field names that are possible for this model\n (including reverse relation names). This is used for pretty printing\n debugging output (a list of choices), so any internal-only field names\n are not included.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8", "label": "try", "type": "try", "loc": [309, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "vector": [7, 2, 0.6324, 0.0081, 2, 0.83, 0.25, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cache = self._name_map\n except AttributeError:\n cache = self.init_name_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L310_C12", "label": "cache =", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8", "vector": [14, 3, 0.6314, 0.002, 3, 0.24, 0.0, 419, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache = self._name_map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L312_C12", "label": "cache = init_name_map()", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8", "vector": [14, 3, 0.6354, 0.002, 3, 0.24, 0.0, 419, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "init_name_map", "annotation": ""}, "snippet": " cache = self.init_name_map()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L313_C8", "label": "names = keys()", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "vector": [14, 2, 0.6375, 0.002, 2, 0.83, 0.5, 382, 3, 0, 0, 0, 204, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "keys", "annotation": ""}, "snippet": " names = cache.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L314_C8", "label": "sort()", "type": "expression", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "vector": [8, 2, 0.6395, 0.002, 2, 0.83, 0.75, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " names.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L317_C8", "label": "return", "type": "return", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "vector": [13, 2, 0.6456, 0.002, 2, 0.83, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [val for val in names if not val.endswith('+')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "label": "init_name_map", "type": "function", "loc": [319, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.667, 0.0367, 1, 0.15, 0.6111, 525, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "init_name_map", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_name_map(self):\n \"\"\"\n Initialises the field name -> field object mapping.\n \"\"\"\n cache = {}\n # We intentionally handle related m2m objects first so that symmetrical\n # m2m accessor names can be overridden, if necessary.\n for f, model in self.get_all_related_m2m_objects_with_model():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L320_C8", "label": "expression", "type": "expression", "loc": [320, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [8, 2, 0.6538, 0.0061, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Initialises the field name -> field object mapping.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L323_C8", "label": "cache =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [14, 2, 0.6578, 0.002, 2, 0.5, 0.1429, 419, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L326_C8", "label": "for f, model", "type": "for", "loc": [326, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [6, 2, 0.665, 0.0041, 2, 0.5, 0.2857, 760, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in self.get_all_related_m2m_objects_with_model():\n cache[f.field.related_query_name()] = (f, model, False, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L327_C12", "label": "assign", "type": "assigned_variable", "loc": [327, 327], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L326_C8", "vector": [14, 3, 0.666, 0.002, 3, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[f.field.related_query_name()] = (f, model, False, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L328_C8", "label": "for f, model", "type": "for", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [6, 2, 0.669, 0.0041, 2, 0.5, 0.4286, 760, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in self.get_all_related_objects_with_model():\n cache[f.field.related_query_name()] = (f, model, False, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L329_C12", "label": "assign", "type": "assigned_variable", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L328_C8", "vector": [14, 3, 0.6701, 0.002, 3, 0.53, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[f.field.related_query_name()] = (f, model, False, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L330_C8", "label": "for f, model", "type": "for", "loc": [330, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [6, 2, 0.6731, 0.0041, 2, 0.5, 0.5714, 760, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in self.get_m2m_with_model():\n cache[f.name] = (f, model, True, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L331_C12", "label": "assign", "type": "assigned_variable", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L330_C8", "vector": [14, 3, 0.6741, 0.002, 3, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[f.name] = (f, model, True, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L332_C8", "label": "for f, model", "type": "for", "loc": [332, 333], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [6, 2, 0.6772, 0.0041, 2, 0.5, 0.7143, 760, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "f, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f, model in self.get_fields_with_model():\n cache[f.name] = (f, model, True, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L333_C12", "label": "assign", "type": "assigned_variable", "loc": [333, 333], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L332_C8", "vector": [14, 3, 0.6782, 0.002, 3, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[f.name] = (f, model, True, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L334_C8", "label": "if", "type": "if", "loc": [334, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [4, 2, 0.6813, 0.0041, 2, 0.5, 0.8571, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if app_cache_ready():\n self._name_map = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L335_C12", "label": "self._name_map =", "type": "assigned_variable", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L334_C8", "vector": [14, 3, 0.6823, 0.002, 3, 0.23, 0.0, 711, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._name_map", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._name_map = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L336_C8", "label": "return", "type": "return", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "vector": [13, 2, 0.6843, 0.002, 2, 0.5, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L338_C4", "label": "get_add_permission", "type": "function", "loc": [338, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.6894, 0.0041, 1, 0.15, 0.6389, 890, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_add_permission", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_add_permission(self):\n return 'add_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L339_C8", "label": "return", "type": "return", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L338_C4", "vector": [13, 2, 0.6904, 0.002, 2, 0.89, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'add_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L341_C4", "label": "get_change_permission", "type": "function", "loc": [341, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.6955, 0.0041, 1, 0.15, 0.6667, 819, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_change_permission", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_change_permission(self):\n return 'change_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L342_C8", "label": "return", "type": "return", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L341_C4", "vector": [13, 2, 0.6965, 0.002, 2, 0.84, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'change_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L344_C4", "label": "get_delete_permission", "type": "function", "loc": [344, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.7016, 0.0041, 1, 0.15, 0.6944, 558, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_delete_permission", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_delete_permission(self):\n return 'delete_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L345_C8", "label": "return", "type": "return", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L344_C4", "vector": [13, 2, 0.7026, 0.002, 2, 0.49, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'delete_%s' % self.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L347_C4", "label": "get_all_related_objects", "type": "function", "loc": [347, 349], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.7088, 0.0061, 1, 0.15, 0.7222, 388, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_all_related_objects", "arg_names": ["self", "local_only", "include_hidden"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_related_objects(self, local_only=False, include_hidden=False):\n return [k for k, v in self.get_all_related_objects_with_model(\n local_only=local_only, include_hidden=include_hidden)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L348_C8", "label": "return", "type": "return", "loc": [348, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L347_C4", "vector": [13, 2, 0.7098, 0.0041, 2, 0.45, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [k for k, v in self.get_all_related_objects_with_model(\n local_only=local_only, include_hidden=include_hidden)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "label": "get_all_related_objects_with_model", "type": "function", "loc": [351, 367], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.7312, 0.0346, 1, 0.15, 0.75, 156, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "get_all_related_objects_with_model", "arg_names": ["self", "local_only", "include_hidden"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_related_objects_with_model(self, local_only=False,\n include_hidden=False):\n \"\"\"\n Returns a list of (related-object, model) pairs. Similar to\n get_fields_with_model().\n \"\"\"\n try:\n self._related_objects_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L353_C8", "label": "expression", "type": "expression", "loc": [353, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [8, 2, 0.722, 0.0081, 2, 0.56, 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 (related-object, model) pairs. Similar to\n get_fields_with_model().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8", "label": "try", "type": "try", "loc": [357, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [7, 2, 0.7301, 0.0081, 2, 0.56, 0.2, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._related_objects_cache\n except AttributeError:\n self._fill_related_objects_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L358_C12", "label": "expression", "type": "expression", "loc": [358, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8", "vector": [8, 3, 0.7291, 0.002, 3, 0.94, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._related_objects_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L360_C12", "label": "_fill_related_objects_cache()", "type": "expression", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8", "vector": [8, 3, 0.7332, 0.002, 3, 0.94, 0.0, 470, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_related_objects_cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_related_objects_cache", "annotation": ""}, "snippet": " self._fill_related_objects_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L361_C8", "label": "predicates =", "type": "assigned_variable", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [14, 2, 0.7352, 0.002, 2, 0.56, 0.4, 814, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "predicates", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " predicates = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L362_C8", "label": "if", "type": "if", "loc": [362, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [4, 2, 0.7383, 0.0041, 2, 0.56, 0.6, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if local_only:\n predicates.append(lambda k, v: not v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L363_C12", "label": "append()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L362_C8", "vector": [8, 3, 0.7393, 0.002, 3, 0.55, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " predicates.append(lambda k, v: not v)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L364_C8", "label": "if", "type": "if", "loc": [364, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [4, 2, 0.7424, 0.0041, 2, 0.56, 0.8, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not include_hidden:\n predicates.append(lambda k, v: not k.field.rel.is_hidden())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L365_C12", "label": "append()", "type": "expression", "loc": [365, 365], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L364_C8", "vector": [8, 3, 0.7434, 0.002, 3, 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": " predicates.append(lambda k, v: not k.field.rel.is_hidden())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L366_C8", "label": "return", "type": "return", "loc": [366, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "vector": [13, 2, 0.7464, 0.0041, 2, 0.56, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return filter(lambda t: all([p(*t) for p in predicates]),\n self._related_objects_cache.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "label": "_fill_related_objects_cache", "type": "function", "loc": [369, 384], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.7668, 0.0326, 1, 0.15, 0.7778, 470, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_fill_related_objects_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fill_related_objects_cache(self):\n cache = SortedDict()\n parent_list = self.get_parent_list()\n for parent in self.parents:\n for obj, model in parent._meta.get_all_related_objects_with_model():\n if (obj.field.creation_counter < 0 or obj.field.rel.parent_link) and obj.model not in parent_list:\n continue\n if not model:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L370_C8", "label": "cache = SortedDict()", "type": "assigned_variable", "loc": [370, 370], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "vector": [14, 2, 0.7536, 0.002, 2, 0.1, 0.0, 419, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "SortedDict", "annotation": ""}, "snippet": " cache = SortedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L371_C8", "label": "parent_list = get_parent_list()", "type": "assigned_variable", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "vector": [14, 2, 0.7556, 0.002, 2, 0.1, 0.25, 724, 3, 0, 0, 0, 6, 10, 1], "semantic": {"name": "parent_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_parent_list", "annotation": ""}, "snippet": " parent_list = self.get_parent_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L372_C8", "label": "for parent", "type": "for", "loc": [372, 379], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "vector": [6, 2, 0.7648, 0.0163, 2, 0.1, 0.5, 80, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n for obj, model in parent._meta.get_all_related_objects_with_model():\n if (obj.field.creation_counter < 0 or obj.field.rel.parent_link) and obj.model not in parent_list:\n continue\n if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12", "label": "for obj, model", "type": "for", "loc": [373, 379], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L372_C8", "vector": [6, 3, 0.7658, 0.0143, 3, 0.33, 0.0, 445, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "obj, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj, model in parent._meta.get_all_related_objects_with_model():\n if (obj.field.creation_counter < 0 or obj.field.rel.parent_link) and obj.model not in parent_list:\n continue\n if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L374_C16", "label": "if", "type": "if", "loc": [374, 375], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12", "vector": [4, 4, 0.7627, 0.0041, 4, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (obj.field.creation_counter < 0 or obj.field.rel.parent_link) and obj.model not in parent_list:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16", "label": "if", "type": "if", "loc": [376, 379], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12", "vector": [4, 4, 0.7688, 0.0081, 4, 0.5, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L377_C20", "label": "assign", "type": "assigned_variable", "loc": [377, 377], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16", "vector": [14, 5, 0.7678, 0.002, 5, 0.56, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[obj] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L379_C20", "label": "assign", "type": "assigned_variable", "loc": [379, 379], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16", "vector": [14, 5, 0.7719, 0.002, 5, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L380_C8", "label": "for klass", "type": "for", "loc": [380, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "vector": [6, 2, 0.777, 0.0081, 2, 0.1, 0.75, 35, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "klass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for klass in get_models(include_auto_created=True):\n for f in klass._meta.local_fields:\n if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L381_C12", "label": "for f", "type": "for", "loc": [381, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L380_C8", "vector": [6, 3, 0.778, 0.0061, 3, 0.48, 0.0, 899, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in klass._meta.local_fields:\n if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L382_C16", "label": "if", "type": "if", "loc": [382, 383], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L381_C12", "vector": [4, 4, 0.779, 0.0041, 4, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L383_C20", "label": "assign", "type": "assigned_variable", "loc": [383, 383], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L382_C16", "vector": [14, 5, 0.78, 0.002, 5, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 9, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L384_C8", "label": "self._related_objects_cache =", "type": "assigned_variable", "loc": [384, 384], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "vector": [14, 2, 0.7821, 0.002, 2, 0.1, 1.0, 982, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._related_objects_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._related_objects_cache = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "label": "get_all_related_many_to_many_objects", "type": "function", "loc": [386, 393], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.7933, 0.0163, 1, 0.15, 0.8056, 37, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_all_related_many_to_many_objects", "arg_names": ["self", "local_only"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_related_many_to_many_objects(self, local_only=False):\n try:\n cache = self._related_many_to_many_cache\n except AttributeError:\n cache = self._fill_related_many_to_many_cache()\n if local_only:\n return [k for k, v in cache.items() if not v]\n return cache.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8", "label": "try", "type": "try", "loc": [387, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "vector": [7, 2, 0.7912, 0.0081, 2, 0.44, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cache = self._related_many_to_many_cache\n except AttributeError:\n cache = self._fill_related_many_to_many_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L388_C12", "label": "cache =", "type": "assigned_variable", "loc": [388, 388], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8", "vector": [14, 3, 0.7902, 0.002, 3, 0.43, 0.0, 419, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache = self._related_many_to_many_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L390_C12", "label": "cache = _fill_related_many_to_many_cache()", "type": "assigned_variable", "loc": [390, 390], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8", "vector": [14, 3, 0.7943, 0.002, 3, 0.43, 0.0, 419, 3, 0, 0, 0, 522, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_related_many_to_many_cache", "annotation": ""}, "snippet": " cache = self._fill_related_many_to_many_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L391_C8", "label": "if", "type": "if", "loc": [391, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "vector": [4, 2, 0.7974, 0.0041, 2, 0.44, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if local_only:\n return [k for k, v in cache.items() if not v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L392_C12", "label": "return", "type": "return", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L391_C8", "vector": [13, 3, 0.7984, 0.002, 3, 0.97, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [k for k, v in cache.items() if not v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L393_C8", "label": "return", "type": "return", "loc": [393, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "vector": [13, 2, 0.8004, 0.002, 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 cache.keys()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "label": "get_all_related_m2m_objects_with_model", "type": "function", "loc": [395, 404], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.8136, 0.0204, 1, 0.15, 0.8333, 505, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_all_related_m2m_objects_with_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_related_m2m_objects_with_model(self):\n \"\"\"\n Returns a list of (related-m2m-object, model) pairs. Similar to\n get_fields_with_model().\n \"\"\"\n try:\n cache = self._related_many_to_many_cache\n except AttributeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L396_C8", "label": "expression", "type": "expression", "loc": [396, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "vector": [8, 2, 0.8096, 0.0081, 2, 0.0, 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 (related-m2m-object, model) pairs. Similar to\n get_fields_with_model().\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8", "label": "try", "type": "try", "loc": [400, 403], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "vector": [7, 2, 0.8177, 0.0081, 2, 0.0, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cache = self._related_many_to_many_cache\n except AttributeError:\n cache = self._fill_related_many_to_many_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L401_C12", "label": "cache =", "type": "assigned_variable", "loc": [401, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8", "vector": [14, 3, 0.8167, 0.002, 3, 0.14, 0.0, 419, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache = self._related_many_to_many_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L403_C12", "label": "cache = _fill_related_many_to_many_cache()", "type": "assigned_variable", "loc": [403, 403], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8", "vector": [14, 3, 0.8208, 0.002, 3, 0.14, 0.0, 419, 3, 0, 0, 0, 522, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_related_many_to_many_cache", "annotation": ""}, "snippet": " cache = self._fill_related_many_to_many_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L404_C8", "label": "return", "type": "return", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "vector": [13, 2, 0.8228, 0.002, 2, 0.0, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cache.items()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "label": "_fill_related_many_to_many_cache", "type": "function", "loc": [406, 423], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.8442, 0.0367, 1, 0.15, 0.8611, 522, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_fill_related_many_to_many_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _fill_related_many_to_many_cache(self):\n cache = SortedDict()\n parent_list = self.get_parent_list()\n for parent in self.parents:\n for obj, model in parent._meta.get_all_related_m2m_objects_with_model():\n if obj.field.creation_counter < 0 and obj.model not in parent_list:\n continue\n if not model:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L407_C8", "label": "cache = SortedDict()", "type": "assigned_variable", "loc": [407, 407], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [14, 2, 0.8289, 0.002, 2, 0.08, 0.0, 419, 3, 0, 0, 0, 525, 10, 1], "semantic": {"name": "cache", "arg_names": [], "import_names": [], "rhs_call_name": "SortedDict", "annotation": ""}, "snippet": " cache = SortedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L408_C8", "label": "parent_list = get_parent_list()", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [14, 2, 0.831, 0.002, 2, 0.08, 0.2, 724, 3, 0, 0, 0, 6, 10, 1], "semantic": {"name": "parent_list", "arg_names": [], "import_names": [], "rhs_call_name": "get_parent_list", "annotation": ""}, "snippet": " parent_list = self.get_parent_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L409_C8", "label": "for parent", "type": "for", "loc": [409, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [6, 2, 0.8401, 0.0163, 2, 0.08, 0.4, 80, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n for obj, model in parent._meta.get_all_related_m2m_objects_with_model():\n if obj.field.creation_counter < 0 and obj.model not in parent_list:\n continue\n if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12", "label": "for obj, model", "type": "for", "loc": [410, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L409_C8", "vector": [6, 3, 0.8411, 0.0143, 3, 0.36, 0.0, 445, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "obj, model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for obj, model in parent._meta.get_all_related_m2m_objects_with_model():\n if obj.field.creation_counter < 0 and obj.model not in parent_list:\n continue\n if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L411_C16", "label": "if", "type": "if", "loc": [411, 412], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12", "vector": [4, 4, 0.8381, 0.0041, 4, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if obj.field.creation_counter < 0 and obj.model not in parent_list:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16", "label": "if", "type": "if", "loc": [413, 416], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12", "vector": [4, 4, 0.8442, 0.0081, 4, 0.04, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not model:\n cache[obj] = parent\n else:\n cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L414_C20", "label": "assign", "type": "assigned_variable", "loc": [414, 414], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16", "vector": [14, 5, 0.8432, 0.002, 5, 0.21, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[obj] = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L416_C20", "label": "assign", "type": "assigned_variable", "loc": [416, 416], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16", "vector": [14, 5, 0.8473, 0.002, 5, 0.21, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[obj] = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L417_C8", "label": "for klass", "type": "for", "loc": [417, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [6, 2, 0.8523, 0.0081, 2, 0.08, 0.6, 35, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "klass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for klass in get_models():\n for f in klass._meta.local_many_to_many:\n if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L418_C12", "label": "for f", "type": "for", "loc": [418, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L417_C8", "vector": [6, 3, 0.8534, 0.0061, 3, 0.64, 0.0, 899, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in klass._meta.local_many_to_many:\n if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L419_C16", "label": "if", "type": "if", "loc": [419, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L418_C12", "vector": [4, 4, 0.8544, 0.0041, 4, 0.43, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:\n cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L420_C20", "label": "assign", "type": "assigned_variable", "loc": [420, 420], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L419_C16", "vector": [14, 5, 0.8554, 0.002, 5, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 9, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cache[RelatedObject(f.rel.to, klass, f)] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L421_C8", "label": "if", "type": "if", "loc": [421, 422], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [4, 2, 0.8585, 0.0041, 2, 0.08, 0.8, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if app_cache_ready():\n self._related_many_to_many_cache = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L422_C12", "label": "self._related_many_to_many_cache =", "type": "assigned_variable", "loc": [422, 422], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L421_C8", "vector": [14, 3, 0.8595, 0.002, 3, 0.85, 0.0, 740, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._related_many_to_many_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._related_many_to_many_cache = cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L423_C8", "label": "return", "type": "return", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "vector": [13, 2, 0.8615, 0.002, 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 cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "label": "get_base_chain", "type": "function", "loc": [425, 441], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.8819, 0.0346, 1, 0.15, 0.8889, 291, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_base_chain", "arg_names": ["self", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_base_chain(self, model):\n \"\"\"\n Returns a list of parent classes leading to 'model' (order from closet\n to most distant ancestor). This has to handle the case were 'model' is\n a granparent or even more distant relation.\n \"\"\"\n if not self.parents:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L426_C8", "label": "expression", "type": "expression", "loc": [426, 430], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "vector": [8, 2, 0.8717, 0.0102, 2, 0.39, 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 parent classes leading to 'model' (order from closet\n to most distant ancestor). This has to handle the case were 'model' is\n a granparent or even more distant relation.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L431_C8", "label": "if", "type": "if", "loc": [431, 432], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "vector": [4, 2, 0.8788, 0.0041, 2, 0.39, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.parents:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L432_C12", "label": "return", "type": "return", "loc": [432, 432], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L431_C8", "vector": [13, 3, 0.8798, 0.002, 3, 0.58, 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_99026:If_L433_C8", "label": "if", "type": "if", "loc": [433, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "vector": [4, 2, 0.8829, 0.0041, 2, 0.39, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model in self.parents:\n return [model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L434_C12", "label": "return", "type": "return", "loc": [434, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L433_C8", "vector": [13, 3, 0.8839, 0.002, 3, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [model]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8", "label": "for parent", "type": "for", "loc": [435, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "vector": [6, 2, 0.89, 0.0102, 2, 0.39, 1.0, 80, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n res = parent._meta.get_base_chain(model)\n if res:\n res.insert(0, parent)\n return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L436_C12", "label": "res = get_base_chain()", "type": "assigned_variable", "loc": [436, 436], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8", "vector": [14, 3, 0.888, 0.002, 3, 0.27, 0.0, 413, 3, 1, 0, 0, 291, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "get_base_chain", "annotation": ""}, "snippet": " res = parent._meta.get_base_chain(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12", "label": "if", "type": "if", "loc": [437, 439], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8", "vector": [4, 3, 0.8921, 0.0061, 3, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res:\n res.insert(0, parent)\n return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L438_C16", "label": "insert()", "type": "expression", "loc": [438, 438], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12", "vector": [8, 4, 0.8921, 0.002, 4, 0.17, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " res.insert(0, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L439_C16", "label": "return", "type": "return", "loc": [439, 439], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12", "vector": [13, 4, 0.8941, 0.002, 4, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "label": "get_parent_list", "type": "function", "loc": [443, 452], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.9114, 0.0204, 1, 0.15, 0.9167, 6, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "get_parent_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_parent_list(self):\n \"\"\"\n Returns a list of all the ancestor of this model as a list. Useful for\n determining if something is an ancestor, regardless of lineage.\n \"\"\"\n result = set()\n for parent in self.parents:\n result.add(parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L444_C8", "label": "expression", "type": "expression", "loc": [444, 447], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "vector": [8, 2, 0.9073, 0.0081, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns a list of all the ancestor of this model as a list. Useful for\n determining if something is an ancestor, regardless of lineage.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L448_C8", "label": "result = set()", "type": "assigned_variable", "loc": [448, 448], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "vector": [14, 2, 0.9124, 0.002, 2, 0.4, 0.3333, 51, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " result = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8", "label": "for parent", "type": "for", "loc": [449, 451], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "vector": [6, 2, 0.9165, 0.0061, 2, 0.4, 0.6667, 80, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n result.add(parent)\n result.update(parent._meta.get_parent_list())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L450_C12", "label": "add()", "type": "expression", "loc": [450, 450], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8", "vector": [8, 3, 0.9165, 0.002, 3, 0.29, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " result.add(parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L451_C12", "label": "update()", "type": "expression", "loc": [451, 451], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8", "vector": [8, 3, 0.9185, 0.002, 3, 0.29, 1.0, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " result.update(parent._meta.get_parent_list())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L452_C8", "label": "return", "type": "return", "loc": [452, 452], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "vector": [13, 2, 0.9206, 0.002, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "label": "get_ancestor_link", "type": "function", "loc": [454, 472], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.943, 0.0387, 1, 0.15, 0.9444, 646, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_ancestor_link", "arg_names": ["self", "ancestor"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ancestor_link(self, ancestor):\n \"\"\"\n Returns the field on the current model which points to the given\n \"ancestor\". This is possible an indirect link (a pointer to a parent\n model, which points, eventually, to the ancestor). Used when\n constructing table joins for model inheritance.\n\n Returns None if the model isn't an ancestor of this one."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L455_C8", "label": "expression", "type": "expression", "loc": [455, 462], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "vector": [8, 2, 0.9338, 0.0163, 2, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Returns the field on the current model which points to the given\n \"ancestor\". This is possible an indirect link (a pointer to a parent\n model, which points, eventually, to the ancestor). Used when\n constructing table joins for model inheritance.\n\n Returns None if the model isn't an ancestor of this one.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L463_C8", "label": "if", "type": "if", "loc": [463, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "vector": [4, 2, 0.944, 0.0041, 2, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ancestor in self.parents:\n return self.parents[ancestor]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L464_C12", "label": "return", "type": "return", "loc": [464, 464], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L463_C8", "vector": [13, 3, 0.945, 0.002, 3, 0.55, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parents[ancestor]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8", "label": "for parent", "type": "for", "loc": [465, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "vector": [6, 2, 0.9542, 0.0163, 2, 0.81, 1.0, 80, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for parent in self.parents:\n # Tries to get a link field from the immediate parent\n parent_link = parent._meta.get_ancestor_link(ancestor)\n if parent_link:\n # In case of a proxied model, the first link\n # of the chain to the ancestor is that parent\n # links\n return self.parents[parent] or parent_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L467_C12", "label": "parent_link = get_ancestor_link()", "type": "assigned_variable", "loc": [467, 467], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8", "vector": [14, 3, 0.9511, 0.002, 3, 0.49, 0.0, 48, 3, 1, 0, 0, 646, 10, 1], "semantic": {"name": "parent_link", "arg_names": [], "import_names": [], "rhs_call_name": "get_ancestor_link", "annotation": ""}, "snippet": " parent_link = parent._meta.get_ancestor_link(ancestor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L468_C12", "label": "if", "type": "if", "loc": [468, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8", "vector": [4, 3, 0.9572, 0.0102, 3, 0.49, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if parent_link:\n # In case of a proxied model, the first link\n # of the chain to the ancestor is that parent\n # links\n return self.parents[parent] or parent_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L472_C16", "label": "return", "type": "return", "loc": [472, 472], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L468_C12", "vector": [13, 4, 0.9613, 0.002, 4, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.parents[parent] or parent_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "label": "get_ordered_objects", "type": "function", "loc": [474, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.9766, 0.0244, 1, 0.15, 0.9722, 207, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_ordered_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_ordered_objects(self):\n \"Returns a list of Options objects that are ordered with respect to this object.\"\n if not hasattr(self, '_ordered_objects'):\n objects = []\n # TODO\n #for klass in get_models(get_app(self.app_label)):\n # opts = klass._meta\n # if opts.order_with_respect_to and opts.order_with_respect_to.rel \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L475_C8", "label": "expression", "type": "expression", "loc": [475, 475], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "vector": [8, 2, 0.9674, 0.002, 2, 0.54, 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 Options objects that are ordered with respect to this object.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8", "label": "if", "type": "if", "loc": [476, 484], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "vector": [4, 2, 0.9776, 0.0183, 2, 0.54, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not hasattr(self, '_ordered_objects'):\n objects = []\n # TODO\n #for klass in get_models(get_app(self.app_label)):\n # opts = klass._meta\n # if opts.order_with_respect_to and opts.order_with_respect_to.rel \\\n # and self == opts.order_with_respect_to.rel.to._meta:\n # objects.append(opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L477_C12", "label": "objects =", "type": "assigned_variable", "loc": [477, 477], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8", "vector": [14, 3, 0.9715, 0.002, 3, 0.16, 0.0, 550, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " objects = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L484_C12", "label": "self._ordered_objects =", "type": "assigned_variable", "loc": [484, 484], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8", "vector": [14, 3, 0.9857, 0.002, 3, 0.16, 1.0, 785, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._ordered_objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._ordered_objects = objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L485_C8", "label": "return", "type": "return", "loc": [485, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "vector": [13, 2, 0.9878, 0.002, 2, 0.54, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._ordered_objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4", "label": "pk_index", "type": "function", "loc": [487, 491], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "vector": [2, 1, 0.9959, 0.0102, 1, 0.15, 1.0, 413, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "pk_index", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def pk_index(self):\n \"\"\"\n Returns the index of the primary key field in the self.fields list.\n \"\"\"\n return self.fields.index(self.pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L488_C8", "label": "expression", "type": "expression", "loc": [488, 490], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4", "vector": [8, 2, 0.9959, 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": " \"\"\"\n Returns the index of the primary key field in the self.fields list.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L491_C8", "label": "return", "type": "return", "loc": [491, 491], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4", "vector": [13, 2, 1.0, 0.002, 2, 0.12, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.fields.index(self.pk)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:ImportFrom_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L72_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L76_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L80_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L79_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L81_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L82_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L88_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L89_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L112_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L120_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L121_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L122_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L124_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L126_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L136_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L135_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L138_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L143_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L144_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L170_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L169_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L230_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L231_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L233_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L232_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L235_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L242_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L241_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L244_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L253_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L252_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L255_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L260_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L261_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L261_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L263_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L262_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L265_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L266_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L276_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L277_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L294_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L296_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L293_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L297_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L310_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L309_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L312_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L302_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L320_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L326_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L326_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L327_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L330_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L332_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L333_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L319_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L344_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L344_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L358_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L357_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L362_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L363_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L364_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L365_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L351_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L366_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L370_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L372_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L374_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L373_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L377_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L376_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L379_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L380_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L380_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L381_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L381_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L382_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L382_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L383_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L369_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L384_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L388_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L387_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L390_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L391_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L391_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L392_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L386_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L393_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L401_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:Try_L400_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L403_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L395_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L407_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L408_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L409_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L411_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L410_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L414_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L413_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L416_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L417_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L417_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L418_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L418_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L419_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L419_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L420_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L421_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L421_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L422_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L406_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L423_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L431_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L431_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L432_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L433_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L433_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L434_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L425_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L436_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L435_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L438_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L437_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L439_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L444_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L448_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L450_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L449_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L451_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L443_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L452_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L463_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L463_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L464_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L454_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L467_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:For_L465_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L468_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L468_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L472_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L475_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L477_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:If_L476_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Assign_L484_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L474_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L485_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Expr_L488_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99026:FunctionDef_L487_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99026:Return_L491_C8"}] |
class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def template_name(self):
raise NotImplementedError
def __repr__(self):
return repr(self.__dict__)
class RelatedObject(object):
def __init__(self, parent_model, model, field):
self.parent_model = parent_model
self.model = model
self.opts = model._meta
self.field = field
self.name = '%s:%s' % (self.opts.app_label, self.opts.module_name)
self.var_name = self.opts.object_name.lower()
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
# Defer to the actual field definition for db prep
return self.field.get_db_prep_lookup(lookup_type, value,
connection=connection, prepared=prepared)
def editable_fields(self):
"Get the fields in this class that should be edited inline."
return [f for f in self.opts.fields + self.opts.many_to_many if f.editable and f != self.field]
def __repr__(self):
return "<RelatedObject: %s related to %s>" % (self.name, self.field.name)
def bind(self, field_mapping, original, bound_related_object_class=BoundRelatedObject):
return bound_related_object_class(self, field_mapping, original)
def get_accessor_name(self):
# This method encapsulates the logic that decides what name to give an
# accessor descriptor that retrieves related many-to-one or
# many-to-many objects. It uses the lower-cased object_name + "_set",
# but this can be overridden with the "related_name" option.
if self.field.rel.multiple:
# If this is a symmetrical m2m relation on self, there is no reverse accessor.
if getattr(self.field.rel, 'symmetrical', False) and self.model == self.parent_model:
return None
return self.field.rel.related_name or (self.opts.object_name.lower() + '_set')
else:
return self.field.rel.related_name or (self.opts.object_name.lower())
def get_cache_name(self):
return "_%s_cache" % self.get_accessor_name()
| ajibawa-2023/Python-Code-Large/train/row_99028 | 32 | 50 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "label": "BoundRelatedObject", "type": "class", "loc": [1, 10], "level": 0, "parent": null, "vector": [3, 0, 0.11, 0.2, 0, 0.66, 0.0, 875, 0, 3, 0, 0, 186, 0, 1], "semantic": {"name": "BoundRelatedObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BoundRelatedObject(object):\n def __init__(self, related_object, field_mapping, original):\n self.relation = related_object\n self.field_mappings = field_mapping[related_object.name]\n\n def template_name(self):\n raise NotImplementedError\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4", "label": "__init__", "type": "function", "loc": [2, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "vector": [2, 1, 0.06, 0.06, 1, 0.51, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "related_object", "field_mapping", "original"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, related_object, field_mapping, original):\n self.relation = related_object\n self.field_mappings = field_mapping[related_object.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L3_C8", "label": "self.relation =", "type": "assigned_variable", "loc": [3, 3], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4", "vector": [14, 2, 0.06, 0.02, 2, 0.73, 0.0, 255, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.relation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.relation = related_object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L4_C8", "label": "self.field_mappings =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4", "vector": [14, 2, 0.08, 0.02, 2, 0.73, 1.0, 290, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field_mappings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field_mappings = field_mapping[related_object.name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L6_C4", "label": "template_name", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "vector": [2, 1, 0.13, 0.04, 1, 0.51, 0.5, 522, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "template_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def template_name(self):\n raise NotImplementedError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L9_C4", "label": "__repr__", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "vector": [2, 1, 0.19, 0.04, 1, 0.51, 1.0, 204, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return repr(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L10_C8", "label": "return", "type": "return", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L9_C4", "vector": [13, 2, 0.2, 0.02, 2, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(self.__dict__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "label": "RelatedObject", "type": "class", "loc": [12, 50], "level": 0, "parent": null, "vector": [3, 0, 0.62, 0.78, 0, 0.66, 1.0, 353, 0, 7, 0, 0, 186, 0, 7], "semantic": {"name": "RelatedObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RelatedObject(object):\n def __init__(self, parent_model, model, field):\n self.parent_model = parent_model\n self.model = model\n self.opts = model._meta\n self.field = field\n self.name = '%s:%s' % (self.opts.app_label, self.opts.module_name)\n self.var_name = self.opts.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "label": "__init__", "type": "function", "loc": [13, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.32, 0.14, 1, 0.69, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "parent_model", "model", "field"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent_model, model, field):\n self.parent_model = parent_model\n self.model = model\n self.opts = model._meta\n self.field = field\n self.name = '%s:%s' % (self.opts.app_label, self.opts.module_name)\n self.var_name = self.opts.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L14_C8", "label": "self.parent_model =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.28, 0.02, 2, 0.69, 0.0, 372, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent_model = parent_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L15_C8", "label": "self.model =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.3, 0.02, 2, 0.69, 0.2, 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_99028:Assign_L16_C8", "label": "self.opts =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.32, 0.02, 2, 0.69, 0.4, 26, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.opts = model._meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L17_C8", "label": "self.field =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.34, 0.02, 2, 0.69, 0.6, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field = field"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L18_C8", "label": "self.name =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.36, 0.02, 2, 0.69, 0.8, 689, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = '%s:%s' % (self.opts.app_label, self.opts.module_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L19_C8", "label": "self.var_name = lower()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "vector": [14, 2, 0.38, 0.02, 2, 0.69, 1.0, 628, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "self.var_name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " self.var_name = self.opts.object_name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L21_C4", "label": "get_db_prep_lookup", "type": "function", "loc": [21, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.45, 0.08, 1, 0.69, 0.1667, 681, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "get_db_prep_lookup", "arg_names": ["self", "lookup_type", "value", "connection", "prepared"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):\n # Defer to the actual field definition for db prep\n return self.field.get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=prepared)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L21_C4", "vector": [13, 2, 0.47, 0.04, 2, 0.41, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.field.get_db_prep_lookup(lookup_type, value,\n connection=connection, prepared=prepared)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4", "label": "editable_fields", "type": "function", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.54, 0.06, 1, 0.69, 0.3333, 771, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "editable_fields", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def editable_fields(self):\n \"Get the fields in this class that should be edited inline.\"\n return [f for f in self.opts.fields + self.opts.many_to_many if f.editable and f != self.field]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Expr_L27_C8", "label": "expression", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4", "vector": [8, 2, 0.54, 0.02, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"Get the fields in this class that should be edited inline.\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4", "vector": [13, 2, 0.56, 0.02, 2, 0.77, 1.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [f for f in self.opts.fields + self.opts.many_to_many if f.editable and f != self.field]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L30_C4", "label": "__repr__", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.61, 0.04, 1, 0.69, 0.5, 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 \"<RelatedObject: %s related to %s>\" % (self.name, self.field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L30_C4", "vector": [13, 2, 0.62, 0.02, 2, 0.26, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"<RelatedObject: %s related to %s>\" % (self.name, self.field.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L33_C4", "label": "bind", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.67, 0.04, 1, 0.69, 0.6667, 640, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "bind", "arg_names": ["self", "field_mapping", "original", "bound_related_object_class"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def bind(self, field_mapping, original, bound_related_object_class=BoundRelatedObject):\n return bound_related_object_class(self, field_mapping, original)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L33_C4", "vector": [13, 2, 0.68, 0.02, 2, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bound_related_object_class(self, field_mapping, original)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L36_C4", "label": "get_accessor_name", "type": "function", "loc": [36, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.83, 0.24, 1, 0.69, 0.8333, 315, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_accessor_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_accessor_name(self):\n # This method encapsulates the logic that decides what name to give an\n # accessor descriptor that retrieves related many-to-one or\n # many-to-many objects. It uses the lower-cased object_name + \"_set\",\n # but this can be overridden with the \"related_name\" option.\n if self.field.rel.multiple:\n # If this is a symmetrical m2m relation on self, there is no reverse accessor.\n if getattr(self.field.rel, 'symmetrical', False) and self.model == self.parent_model:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "label": "if", "type": "if", "loc": [41, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L36_C4", "vector": [4, 2, 0.88, 0.14, 2, 0.84, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.field.rel.multiple:\n # If this is a symmetrical m2m relation on self, there is no reverse accessor.\n if getattr(self.field.rel, 'symmetrical', False) and self.model == self.parent_model:\n return None\n return self.field.rel.related_name or (self.opts.object_name.lower() + '_set')\n else:\n return self.field.rel.related_name or (self.opts.object_name.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L43_C12", "label": "if", "type": "if", "loc": [43, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "vector": [4, 3, 0.87, 0.04, 3, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if getattr(self.field.rel, 'symmetrical', False) and self.model == self.parent_model:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L44_C16", "label": "return", "type": "return", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L43_C12", "vector": [13, 4, 0.88, 0.02, 4, 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_99028:Return_L45_C12", "label": "return", "type": "return", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "vector": [13, 3, 0.9, 0.02, 3, 0.82, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.field.rel.related_name or (self.opts.object_name.lower() + '_set')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L47_C12", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "vector": [13, 3, 0.94, 0.02, 3, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.field.rel.related_name or (self.opts.object_name.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L49_C4", "label": "get_cache_name", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "vector": [2, 1, 0.99, 0.04, 1, 0.69, 1.0, 691, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_cache_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_cache_name(self):\n return \"_%s_cache\" % self.get_accessor_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L49_C4", "vector": [13, 2, 1.0, 0.02, 2, 0.05, 0.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"_%s_cache\" % self.get_accessor_name()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L3_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L2_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99028:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99028:Return_L50_C8"}] |
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.db import connection
from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models
from django.db.models.query import Q
from django.db.models.expressions import F
from django.db.models.manager import Manager
from django.db.models.base import Model
from django.db.models.aggregates import *
from django.db.models.fields import *
from django.db.models.fields.subclassing import SubfieldBase
from django.db.models.fields.files import FileField, ImageField
from django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel, ManyToManyRel, OneToOneRel
from django.db.models.deletion import CASCADE, PROTECT, SET, SET_NULL, SET_DEFAULT, DO_NOTHING
from django.db.models import signals
# Admin stages.
ADD, CHANGE, BOTH = 1, 2, 3
def permalink(func):
"""
Decorator that calls urlresolvers.reverse() to return a URL using
parameters returned by the decorated function "func".
"func" should be a function that returns a tuple in one of the
following formats:
(viewname, viewargs)
(viewname, viewargs, viewkwargs)
"""
from django.core.urlresolvers import reverse
def inner(*args, **kwargs):
bits = func(*args, **kwargs)
return reverse(bits[0], None, *bits[1:3])
return inner
| ajibawa-2023/Python-Code-Large/train/row_99029 | 23 | 34 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L1_C0", "label": "from django.conf import settings", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0294, 0.0294, 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_99029:ImportFrom_L2_C0", "label": "from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0294, 0, 0.66, 0.0625, 160, 0, 2, 0, 0, 160, 0, 0], "semantic": {"name": "django.core.exceptions", "arg_names": [], "import_names": ["ObjectDoesNotExist", "ImproperlyConfigured"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L3_C0", "label": "from django.db import connection", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0882, 0.0294, 0, 0.66, 0.125, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L4_C0", "label": "from django.db.models.loading import get_apps, get_app, get_models\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0294, 0, 0.66, 0.1875, 343, 0, 5, 0, 0, 343, 0, 0], "semantic": {"name": "django.db.models.loading", "arg_names": [], "import_names": ["get_apps", "get_app", "get_models", "get_model", "register_models"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L5_C0", "label": "from django.db.models.query import Q", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1471, 0.0294, 0, 0.66, 0.25, 793, 0, 1, 0, 0, 793, 0, 0], "semantic": {"name": "django.db.models.query", "arg_names": [], "import_names": ["Q"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.query import Q"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L6_C0", "label": "from django.db.models.expressions import F", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0294, 0, 0.66, 0.3125, 76, 0, 1, 0, 0, 76, 0, 0], "semantic": {"name": "django.db.models.expressions", "arg_names": [], "import_names": ["F"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.expressions import F"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L7_C0", "label": "from django.db.models.manager import Manager", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.2059, 0.0294, 0, 0.66, 0.375, 59, 0, 1, 0, 0, 59, 0, 0], "semantic": {"name": "django.db.models.manager", "arg_names": [], "import_names": ["Manager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.manager import Manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L8_C0", "label": "from django.db.models.base import Model", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2353, 0.0294, 0, 0.66, 0.4375, 465, 0, 1, 0, 0, 465, 0, 0], "semantic": {"name": "django.db.models.base", "arg_names": [], "import_names": ["Model"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.base import Model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L9_C0", "label": "from django.db.models.aggregates import *", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.2647, 0.0294, 0, 0.66, 0.5, 90, 0, 1, 0, 0, 90, 0, 0], "semantic": {"name": "django.db.models.aggregates", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.aggregates import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L10_C0", "label": "from django.db.models.fields import *", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0294, 0, 0.66, 0.5625, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L11_C0", "label": "from django.db.models.fields.subclassing import SubfieldBase", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.3235, 0.0294, 0, 0.66, 0.625, 936, 0, 1, 0, 0, 936, 0, 0], "semantic": {"name": "django.db.models.fields.subclassing", "arg_names": [], "import_names": ["SubfieldBase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields.subclassing import SubfieldBase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L12_C0", "label": "from django.db.models.fields.files import FileField, ImageField", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0294, 0, 0.66, 0.6875, 736, 0, 2, 0, 0, 736, 0, 0], "semantic": {"name": "django.db.models.fields.files", "arg_names": [], "import_names": ["FileField", "ImageField"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields.files import FileField, ImageField"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L13_C0", "label": "from django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField\u2026", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.3824, 0.0294, 0, 0.66, 0.75, 410, 0, 6, 0, 0, 410, 0, 0], "semantic": {"name": "django.db.models.fields.related", "arg_names": [], "import_names": ["ForeignKey", "OneToOneField", "ManyToManyField", "ManyToOneRel", "ManyToManyRel", "OneToOneRel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields.related import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel, ManyToManyRel, OneToOneRel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L14_C0", "label": "from django.db.models.deletion import CASCADE, PROTECT, SET\u2026", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0294, 0, 0.66, 0.8125, 229, 0, 6, 0, 0, 229, 0, 0], "semantic": {"name": "django.db.models.deletion", "arg_names": [], "import_names": ["CASCADE", "PROTECT", "SET", "SET_NULL", "SET_DEFAULT", "DO_NOTHING"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.deletion import CASCADE, PROTECT, SET, SET_NULL, SET_DEFAULT, DO_NOTHING"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L15_C0", "label": "from django.db.models import signals", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4412, 0.0294, 0, 0.66, 0.875, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["signals"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import signals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:Assign_L18_C0", "label": "ADD, CHANGE, BOTH =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.5294, 0.0294, 0, 0.66, 0.9375, 449, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "ADD, CHANGE, BOTH", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ADD, CHANGE, BOTH = 1, 2, 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "label": "permalink", "type": "function", "loc": [20, 34], "level": 0, "parent": null, "vector": [2, 0, 0.7941, 0.4412, 0, 0.66, 1.0, 386, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "permalink", "arg_names": ["func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def permalink(func):\n \"\"\"\n Decorator that calls urlresolvers.reverse() to return a URL using\n parameters returned by the decorated function \"func\".\n\n \"func\" should be a function that returns a tuple in one of the\n following formats:\n (viewname, viewargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:Expr_L21_C4", "label": "expression", "type": "expression", "loc": [21, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "vector": [8, 1, 0.7353, 0.2647, 1, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Decorator that calls urlresolvers.reverse() to return a URL using\n parameters returned by the decorated function \"func\".\n\n \"func\" should be a function that returns a tuple in one of the\n following formats:\n (viewname, viewargs)\n (viewname, viewargs, viewkwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L30_C4", "label": "from django.core.urlresolvers import reverse", "type": "import", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "vector": [1, 1, 0.8824, 0.0294, 1, 0.13, 0.3333, 749, 0, 1, 0, 0, 749, 0, 0], "semantic": {"name": "django.core.urlresolvers", "arg_names": [], "import_names": ["reverse"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.core.urlresolvers import reverse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4", "label": "inner", "type": "function", "loc": [31, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "vector": [2, 1, 0.9412, 0.0882, 1, 0.13, 0.6667, 763, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "inner", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def inner(*args, **kwargs):\n bits = func(*args, **kwargs)\n return reverse(bits[0], None, *bits[1:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:Assign_L32_C8", "label": "bits = func()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4", "vector": [14, 2, 0.9412, 0.0294, 2, 0.72, 0.0, 593, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "bits", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " bits = func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4", "vector": [13, 2, 0.9706, 0.0294, 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 reverse(bits[0], None, *bits[1:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99029:Return_L34_C4", "label": "return", "type": "return", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "vector": [13, 1, 1.0, 0.0294, 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 inner"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:ImportFrom_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99029:FunctionDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99029:Return_L34_C4"}] |
from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, **kwargs):
"""
Ensures that a Model subclass contains a default manager and sets the
_default_manager attribute on the class. Also sets up the _base_manager
points to a plain Manager instance (which could be the same as
_default_manager if it's not a subclass of Manager).
"""
cls = sender
if cls._meta.abstract:
return
if not getattr(cls, '_default_manager', None):
# Create the default manager, if needed.
try:
cls._meta.get_field('objects')
raise ValueError("Model %s must specify a custom Manager, because it has a field named 'objects'" % cls.__name__)
except FieldDoesNotExist:
pass
cls.add_to_class('objects', Manager())
cls._base_manager = cls.objects
elif not getattr(cls, '_base_manager', None):
default_mgr = cls._default_manager.__class__
if (default_mgr is Manager or
getattr(default_mgr, "use_for_related_fields", False)):
cls._base_manager = cls._default_manager
else:
# Default manager isn't a plain Manager class, or a suitable
# replacement, so we walk up the base class hierarchy until we hit
# something appropriate.
for base_class in default_mgr.mro()[1:]:
if (base_class is Manager or
getattr(base_class, "use_for_related_fields", False)):
cls.add_to_class('_base_manager', base_class())
return
raise AssertionError("Should never get here. Please report a bug, including your model and model manager setup.")
signals.class_prepared.connect(ensure_default_manager)
class Manager(object):
# Tracks each time a Manager instance is created. Used to retain order.
creation_counter = 0
def __init__(self):
super(Manager, self).__init__()
self._set_creation_counter()
self.model = None
self._inherited = False
self._db = None
def contribute_to_class(self, model, name):
# TODO: Use weakref because of possible memory leak / circular reference.
self.model = model
setattr(model, name, ManagerDescriptor(self))
if not getattr(model, '_default_manager', None) or self.creation_counter < model._default_manager.creation_counter:
model._default_manager = self
if model._meta.abstract or (self._inherited and not self.model._meta.proxy):
model._meta.abstract_managers.append((self.creation_counter, name,
self))
else:
model._meta.concrete_managers.append((self.creation_counter, name,
self))
def _set_creation_counter(self):
"""
Sets the creation counter value for this instance and increments the
class-level copy.
"""
self.creation_counter = Manager.creation_counter
Manager.creation_counter += 1
def _copy_to_model(self, model):
"""
Makes a copy of the manager and assigns it to 'model', which should be
a child of the existing model (used when inheriting a manager from an
abstract base class).
"""
assert issubclass(model, self.model)
mgr = copy.copy(self)
mgr._set_creation_counter()
mgr.model = model
mgr._inherited = True
return mgr
def db_manager(self, using):
obj = copy.copy(self)
obj._db = using
return obj
@property
def db(self):
return self._db or router.db_for_read(self.model)
#######################
# PROXIES TO QUERYSET #
#######################
def get_empty_query_set(self):
return EmptyQuerySet(self.model, using=self._db)
def get_query_set(self):
"""Returns a new QuerySet object. Subclasses can override this method
to easily customize the behavior of the Manager.
"""
return QuerySet(self.model, using=self._db)
def none(self):
return self.get_empty_query_set()
def all(self):
return self.get_query_set()
def count(self):
return self.get_query_set().count()
def dates(self, *args, **kwargs):
return self.get_query_set().dates(*args, **kwargs)
def distinct(self, *args, **kwargs):
return self.get_query_set().distinct(*args, **kwargs)
def extra(self, *args, **kwargs):
return self.get_query_set().extra(*args, **kwargs)
def get(self, *args, **kwargs):
return self.get_query_set().get(*args, **kwargs)
def get_or_create(self, **kwargs):
return self.get_query_set().get_or_create(**kwargs)
def create(self, **kwargs):
return self.get_query_set().create(**kwargs)
def filter(self, *args, **kwargs):
return self.get_query_set().filter(*args, **kwargs)
def aggregate(self, *args, **kwargs):
return self.get_query_set().aggregate(*args, **kwargs)
def annotate(self, *args, **kwargs):
return self.get_query_set().annotate(*args, **kwargs)
def complex_filter(self, *args, **kwargs):
return self.get_query_set().complex_filter(*args, **kwargs)
def exclude(self, *args, **kwargs):
return self.get_query_set().exclude(*args, **kwargs)
def in_bulk(self, *args, **kwargs):
return self.get_query_set().in_bulk(*args, **kwargs)
def iterator(self, *args, **kwargs):
return self.get_query_set().iterator(*args, **kwargs)
def latest(self, *args, **kwargs):
return self.get_query_set().latest(*args, **kwargs)
def order_by(self, *args, **kwargs):
return self.get_query_set().order_by(*args, **kwargs)
def select_related(self, *args, **kwargs):
return self.get_query_set().select_related(*args, **kwargs)
def values(self, *args, **kwargs):
return self.get_query_set().values(*args, **kwargs)
def values_list(self, *args, **kwargs):
return self.get_query_set().values_list(*args, **kwargs)
def update(self, *args, **kwargs):
return self.get_query_set().update(*args, **kwargs)
def reverse(self, *args, **kwargs):
return self.get_query_set().reverse(*args, **kwargs)
def defer(self, *args, **kwargs):
return self.get_query_set().defer(*args, **kwargs)
def only(self, *args, **kwargs):
return self.get_query_set().only(*args, **kwargs)
def using(self, *args, **kwargs):
return self.get_query_set().using(*args, **kwargs)
def exists(self, *args, **kwargs):
return self.get_query_set().exists(*args, **kwargs)
def _insert(self, values, **kwargs):
return insert_query(self.model, values, **kwargs)
def _update(self, values, **kwargs):
return self.get_query_set()._update(values, **kwargs)
def raw(self, raw_query, params=None, *args, **kwargs):
return RawQuerySet(raw_query=raw_query, model=self.model, params=params, using=self._db, *args, **kwargs)
class ManagerDescriptor(object):
# This class ensures managers aren't accessible via model instances.
# For example, Poll.objects works, but poll_obj.objects raises AttributeError.
def __init__(self, manager):
self.manager = manager
def __get__(self, instance, type=None):
if instance != None:
raise AttributeError("Manager isn't accessible via %s instances" % type.__name__)
return self.manager
class EmptyManager(Manager):
def get_query_set(self):
return self.get_empty_query_set()
| ajibawa-2023/Python-Code-Large/train/row_99030 | 131 | 216 | 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_99030:ImportFrom_L1_C0", "label": "from django.utils import copy", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0046, 0.0046, 0, 0.66, 0.0, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["copy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import copycompat as copy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ImportFrom_L2_C0", "label": "from django.conf import settings", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0093, 0.0046, 0, 0.66, 0.1, 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_99030:ImportFrom_L3_C0", "label": "from django.db import router", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0139, 0.0046, 0, 0.66, 0.2, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["router"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import router"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ImportFrom_L4_C0", "label": "from django.db.models.query import QuerySet, EmptyQuerySet, insert_query\u2026", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0185, 0.0046, 0, 0.66, 0.3, 793, 0, 4, 0, 0, 793, 0, 0], "semantic": {"name": "django.db.models.query", "arg_names": [], "import_names": ["QuerySet", "EmptyQuerySet", "insert_query", "RawQuerySet"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ImportFrom_L5_C0", "label": "from django.db.models import signals", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0231, 0.0046, 0, 0.66, 0.4, 680, 0, 1, 0, 0, 680, 0, 0], "semantic": {"name": "django.db.models", "arg_names": [], "import_names": ["signals"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models import signals"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ImportFrom_L6_C0", "label": "from django.db.models.fields import FieldDoesNotExist", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0278, 0.0046, 0, 0.66, 0.5, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.models.fields import FieldDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "label": "ensure_default_manager", "type": "function", "loc": [9, 42], "level": 0, "parent": null, "vector": [2, 0, 0.1181, 0.1574, 0, 0.66, 0.6, 141, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "ensure_default_manager", "arg_names": ["sender", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ensure_default_manager(sender, **kwargs):\n \"\"\"\n Ensures that a Model subclass contains a default manager and sets the\n _default_manager attribute on the class. Also sets up the _base_manager\n points to a plain Manager instance (which could be the same as\n _default_manager if it's not a subclass of Manager).\n \"\"\"\n cls = sender"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L10_C4", "label": "expression", "type": "expression", "loc": [10, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "vector": [8, 1, 0.0579, 0.0278, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Ensures that a Model subclass contains a default manager and sets the\n _default_manager attribute on the class. Also sets up the _base_manager\n points to a plain Manager instance (which could be the same as\n _default_manager if it's not a subclass of Manager).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L16_C4", "label": "cls =", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "vector": [14, 1, 0.0741, 0.0046, 1, 0.14, 0.3333, 594, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cls", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls = sender"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L17_C4", "label": "if", "type": "if", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "vector": [4, 1, 0.081, 0.0093, 1, 0.14, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cls._meta.abstract:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L17_C4", "vector": [13, 2, 0.0833, 0.0046, 2, 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_99030:If_L19_C4", "label": "if", "type": "if", "loc": [19, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "vector": [4, 1, 0.1412, 0.1111, 1, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not getattr(cls, '_default_manager', None):\n # Create the default manager, if needed.\n try:\n cls._meta.get_field('objects')\n raise ValueError(\"Model %s must specify a custom Manager, because it has a field named 'objects'\" % cls.__name__)\n except FieldDoesNotExist:\n pass\n cls.add_to_class('objects', Manager())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Try_L21_C8", "label": "try", "type": "try", "loc": [21, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "vector": [7, 2, 0.1065, 0.0231, 2, 0.05, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cls._meta.get_field('objects')\n raise ValueError(\"Model %s must specify a custom Manager, because it has a field named 'objects'\" % cls.__name__)\n except FieldDoesNotExist:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L22_C12", "label": "get_field()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:Try_L21_C8", "vector": [8, 3, 0.1019, 0.0046, 3, 0.49, 0.0, 389, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_field", "arg_names": [], "import_names": [], "rhs_call_name": "get_field", "annotation": ""}, "snippet": " cls._meta.get_field('objects')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L26_C8", "label": "add_to_class()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "vector": [8, 2, 0.1204, 0.0046, 2, 0.05, 0.3333, 811, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "add_to_class", "annotation": ""}, "snippet": " cls.add_to_class('objects', Manager())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L27_C8", "label": "cls._base_manager =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "vector": [14, 2, 0.125, 0.0046, 2, 0.05, 0.6667, 611, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cls._base_manager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls._base_manager = cls.objects"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4", "label": "if", "type": "if", "loc": [28, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "vector": [4, 2, 0.162, 0.0694, 2, 0.05, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not getattr(cls, '_base_manager', None):\n default_mgr = cls._default_manager.__class__\n if (default_mgr is Manager or\n getattr(default_mgr, \"use_for_related_fields\", False)):\n cls._base_manager = cls._default_manager\n else:\n # Default manager isn't a plain Manager class, or a suitable\n # replacement, so we walk up the base class hierarchy until we hit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L29_C8", "label": "default_mgr =", "type": "assigned_variable", "loc": [29, 29], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4", "vector": [14, 3, 0.1343, 0.0046, 3, 0.89, 0.0, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "default_mgr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default_mgr = cls._default_manager.__class__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8", "label": "if", "type": "if", "loc": [30, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4", "vector": [4, 3, 0.1667, 0.0602, 3, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (default_mgr is Manager or\n getattr(default_mgr, \"use_for_related_fields\", False)):\n cls._base_manager = cls._default_manager\n else:\n # Default manager isn't a plain Manager class, or a suitable\n # replacement, so we walk up the base class hierarchy until we hit\n # something appropriate.\n for base_class in default_mgr.mro()[1:]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L32_C12", "label": "cls._base_manager =", "type": "assigned_variable", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8", "vector": [14, 4, 0.1481, 0.0046, 4, 0.14, 0.0, 611, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cls._base_manager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cls._base_manager = cls._default_manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:For_L37_C12", "label": "for base_class", "type": "for", "loc": [37, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8", "vector": [6, 4, 0.1806, 0.0231, 4, 0.14, 1.0, 18, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "base_class", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for base_class in default_mgr.mro()[1:]:\n if (base_class is Manager or\n getattr(base_class, \"use_for_related_fields\", False)):\n cls.add_to_class('_base_manager', base_class())\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16", "label": "if", "type": "if", "loc": [38, 41], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:For_L37_C12", "vector": [4, 5, 0.1829, 0.0185, 5, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (base_class is Manager or\n getattr(base_class, \"use_for_related_fields\", False)):\n cls.add_to_class('_base_manager', base_class())\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L40_C20", "label": "add_to_class()", "type": "expression", "loc": [40, 40], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16", "vector": [8, 6, 0.1852, 0.0046, 6, 0.34, 0.0, 811, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_to_class", "arg_names": [], "import_names": [], "rhs_call_name": "add_to_class", "annotation": ""}, "snippet": " cls.add_to_class('_base_manager', base_class())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L41_C20", "label": "return", "type": "return", "loc": [41, 41], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16", "vector": [13, 6, 0.1898, 0.0046, 6, 0.34, 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_99030:Expr_L44_C0", "label": "connect()", "type": "expression", "loc": [44, 44], "level": 0, "parent": null, "vector": [8, 0, 0.2037, 0.0046, 0, 0.66, 0.7, 242, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": "signals.class_prepared.connect(ensure_default_manager)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "label": "Manager", "type": "class", "loc": [46, 201], "level": 0, "parent": null, "vector": [3, 0, 0.5718, 0.7222, 0, 0.66, 0.8, 412, 0, 38, 0, 0, 186, 0, 71], "semantic": {"name": "Manager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Manager(object):\n # Tracks each time a Manager instance is created. Used to retain order.\n creation_counter = 0\n\n def __init__(self):\n super(Manager, self).__init__()\n self._set_creation_counter()\n self.model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L48_C4", "label": "creation_counter =", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [14, 1, 0.2222, 0.0046, 1, 0.12, 0.0, 884, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "creation_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " creation_counter = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "label": "__init__", "type": "function", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.2431, 0.0278, 1, 0.12, 0.0263, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n super(Manager, self).__init__()\n self._set_creation_counter()\n self.model = None\n self._inherited = False\n self._db = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L51_C8", "label": "__init__()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "vector": [8, 2, 0.2361, 0.0046, 2, 0.63, 0.0, 555, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Manager, self).__init__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L52_C8", "label": "_set_creation_counter()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "vector": [8, 2, 0.2407, 0.0046, 2, 0.63, 0.25, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_set_creation_counter", "arg_names": [], "import_names": [], "rhs_call_name": "_set_creation_counter", "annotation": ""}, "snippet": " self._set_creation_counter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L53_C8", "label": "self.model =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "vector": [14, 2, 0.2454, 0.0046, 2, 0.63, 0.5, 81, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L54_C8", "label": "self._inherited =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "vector": [14, 2, 0.25, 0.0046, 2, 0.63, 0.75, 294, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._inherited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._inherited = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L55_C8", "label": "self._db =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "vector": [14, 2, 0.2546, 0.0046, 2, 0.63, 1.0, 896, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._db = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "label": "contribute_to_class", "type": "function", "loc": [57, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.2894, 0.0556, 1, 0.12, 0.0526, 973, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "contribute_to_class", "arg_names": ["self", "model", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contribute_to_class(self, model, name):\n # TODO: Use weakref because of possible memory leak / circular reference.\n self.model = model\n setattr(model, name, ManagerDescriptor(self))\n if not getattr(model, '_default_manager', None) or self.creation_counter < model._default_manager.creation_counter:\n model._default_manager = self\n if model._meta.abstract or (self._inherited and not self.model._meta.proxy):\n model._meta.abstract_managers.append((self.creation_counter, name,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L59_C8", "label": "self.model =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "vector": [14, 2, 0.2731, 0.0046, 2, 0.97, 0.0, 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_99030:Expr_L60_C8", "label": "setattr()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "vector": [8, 2, 0.2778, 0.0046, 2, 0.97, 0.3333, 501, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(model, name, ManagerDescriptor(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L61_C8", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "vector": [4, 2, 0.2847, 0.0093, 2, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not getattr(model, '_default_manager', None) or self.creation_counter < model._default_manager.creation_counter:\n model._default_manager = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L62_C12", "label": "model._default_manager =", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L61_C8", "vector": [14, 3, 0.287, 0.0046, 3, 0.08, 0.0, 688, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "model._default_manager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " model._default_manager = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8", "label": "if", "type": "if", "loc": [63, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "vector": [4, 2, 0.3032, 0.0278, 2, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if model._meta.abstract or (self._inherited and not self.model._meta.proxy):\n model._meta.abstract_managers.append((self.creation_counter, name,\n self))\n else:\n model._meta.concrete_managers.append((self.creation_counter, name,\n self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L64_C12", "label": "append()", "type": "expression", "loc": [64, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8", "vector": [8, 3, 0.2986, 0.0093, 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": " model._meta.abstract_managers.append((self.creation_counter, name,\n self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L67_C12", "label": "append()", "type": "expression", "loc": [67, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8", "vector": [8, 3, 0.3125, 0.0093, 3, 0.62, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " model._meta.concrete_managers.append((self.creation_counter, name,\n self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4", "label": "_set_creation_counter", "type": "function", "loc": [70, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.338, 0.0324, 1, 0.12, 0.0789, 81, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_set_creation_counter", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_creation_counter(self):\n \"\"\"\n Sets the creation counter value for this instance and increments the\n class-level copy.\n \"\"\"\n self.creation_counter = Manager.creation_counter\n Manager.creation_counter += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L71_C8", "label": "expression", "type": "expression", "loc": [71, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4", "vector": [8, 2, 0.3356, 0.0185, 2, 0.26, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Sets the creation counter value for this instance and increments the\n class-level copy.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L75_C8", "label": "self.creation_counter =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4", "vector": [14, 2, 0.3472, 0.0046, 2, 0.26, 1.0, 743, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.creation_counter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.creation_counter = Manager.creation_counter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "label": "_copy_to_model", "type": "function", "loc": [78, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.3866, 0.0556, 1, 0.12, 0.1053, 282, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_copy_to_model", "arg_names": ["self", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _copy_to_model(self, model):\n \"\"\"\n Makes a copy of the manager and assigns it to 'model', which should be\n a child of the existing model (used when inheriting a manager from an\n abstract base class).\n \"\"\"\n assert issubclass(model, self.model)\n mgr = copy.copy(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L79_C8", "label": "expression", "type": "expression", "loc": [79, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [8, 2, 0.375, 0.0231, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Makes a copy of the manager and assigns it to 'model', which should be\n a child of the existing model (used when inheriting a manager from an\n abstract base class).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L85_C8", "label": "mgr = copy()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [14, 2, 0.3935, 0.0046, 2, 0.51, 0.2, 774, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "mgr", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " mgr = copy.copy(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L86_C8", "label": "_set_creation_counter()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [8, 2, 0.3981, 0.0046, 2, 0.51, 0.4, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_set_creation_counter", "arg_names": [], "import_names": [], "rhs_call_name": "_set_creation_counter", "annotation": ""}, "snippet": " mgr._set_creation_counter()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L87_C8", "label": "mgr.model =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [14, 2, 0.4028, 0.0046, 2, 0.51, 0.6, 812, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "mgr.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mgr.model = model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L88_C8", "label": "mgr._inherited =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [14, 2, 0.4074, 0.0046, 2, 0.51, 0.8, 719, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "mgr._inherited", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " mgr._inherited = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "vector": [13, 2, 0.412, 0.0046, 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 mgr"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "label": "db_manager", "type": "function", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.4282, 0.0185, 1, 0.12, 0.1316, 562, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "db_manager", "arg_names": ["self", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db_manager(self, using):\n obj = copy.copy(self)\n obj._db = using\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L92_C8", "label": "obj = copy()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "vector": [14, 2, 0.4259, 0.0046, 2, 0.23, 0.0, 505, 3, 1, 0, 0, 739, 10, 1], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " obj = copy.copy(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L93_C8", "label": "obj._db =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "vector": [14, 2, 0.4306, 0.0046, 2, 0.23, 0.5, 554, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "obj._db", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj._db = using"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "vector": [13, 2, 0.4352, 0.0046, 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 obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L97_C4", "label": "db", "type": "function", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.4514, 0.0093, 1, 0.12, 0.1579, 761, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "db", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def db(self):\n return self._db or router.db_for_read(self.model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L98_C8", "label": "return", "type": "return", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L97_C4", "vector": [13, 2, 0.4537, 0.0046, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._db or router.db_for_read(self.model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L104_C4", "label": "get_empty_query_set", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.4838, 0.0093, 1, 0.12, 0.1842, 3, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_empty_query_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_empty_query_set(self):\n return EmptyQuerySet(self.model, using=self._db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L104_C4", "vector": [13, 2, 0.4861, 0.0046, 2, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return EmptyQuerySet(self.model, using=self._db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4", "label": "get_query_set", "type": "function", "loc": [107, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5046, 0.0231, 1, 0.12, 0.2105, 696, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_query_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_query_set(self):\n \"\"\"Returns a new QuerySet object. Subclasses can override this method\n to easily customize the behavior of the Manager.\n \"\"\"\n return QuerySet(self.model, using=self._db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L108_C8", "label": "expression", "type": "expression", "loc": [108, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4", "vector": [8, 2, 0.5046, 0.0139, 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 new QuerySet object. Subclasses can override this method\n to easily customize the behavior of the Manager.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4", "vector": [13, 2, 0.5139, 0.0046, 2, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return QuerySet(self.model, using=self._db)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L113_C4", "label": "none", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5255, 0.0093, 1, 0.12, 0.2368, 615, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "none", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def none(self):\n return self.get_empty_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L113_C4", "vector": [13, 2, 0.5278, 0.0046, 2, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_empty_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L116_C4", "label": "all", "type": "function", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5394, 0.0093, 1, 0.12, 0.2632, 895, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "all", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def all(self):\n return self.get_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L116_C4", "vector": [13, 2, 0.5417, 0.0046, 2, 0.67, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L119_C4", "label": "count", "type": "function", "loc": [119, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5532, 0.0093, 1, 0.12, 0.2895, 778, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "count", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def count(self):\n return self.get_query_set().count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L119_C4", "vector": [13, 2, 0.5556, 0.0046, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L122_C4", "label": "dates", "type": "function", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5671, 0.0093, 1, 0.12, 0.3158, 253, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "dates", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dates(self, *args, **kwargs):\n return self.get_query_set().dates(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L122_C4", "vector": [13, 2, 0.5694, 0.0046, 2, 0.69, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().dates(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L125_C4", "label": "distinct", "type": "function", "loc": [125, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.581, 0.0093, 1, 0.12, 0.3421, 934, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "distinct", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def distinct(self, *args, **kwargs):\n return self.get_query_set().distinct(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L126_C8", "label": "return", "type": "return", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L125_C4", "vector": [13, 2, 0.5833, 0.0046, 2, 0.07, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().distinct(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L128_C4", "label": "extra", "type": "function", "loc": [128, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.5949, 0.0093, 1, 0.12, 0.3684, 980, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "extra", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def extra(self, *args, **kwargs):\n return self.get_query_set().extra(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L129_C8", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L128_C4", "vector": [13, 2, 0.5972, 0.0046, 2, 0.22, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().extra(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L131_C4", "label": "get", "type": "function", "loc": [131, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6088, 0.0093, 1, 0.12, 0.3947, 607, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get(self, *args, **kwargs):\n return self.get_query_set().get(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L132_C8", "label": "return", "type": "return", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L131_C4", "vector": [13, 2, 0.6111, 0.0046, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().get(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L134_C4", "label": "get_or_create", "type": "function", "loc": [134, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6227, 0.0093, 1, 0.12, 0.4211, 204, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_or_create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_or_create(self, **kwargs):\n return self.get_query_set().get_or_create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L134_C4", "vector": [13, 2, 0.625, 0.0046, 2, 0.28, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().get_or_create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L137_C4", "label": "create", "type": "function", "loc": [137, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6366, 0.0093, 1, 0.12, 0.4474, 316, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "create", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create(self, **kwargs):\n return self.get_query_set().create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L138_C8", "label": "return", "type": "return", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L137_C4", "vector": [13, 2, 0.6389, 0.0046, 2, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().create(**kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L140_C4", "label": "filter", "type": "function", "loc": [140, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6505, 0.0093, 1, 0.12, 0.4737, 526, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "filter", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def filter(self, *args, **kwargs):\n return self.get_query_set().filter(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L140_C4", "vector": [13, 2, 0.6528, 0.0046, 2, 0.08, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().filter(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L143_C4", "label": "aggregate", "type": "function", "loc": [143, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6644, 0.0093, 1, 0.12, 0.5, 583, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "aggregate", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def aggregate(self, *args, **kwargs):\n return self.get_query_set().aggregate(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L144_C8", "label": "return", "type": "return", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L143_C4", "vector": [13, 2, 0.6667, 0.0046, 2, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().aggregate(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L146_C4", "label": "annotate", "type": "function", "loc": [146, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6782, 0.0093, 1, 0.12, 0.5263, 296, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "annotate", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def annotate(self, *args, **kwargs):\n return self.get_query_set().annotate(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L146_C4", "vector": [13, 2, 0.6806, 0.0046, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().annotate(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L149_C4", "label": "complex_filter", "type": "function", "loc": [149, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.6921, 0.0093, 1, 0.12, 0.5526, 165, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "complex_filter", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def complex_filter(self, *args, **kwargs):\n return self.get_query_set().complex_filter(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L150_C8", "label": "return", "type": "return", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L149_C4", "vector": [13, 2, 0.6944, 0.0046, 2, 0.65, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().complex_filter(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L152_C4", "label": "exclude", "type": "function", "loc": [152, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.706, 0.0093, 1, 0.12, 0.5789, 739, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "exclude", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exclude(self, *args, **kwargs):\n return self.get_query_set().exclude(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L153_C8", "label": "return", "type": "return", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L152_C4", "vector": [13, 2, 0.7083, 0.0046, 2, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().exclude(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L155_C4", "label": "in_bulk", "type": "function", "loc": [155, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7199, 0.0093, 1, 0.12, 0.6053, 851, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "in_bulk", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def in_bulk(self, *args, **kwargs):\n return self.get_query_set().in_bulk(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L156_C8", "label": "return", "type": "return", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L155_C4", "vector": [13, 2, 0.7222, 0.0046, 2, 0.75, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().in_bulk(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L158_C4", "label": "iterator", "type": "function", "loc": [158, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7338, 0.0093, 1, 0.12, 0.6316, 829, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "iterator", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def iterator(self, *args, **kwargs):\n return self.get_query_set().iterator(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L159_C8", "label": "return", "type": "return", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L158_C4", "vector": [13, 2, 0.7361, 0.0046, 2, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().iterator(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L161_C4", "label": "latest", "type": "function", "loc": [161, 162], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7477, 0.0093, 1, 0.12, 0.6579, 632, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "latest", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def latest(self, *args, **kwargs):\n return self.get_query_set().latest(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L162_C8", "label": "return", "type": "return", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L161_C4", "vector": [13, 2, 0.75, 0.0046, 2, 0.86, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().latest(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L164_C4", "label": "order_by", "type": "function", "loc": [164, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7616, 0.0093, 1, 0.12, 0.6842, 23, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "order_by", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def order_by(self, *args, **kwargs):\n return self.get_query_set().order_by(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L165_C8", "label": "return", "type": "return", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L164_C4", "vector": [13, 2, 0.7639, 0.0046, 2, 0.91, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().order_by(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L167_C4", "label": "select_related", "type": "function", "loc": [167, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7755, 0.0093, 1, 0.12, 0.7105, 595, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "select_related", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def select_related(self, *args, **kwargs):\n return self.get_query_set().select_related(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L167_C4", "vector": [13, 2, 0.7778, 0.0046, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().select_related(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L170_C4", "label": "values", "type": "function", "loc": [170, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.7894, 0.0093, 1, 0.12, 0.7368, 721, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "values", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def values(self, *args, **kwargs):\n return self.get_query_set().values(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L171_C8", "label": "return", "type": "return", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L170_C4", "vector": [13, 2, 0.7917, 0.0046, 2, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().values(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L173_C4", "label": "values_list", "type": "function", "loc": [173, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8032, 0.0093, 1, 0.12, 0.7632, 253, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "values_list", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def values_list(self, *args, **kwargs):\n return self.get_query_set().values_list(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L173_C4", "vector": [13, 2, 0.8056, 0.0046, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().values_list(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L176_C4", "label": "update", "type": "function", "loc": [176, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8171, 0.0093, 1, 0.12, 0.7895, 637, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, *args, **kwargs):\n return self.get_query_set().update(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L177_C8", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L176_C4", "vector": [13, 2, 0.8194, 0.0046, 2, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().update(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L179_C4", "label": "reverse", "type": "function", "loc": [179, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.831, 0.0093, 1, 0.12, 0.8158, 109, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "reverse", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reverse(self, *args, **kwargs):\n return self.get_query_set().reverse(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L180_C8", "label": "return", "type": "return", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L179_C4", "vector": [13, 2, 0.8333, 0.0046, 2, 0.15, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().reverse(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L182_C4", "label": "defer", "type": "function", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8449, 0.0093, 1, 0.12, 0.8421, 826, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "defer", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def defer(self, *args, **kwargs):\n return self.get_query_set().defer(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L182_C4", "vector": [13, 2, 0.8472, 0.0046, 2, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().defer(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L185_C4", "label": "only", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8588, 0.0093, 1, 0.12, 0.8684, 892, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "only", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def only(self, *args, **kwargs):\n return self.get_query_set().only(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L185_C4", "vector": [13, 2, 0.8611, 0.0046, 2, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().only(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L188_C4", "label": "using", "type": "function", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8727, 0.0093, 1, 0.12, 0.8947, 699, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "using", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def using(self, *args, **kwargs):\n return self.get_query_set().using(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L189_C8", "label": "return", "type": "return", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L188_C4", "vector": [13, 2, 0.875, 0.0046, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().using(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L191_C4", "label": "exists", "type": "function", "loc": [191, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.8866, 0.0093, 1, 0.12, 0.9211, 829, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "exists", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exists(self, *args, **kwargs):\n return self.get_query_set().exists(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L192_C8", "label": "return", "type": "return", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L191_C4", "vector": [13, 2, 0.8889, 0.0046, 2, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set().exists(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L194_C4", "label": "_insert", "type": "function", "loc": [194, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.9005, 0.0093, 1, 0.12, 0.9474, 343, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_insert", "arg_names": ["self", "values", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _insert(self, values, **kwargs):\n return insert_query(self.model, values, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L195_C8", "label": "return", "type": "return", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L194_C4", "vector": [13, 2, 0.9028, 0.0046, 2, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return insert_query(self.model, values, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L197_C4", "label": "_update", "type": "function", "loc": [197, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.9144, 0.0093, 1, 0.12, 0.9737, 417, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_update", "arg_names": ["self", "values", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _update(self, values, **kwargs):\n return self.get_query_set()._update(values, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L198_C8", "label": "return", "type": "return", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L197_C4", "vector": [13, 2, 0.9167, 0.0046, 2, 0.77, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.get_query_set()._update(values, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L200_C4", "label": "raw", "type": "function", "loc": [200, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "vector": [2, 1, 0.9282, 0.0093, 1, 0.12, 1.0, 23, 0, 5, 1, 0, 0, 0, 1], "semantic": {"name": "raw", "arg_names": ["self", "raw_query", "params", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def raw(self, raw_query, params=None, *args, **kwargs):\n return RawQuerySet(raw_query=raw_query, model=self.model, params=params, using=self._db, *args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L201_C8", "label": "return", "type": "return", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L200_C4", "vector": [13, 2, 0.9306, 0.0046, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return RawQuerySet(raw_query=raw_query, model=self.model, params=params, using=self._db, *args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L203_C0", "label": "ManagerDescriptor", "type": "class", "loc": [203, 212], "level": 0, "parent": null, "vector": [3, 0, 0.9606, 0.0463, 0, 0.66, 0.9, 192, 0, 2, 0, 0, 186, 0, 1], "semantic": {"name": "ManagerDescriptor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ManagerDescriptor(object):\n # This class ensures managers aren't accessible via model instances.\n # For example, Poll.objects works, but poll_obj.objects raises AttributeError.\n def __init__(self, manager):\n self.manager = manager\n\n def __get__(self, instance, type=None):\n if instance != None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L206_C4", "label": "__init__", "type": "function", "loc": [206, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L203_C0", "vector": [2, 1, 0.956, 0.0093, 1, 0.46, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "manager"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, manager):\n self.manager = manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L207_C8", "label": "self.manager =", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L206_C4", "vector": [14, 2, 0.9583, 0.0046, 2, 0.22, 0.0, 379, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.manager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.manager = manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4", "label": "__get__", "type": "function", "loc": [209, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L203_C0", "vector": [2, 1, 0.9745, 0.0185, 1, 0.46, 1.0, 93, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, type=None):\n if instance != None:\n raise AttributeError(\"Manager isn't accessible via %s instances\" % type.__name__)\n return self.manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L210_C8", "label": "if", "type": "if", "loc": [210, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4", "vector": [4, 2, 0.9745, 0.0093, 2, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if instance != None:\n raise AttributeError(\"Manager isn't accessible via %s instances\" % type.__name__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L212_C8", "label": "return", "type": "return", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4", "vector": [13, 2, 0.9815, 0.0046, 2, 0.74, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L214_C0", "label": "EmptyManager", "type": "class", "loc": [214, 216], "level": 0, "parent": null, "vector": [3, 0, 0.9954, 0.0139, 0, 0.66, 1.0, 207, 0, 1, 0, 0, 412, 0, 1], "semantic": {"name": "EmptyManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmptyManager(Manager):\n def get_query_set(self):\n return self.get_empty_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L215_C4", "label": "get_query_set", "type": "function", "loc": [215, 216], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L214_C0", "vector": [2, 1, 0.9977, 0.0093, 1, 0.11, 0.0, 696, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_query_set", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_query_set(self):\n return self.get_empty_query_set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L216_C8", "label": "return", "type": "return", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L215_C4", "vector": [13, 2, 1.0, 0.0046, 2, 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.get_empty_query_set()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L17_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Try_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:Try_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:For_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:For_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L40_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L38_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L41_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L167_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L197_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L197_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L200_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L206_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L206_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:If_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:ClassDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99030:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99030:Return_L216_C8"}] |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
import weakref
from django.utils.copycompat import deepcopy
from django.db.backends import util
from django.utils import tree
from django.utils.datastructures import SortedDict
class InvalidQuery(Exception):
"""
The query passed to raw isn't a safe query to use with raw.
"""
pass
class QueryWrapper(object):
"""
A type that indicates the contents are an SQL fragment and the associate
parameters. Can be used to pass opaque data to a where-clause, for example.
"""
def __init__(self, sql, params):
self.data = sql, params
def as_sql(self, qn=None, connection=None):
return self.data
class Q(tree.Node):
"""
Encapsulates filters as objects that can then be combined logically (using
& and |).
"""
# Connection types
AND = 'AND'
OR = 'OR'
default = AND
def __init__(self, *args, **kwargs):
super(Q, self).__init__(children=list(args) + kwargs.items())
def _combine(self, other, conn):
if not isinstance(other, Q):
raise TypeError(other)
obj = type(self)()
obj.add(self, conn)
obj.add(other, conn)
return obj
def __or__(self, other):
return self._combine(other, self.OR)
def __and__(self, other):
return self._combine(other, self.AND)
def __invert__(self):
obj = type(self)()
obj.add(self, self.AND)
obj.negate()
return obj
class DeferredAttribute(object):
"""
A wrapper for a deferred-loading field. When the value is read from this
object the first time, the query is executed.
"""
def __init__(self, field_name, model):
self.field_name = field_name
self.model_ref = weakref.ref(model)
self.loaded = False
def __get__(self, instance, owner):
"""
Retrieves and caches the value from the datastore on the first lookup.
Returns the cached value.
"""
from django.db.models.fields import FieldDoesNotExist
assert instance is not None
cls = self.model_ref()
data = instance.__dict__
if data.get(self.field_name, self) is self:
# self.field_name is the attname of the field, but only() takes the
# actual name, so we need to translate it here.
try:
cls._meta.get_field_by_name(self.field_name)
name = self.field_name
except FieldDoesNotExist:
name = [f.name for f in cls._meta.fields
if f.attname == self.field_name][0]
# We use only() instead of values() here because we want the
# various data coersion methods (to_python(), etc.) to be called
# here.
val = getattr(
cls._base_manager.filter(pk=instance.pk).only(name).using(
instance._state.db).get(),
self.field_name
)
data[self.field_name] = val
return data[self.field_name]
def __set__(self, instance, value):
"""
Deferred loading attributes can be set normally (which means there will
never be a database lookup involved.
"""
instance.__dict__[self.field_name] = value
def select_related_descend(field, restricted, requested, reverse=False):
"""
Returns True if this field should be used to descend deeper for
select_related() purposes. Used by both the query construction code
(sql.query.fill_related_selections()) and the model instance creation code
(query.get_cached_row()).
Arguments:
* field - the field to be checked
* restricted - a boolean field, indicating if the field list has been
manually restricted using a requested clause)
* requested - The select_related() dictionary.
* reverse - boolean, True if we are checking a reverse select related
"""
if not field.rel:
return False
if field.rel.parent_link and not reverse:
return False
if restricted:
if reverse and field.related_query_name() not in requested:
return False
if not reverse and field.name not in requested:
return False
if not restricted and field.null:
return False
return True
# This function is needed because data descriptors must be defined on a class
# object, not an instance, to have any effect.
def deferred_class_factory(model, attrs):
"""
Returns a class object that is a copy of "model" with the specified "attrs"
being replaced with DeferredAttribute objects. The "pk_value" ties the
deferred attributes to a particular instance of the model.
"""
class Meta:
proxy = True
app_label = model._meta.app_label
# The app_cache wants a unique name for each model, otherwise the new class
# won't be created (we get an old one back). Therefore, we generate the
# name using the passed in attrs. It's OK to reuse an existing class
# object if the attrs are identical.
name = "%s_Deferred_%s" % (model.__name__, '_'.join(sorted(list(attrs))))
name = util.truncate_name(name, 80, 32)
overrides = dict([(attr, DeferredAttribute(attr, model))
for attr in attrs])
overrides["Meta"] = Meta
overrides["__module__"] = model.__module__
overrides["_deferred"] = True
return type(name, (model,), overrides)
# The above function is also used to unpickle model instances with deferred
# fields.
deferred_class_factory.__safe_for_unpickling__ = True
| ajibawa-2023/Python-Code-Large/train/row_99031 | 85 | 171 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0234, 0.0409, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nVarious data structures used in query construction.\n\nFactored out from django.db.models.query to avoid making the main module very\nlarge and/or so that they can be used by other modules without getting into\ncircular import difficulties.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Import_L9_C0", "label": "weakref import weakref", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0058, 0, 0.66, 0.0833, 708, 0, 1, 0, 0, 708, 0, 0], "semantic": {"name": "weakref", "arg_names": [], "import_names": ["weakref"], "rhs_call_name": "", "annotation": ""}, "snippet": "import weakref"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ImportFrom_L10_C0", "label": "from django.utils.copycompat import deepcopy", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0585, 0.0058, 0, 0.66, 0.1667, 125, 0, 1, 0, 0, 125, 0, 0], "semantic": {"name": "django.utils.copycompat", "arg_names": [], "import_names": ["deepcopy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.copycompat import deepcopy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ImportFrom_L12_C0", "label": "from django.db.backends import util", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0702, 0.0058, 0, 0.66, 0.25, 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_99031:ImportFrom_L13_C0", "label": "from django.utils import tree", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.076, 0.0058, 0, 0.66, 0.3333, 944, 0, 1, 0, 0, 944, 0, 0], "semantic": {"name": "django.utils", "arg_names": [], "import_names": ["tree"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils import tree"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ImportFrom_L14_C0", "label": "from django.utils.datastructures import SortedDict", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0819, 0.0058, 0, 0.66, 0.4167, 757, 0, 1, 0, 0, 757, 0, 0], "semantic": {"name": "django.utils.datastructures", "arg_names": [], "import_names": ["SortedDict"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.utils.datastructures import SortedDict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L17_C0", "label": "InvalidQuery", "type": "class", "loc": [17, 21], "level": 0, "parent": null, "vector": [3, 0, 0.1111, 0.0292, 0, 0.66, 0.5, 382, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "InvalidQuery", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class InvalidQuery(Exception):\n \"\"\"\n The query passed to raw isn't a safe query to use with raw.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L18_C4", "label": "expression", "type": "expression", "loc": [18, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L17_C0", "vector": [8, 1, 0.1111, 0.0175, 1, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n The query passed to raw isn't a safe query to use with raw.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "label": "QueryWrapper", "type": "class", "loc": [24, 33], "level": 0, "parent": null, "vector": [3, 0, 0.1667, 0.0585, 0, 0.66, 0.5833, 459, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "QueryWrapper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class QueryWrapper(object):\n \"\"\"\n A type that indicates the contents are an SQL fragment and the associate\n parameters. Can be used to pass opaque data to a where-clause, for example.\n \"\"\"\n def __init__(self, sql, params):\n self.data = sql, params\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L25_C4", "label": "expression", "type": "expression", "loc": [25, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "vector": [8, 1, 0.155, 0.0234, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A type that indicates the contents are an SQL fragment and the associate\n parameters. Can be used to pass opaque data to a where-clause, for example.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "vector": [2, 1, 0.1725, 0.0117, 1, 0.33, 0.5, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "sql", "params"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, sql, params):\n self.data = sql, params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L30_C8", "label": "self.data =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L29_C4", "vector": [14, 2, 0.1754, 0.0058, 2, 0.08, 0.0, 838, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "self.data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data = sql, params"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L32_C4", "label": "as_sql", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "vector": [2, 1, 0.1901, 0.0117, 1, 0.33, 1.0, 122, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "as_sql", "arg_names": ["self", "qn", "connection"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def as_sql(self, qn=None, connection=None):\n return self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L33_C8", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L32_C4", "vector": [13, 2, 0.193, 0.0058, 2, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "label": "Q", "type": "class", "loc": [35, 66], "level": 0, "parent": null, "vector": [3, 0, 0.2953, 0.1871, 0, 0.66, 0.6667, 928, 0, 5, 0, 0, 668, 0, 16], "semantic": {"name": "Q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Q(tree.Node):\n \"\"\"\n Encapsulates filters as objects that can then be combined logically (using\n & and |).\n \"\"\"\n # Connection types\n AND = 'AND'\n OR = 'OR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L36_C4", "label": "expression", "type": "expression", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [8, 1, 0.2193, 0.0234, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Encapsulates filters as objects that can then be combined logically (using\n & and |).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L41_C4", "label": "AND =", "type": "assigned_variable", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [14, 1, 0.2398, 0.0058, 1, 0.36, 0.125, 436, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "AND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " AND = 'AND'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L42_C4", "label": "OR =", "type": "assigned_variable", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [14, 1, 0.2456, 0.0058, 1, 0.36, 0.25, 762, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " OR = 'OR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L43_C4", "label": "default =", "type": "assigned_variable", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [14, 1, 0.2515, 0.0058, 1, 0.36, 0.375, 977, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default = AND"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L45_C4", "label": "__init__", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [2, 1, 0.2661, 0.0117, 1, 0.36, 0.5, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, *args, **kwargs):\n super(Q, self).__init__(children=list(args) + kwargs.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L46_C8", "label": "__init__()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L45_C4", "vector": [8, 2, 0.269, 0.0058, 2, 0.52, 0.0, 555, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " super(Q, self).__init__(children=list(args) + kwargs.items())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "label": "_combine", "type": "function", "loc": [48, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [2, 1, 0.2982, 0.0409, 1, 0.36, 0.625, 388, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_combine", "arg_names": ["self", "other", "conn"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _combine(self, other, conn):\n if not isinstance(other, Q):\n raise TypeError(other)\n obj = type(self)()\n obj.add(self, conn)\n obj.add(other, conn)\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L49_C8", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "vector": [4, 2, 0.2895, 0.0117, 2, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(other, Q):\n raise TypeError(other)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L51_C8", "label": "obj =", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "vector": [14, 2, 0.2982, 0.0058, 2, 0.18, 0.25, 505, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj = type(self)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L52_C8", "label": "add()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "vector": [8, 2, 0.3041, 0.0058, 2, 0.18, 0.5, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " obj.add(self, conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L53_C8", "label": "add()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "vector": [8, 2, 0.3099, 0.0058, 2, 0.18, 0.75, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " obj.add(other, conn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "vector": [13, 2, 0.3158, 0.0058, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L56_C4", "label": "__or__", "type": "function", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [2, 1, 0.3304, 0.0117, 1, 0.36, 0.75, 789, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__or__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __or__(self, other):\n return self._combine(other, self.OR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L56_C4", "vector": [13, 2, 0.3333, 0.0058, 2, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.OR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L59_C4", "label": "__and__", "type": "function", "loc": [59, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [2, 1, 0.348, 0.0117, 1, 0.36, 0.875, 916, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__and__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __and__(self, other):\n return self._combine(other, self.AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L60_C8", "label": "return", "type": "return", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L59_C4", "vector": [13, 2, 0.3509, 0.0058, 2, 0.99, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._combine(other, self.AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "label": "__invert__", "type": "function", "loc": [62, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "vector": [2, 1, 0.3743, 0.0292, 1, 0.36, 1.0, 504, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "__invert__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __invert__(self):\n obj = type(self)()\n obj.add(self, self.AND)\n obj.negate()\n return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L63_C8", "label": "obj =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "vector": [14, 2, 0.3684, 0.0058, 2, 0.37, 0.0, 505, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "obj", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " obj = type(self)()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L64_C8", "label": "add()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "vector": [8, 2, 0.3743, 0.0058, 2, 0.37, 0.3333, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " obj.add(self, self.AND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L65_C8", "label": "negate()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "vector": [8, 2, 0.3801, 0.0058, 2, 0.37, 0.6667, 426, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "negate", "arg_names": [], "import_names": [], "rhs_call_name": "negate", "annotation": ""}, "snippet": " obj.negate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "vector": [13, 2, 0.386, 0.0058, 2, 0.37, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return obj"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "label": "DeferredAttribute", "type": "class", "loc": [68, 113], "level": 0, "parent": null, "vector": [3, 0, 0.5292, 0.269, 0, 0.66, 0.75, 565, 0, 3, 0, 0, 186, 0, 9], "semantic": {"name": "DeferredAttribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DeferredAttribute(object):\n \"\"\"\n A wrapper for a deferred-loading field. When the value is read from this\n object the first time, the query is executed.\n \"\"\"\n def __init__(self, field_name, model):\n self.field_name = field_name\n self.model_ref = weakref.ref(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L69_C4", "label": "expression", "type": "expression", "loc": [69, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "vector": [8, 1, 0.4123, 0.0234, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n A wrapper for a deferred-loading field. When the value is read from this\n object the first time, the query is executed.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "label": "__init__", "type": "function", "loc": [73, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "vector": [2, 1, 0.4357, 0.0234, 1, 0.65, 0.3333, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "field_name", "model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, field_name, model):\n self.field_name = field_name\n self.model_ref = weakref.ref(model)\n self.loaded = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L74_C8", "label": "self.field_name =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "vector": [14, 2, 0.4327, 0.0058, 2, 0.24, 0.0, 881, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.field_name = field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L75_C8", "label": "self.model_ref = ref()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "vector": [14, 2, 0.4386, 0.0058, 2, 0.24, 0.5, 42, 3, 1, 0, 0, 686, 10, 1], "semantic": {"name": "self.model_ref", "arg_names": [], "import_names": [], "rhs_call_name": "ref", "annotation": ""}, "snippet": " self.model_ref = weakref.ref(model)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L76_C8", "label": "self.loaded =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "vector": [14, 2, 0.4444, 0.0058, 2, 0.24, 1.0, 307, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self.loaded", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.loaded = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "label": "__get__", "type": "function", "loc": [78, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "vector": [2, 1, 0.538, 0.1696, 1, 0.65, 0.6667, 93, 0, 3, 1, 0, 0, 0, 8], "semantic": {"name": "__get__", "arg_names": ["self", "instance", "owner"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __get__(self, instance, owner):\n \"\"\"\n Retrieves and caches the value from the datastore on the first lookup.\n Returns the cached value.\n \"\"\"\n from django.db.models.fields import FieldDoesNotExist\n\n assert instance is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L79_C8", "label": "expression", "type": "expression", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [8, 2, 0.4708, 0.0234, 2, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Retrieves and caches the value from the datastore on the first lookup.\n Returns the cached value.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ImportFrom_L83_C8", "label": "from django.db.models.fields import FieldDoesNotExist", "type": "import", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [1, 2, 0.4854, 0.0058, 2, 0.4, 0.2, 5, 0, 1, 0, 0, 5, 0, 0], "semantic": {"name": "django.db.models.fields", "arg_names": [], "import_names": ["FieldDoesNotExist"], "rhs_call_name": "", "annotation": ""}, "snippet": " from django.db.models.fields import FieldDoesNotExist"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L86_C8", "label": "cls = model_ref()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [14, 2, 0.5029, 0.0058, 2, 0.4, 0.4, 594, 3, 0, 0, 0, 989, 10, 1], "semantic": {"name": "cls", "arg_names": [], "import_names": [], "rhs_call_name": "model_ref", "annotation": ""}, "snippet": " cls = self.model_ref()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L87_C8", "label": "data =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [14, 2, 0.5088, 0.0058, 2, 0.4, 0.6, 929, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = instance.__dict__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "label": "if", "type": "if", "loc": [88, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [4, 2, 0.5643, 0.1053, 2, 0.4, 0.8, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.get(self.field_name, self) is self:\n # self.field_name is the attname of the field, but only() takes the\n # actual name, so we need to translate it here.\n try:\n cls._meta.get_field_by_name(self.field_name)\n name = self.field_name\n except FieldDoesNotExist:\n name = [f.name for f in cls._meta.fields"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "label": "try", "type": "try", "loc": [91, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "vector": [7, 3, 0.5468, 0.0351, 3, 0.8, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cls._meta.get_field_by_name(self.field_name)\n name = self.field_name\n except FieldDoesNotExist:\n name = [f.name for f in cls._meta.fields\n if f.attname == self.field_name][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L92_C16", "label": "get_field_by_name()", "type": "expression", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "vector": [8, 4, 0.538, 0.0058, 4, 0.34, 0.0, 779, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "get_field_by_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_field_by_name", "annotation": ""}, "snippet": " cls._meta.get_field_by_name(self.field_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L93_C16", "label": "name =", "type": "assigned_variable", "loc": [93, 93], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "vector": [14, 4, 0.5439, 0.0058, 4, 0.34, 1.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = self.field_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L95_C16", "label": "name =", "type": "assigned_variable", "loc": [95, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "vector": [14, 4, 0.5585, 0.0117, 4, 0.34, 0.0, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = [f.name for f in cls._meta.fields\n if f.attname == self.field_name][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L100_C12", "label": "val = getattr()", "type": "assigned_variable", "loc": [100, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "vector": [14, 3, 0.5965, 0.0292, 3, 0.8, 0.5, 618, 3, 2, 0, 0, 121, 10, 5], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " val = getattr(\n cls._base_manager.filter(pk=instance.pk).only(name).using(\n instance._state.db).get(),\n self.field_name\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L105_C12", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "vector": [14, 3, 0.614, 0.0058, 3, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data[self.field_name] = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L106_C8", "label": "return", "type": "return", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "vector": [13, 2, 0.6199, 0.0058, 2, 0.4, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data[self.field_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4", "label": "__set__", "type": "function", "loc": [108, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "vector": [2, 1, 0.6462, 0.0351, 1, 0.65, 1.0, 145, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__set__", "arg_names": ["self", "instance", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __set__(self, instance, value):\n \"\"\"\n Deferred loading attributes can be set normally (which means there will\n never be a database lookup involved.\n \"\"\"\n instance.__dict__[self.field_name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L109_C8", "label": "expression", "type": "expression", "loc": [109, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4", "vector": [8, 2, 0.6462, 0.0234, 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 Deferred loading attributes can be set normally (which means there will\n never be a database lookup involved.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L113_C8", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4", "vector": [14, 2, 0.6608, 0.0058, 2, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " instance.__dict__[self.field_name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "label": "select_related_descend", "type": "function", "loc": [115, 140], "level": 0, "parent": null, "vector": [2, 0, 0.7456, 0.152, 0, 0.66, 0.8333, 422, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "select_related_descend", "arg_names": ["field", "restricted", "requested", "reverse"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def select_related_descend(field, restricted, requested, reverse=False):\n \"\"\"\n Returns True if this field should be used to descend deeper for\n select_related() purposes. Used by both the query construction code\n (sql.query.fill_related_selections()) and the model instance creation code\n (query.get_cached_row()).\n\n Arguments:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [8, 1, 0.7135, 0.076, 1, 0.4, 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 this field should be used to descend deeper for\n select_related() purposes. Used by both the query construction code\n (sql.query.fill_related_selections()) and the model instance creation code\n (query.get_cached_row()).\n\n Arguments:\n * field - the field to be checked"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L129_C4", "label": "if", "type": "if", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [4, 1, 0.7573, 0.0117, 1, 0.4, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not field.rel:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L129_C4", "vector": [13, 2, 0.7602, 0.0058, 2, 0.86, 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_99031:If_L131_C4", "label": "if", "type": "if", "loc": [131, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [4, 1, 0.769, 0.0117, 1, 0.4, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if field.rel.parent_link and not reverse:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L132_C8", "label": "return", "type": "return", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L131_C4", "vector": [13, 2, 0.7719, 0.0058, 2, 0.91, 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_99031:If_L133_C4", "label": "if", "type": "if", "loc": [133, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [4, 1, 0.7895, 0.0292, 1, 0.4, 0.6, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if restricted:\n if reverse and field.related_query_name() not in requested:\n return False\n if not reverse and field.name not in requested:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L134_C8", "label": "if", "type": "if", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L133_C4", "vector": [4, 2, 0.7865, 0.0117, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if reverse and field.related_query_name() not in requested:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L135_C12", "label": "return", "type": "return", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L134_C8", "vector": [13, 3, 0.7895, 0.0058, 3, 0.06, 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_99031:If_L136_C8", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L133_C4", "vector": [4, 2, 0.7982, 0.0117, 2, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not reverse and field.name not in requested:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L137_C12", "label": "return", "type": "return", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L136_C8", "vector": [13, 3, 0.8012, 0.0058, 3, 0.05, 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_99031:If_L138_C4", "label": "if", "type": "if", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [4, 1, 0.8099, 0.0117, 1, 0.4, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not restricted and field.null:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L138_C4", "vector": [13, 2, 0.8129, 0.0058, 2, 0.86, 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_99031:Return_L140_C4", "label": "return", "type": "return", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "vector": [13, 1, 0.8187, 0.0058, 1, 0.4, 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_99031:FunctionDef_L145_C0", "label": "deferred_class_factory", "type": "function", "loc": [145, 167], "level": 0, "parent": null, "vector": [2, 0, 0.9123, 0.1345, 0, 0.66, 0.9167, 614, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "deferred_class_factory", "arg_names": ["model", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def deferred_class_factory(model, attrs):\n \"\"\"\n Returns a class object that is a copy of \"model\" with the specified \"attrs\"\n being replaced with DeferredAttribute objects. The \"pk_value\" ties the\n deferred attributes to a particular instance of the model.\n \"\"\"\n class Meta:\n proxy = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L146_C4", "label": "expression", "type": "expression", "loc": [146, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [8, 1, 0.8655, 0.0292, 1, 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 class object that is a copy of \"model\" with the specified \"attrs\"\n being replaced with DeferredAttribute objects. The \"pk_value\" ties the\n deferred attributes to a particular instance of the model.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4", "label": "Meta", "type": "class", "loc": [151, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [3, 1, 0.8889, 0.0175, 1, 0.08, 0.125, 130, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "Meta", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Meta:\n proxy = True\n app_label = model._meta.app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L152_C8", "label": "proxy =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4", "vector": [14, 2, 0.8889, 0.0058, 2, 0.48, 0.0, 916, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "proxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " proxy = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L153_C8", "label": "app_label =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4", "vector": [14, 2, 0.8947, 0.0058, 2, 0.48, 1.0, 187, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "app_label", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " app_label = model._meta.app_label"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L159_C4", "label": "name =", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9298, 0.0058, 1, 0.08, 0.25, 57, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = \"%s_Deferred_%s\" % (model.__name__, '_'.join(sorted(list(attrs))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L160_C4", "label": "name = truncate_name()", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9357, 0.0058, 1, 0.08, 0.375, 57, 3, 3, 0, 0, 927, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "truncate_name", "annotation": ""}, "snippet": " name = util.truncate_name(name, 80, 32)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L162_C4", "label": "overrides = dict()", "type": "assigned_variable", "loc": [162, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9503, 0.0117, 1, 0.08, 0.5, 53, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "overrides", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " overrides = dict([(attr, DeferredAttribute(attr, model))\n for attr in attrs])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L164_C4", "label": "assign", "type": "assigned_variable", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9591, 0.0058, 1, 0.08, 0.625, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " overrides[\"Meta\"] = Meta"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L165_C4", "label": "assign", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9649, 0.0058, 1, 0.08, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " overrides[\"__module__\"] = model.__module__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L166_C4", "label": "assign", "type": "assigned_variable", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [14, 1, 0.9708, 0.0058, 1, 0.08, 0.875, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " overrides[\"_deferred\"] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L167_C4", "label": "return", "type": "return", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "vector": [13, 1, 0.9766, 0.0058, 1, 0.08, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type(name, (model,), overrides)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L171_C0", "label": "deferred_class_factory.__safe_for_unpickling__ =", "type": "assigned_variable", "loc": [171, 171], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0058, 0, 0.66, 1.0, 698, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "deferred_class_factory.__safe_for_unpickling__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "deferred_class_factory.__safe_for_unpickling__ = True"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:ImportFrom_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L92_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L93_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:Try_L91_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:If_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Expr_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:ClassDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99031:FunctionDef_L145_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99031:Return_L167_C4"}] |
"""
This module implements a transaction manager that can be used to define
transaction handling in a request or view function. It is used by transaction
control middleware and decorators.
The transaction manager can be in managed or in auto state. Auto state means the
system is using a commit-on-save strategy (actually it's more like
commit-on-change). As soon as the .save() or .delete() (or related) methods are
called, a commit is made.
Managed transactions don't do those commits, but will need some kind of manual
or implicit commits or rollbacks.
"""
import sys
try:
import thread
except ImportError:
import dummy_thread as thread
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.conf import settings
from django.db import connections, DEFAULT_DB_ALIAS
class TransactionManagementError(Exception):
"""
This exception is thrown when something bad happens with transaction
management.
"""
pass
# The states are dictionaries of dictionaries of lists. The key to the outer
# dict is the current thread, and the key to the inner dictionary is the
# connection alias and the list is handled as a stack of values.
state = {}
savepoint_state = {}
# The dirty flag is set by *_unless_managed functions to denote that the
# code under transaction management has changed things to require a
# database commit.
# This is a dictionary mapping thread to a dictionary mapping connection
# alias to a boolean.
dirty = {}
def enter_transaction_management(managed=True, using=None):
"""
Enters transaction management for a running thread. It must be balanced with
the appropriate leave_transaction_management call, since the actual state is
managed as a stack.
The state and dirty flag are carried over from the surrounding block or
from the settings, if there is no surrounding block (dirty is always false
when no current block is running).
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
thread_ident = thread.get_ident()
if thread_ident in state and state[thread_ident].get(using):
state[thread_ident][using].append(state[thread_ident][using][-1])
else:
state.setdefault(thread_ident, {})
state[thread_ident][using] = [settings.TRANSACTIONS_MANAGED]
if thread_ident not in dirty or using not in dirty[thread_ident]:
dirty.setdefault(thread_ident, {})
dirty[thread_ident][using] = False
connection._enter_transaction_management(managed)
def leave_transaction_management(using=None):
"""
Leaves transaction management for a running thread. A dirty flag is carried
over to the surrounding block, as a commit will commit all changes, even
those from outside. (Commits are on connection level.)
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
connection._leave_transaction_management(is_managed(using=using))
thread_ident = thread.get_ident()
if thread_ident in state and state[thread_ident].get(using):
del state[thread_ident][using][-1]
else:
raise TransactionManagementError("This code isn't under transaction management")
if dirty.get(thread_ident, {}).get(using, False):
rollback(using=using)
raise TransactionManagementError("Transaction managed block ended with pending COMMIT/ROLLBACK")
dirty[thread_ident][using] = False
def is_dirty(using=None):
"""
Returns True if the current transaction requires a commit for changes to
happen.
"""
if using is None:
using = DEFAULT_DB_ALIAS
return dirty.get(thread.get_ident(), {}).get(using, False)
def set_dirty(using=None):
"""
Sets a dirty flag for the current thread and code streak. This can be used
to decide in a managed block of code to decide whether there are open
changes waiting for commit.
"""
if using is None:
using = DEFAULT_DB_ALIAS
thread_ident = thread.get_ident()
if thread_ident in dirty and using in dirty[thread_ident]:
dirty[thread_ident][using] = True
else:
raise TransactionManagementError("This code isn't under transaction management")
def set_clean(using=None):
"""
Resets a dirty flag for the current thread and code streak. This can be used
to decide in a managed block of code to decide whether a commit or rollback
should happen.
"""
if using is None:
using = DEFAULT_DB_ALIAS
thread_ident = thread.get_ident()
if thread_ident in dirty and using in dirty[thread_ident]:
dirty[thread_ident][using] = False
else:
raise TransactionManagementError("This code isn't under transaction management")
clean_savepoints(using=using)
def clean_savepoints(using=None):
if using is None:
using = DEFAULT_DB_ALIAS
thread_ident = thread.get_ident()
if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:
del savepoint_state[thread_ident][using]
def is_managed(using=None):
"""
Checks whether the transaction manager is in manual or in auto state.
"""
if using is None:
using = DEFAULT_DB_ALIAS
thread_ident = thread.get_ident()
if thread_ident in state and using in state[thread_ident]:
if state[thread_ident][using]:
return state[thread_ident][using][-1]
return settings.TRANSACTIONS_MANAGED
def managed(flag=True, using=None):
"""
Puts the transaction manager into a manual state: managed transactions have
to be committed explicitly by the user. If you switch off transaction
management and there is a pending commit/rollback, the data will be
commited.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
thread_ident = thread.get_ident()
top = state.get(thread_ident, {}).get(using, None)
if top:
top[-1] = flag
if not flag and is_dirty(using=using):
connection._commit()
set_clean(using=using)
else:
raise TransactionManagementError("This code isn't under transaction management")
def commit_unless_managed(using=None):
"""
Commits changes if the system is not in managed transaction mode.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
if not is_managed(using=using):
connection._commit()
clean_savepoints(using=using)
else:
set_dirty(using=using)
def rollback_unless_managed(using=None):
"""
Rolls back changes if the system is not in managed transaction mode.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
if not is_managed(using=using):
connection._rollback()
else:
set_dirty(using=using)
def commit(using=None):
"""
Does the commit itself and resets the dirty flag.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
connection._commit()
set_clean(using=using)
def rollback(using=None):
"""
This function does the rollback itself and resets the dirty flag.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
connection._rollback()
set_clean(using=using)
def savepoint(using=None):
"""
Creates a savepoint (if supported and required by the backend) inside the
current transaction. Returns an identifier for the savepoint that will be
used for the subsequent rollback or commit.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
thread_ident = thread.get_ident()
if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:
savepoint_state[thread_ident][using].append(None)
else:
savepoint_state.setdefault(thread_ident, {})
savepoint_state[thread_ident][using] = [None]
tid = str(thread_ident).replace('-', '')
sid = "s%s_x%d" % (tid, len(savepoint_state[thread_ident][using]))
connection._savepoint(sid)
return sid
def savepoint_rollback(sid, using=None):
"""
Rolls back the most recent savepoint (if one exists). Does nothing if
savepoints are not supported.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
thread_ident = thread.get_ident()
if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:
connection._savepoint_rollback(sid)
def savepoint_commit(sid, using=None):
"""
Commits the most recent savepoint (if one exists). Does nothing if
savepoints are not supported.
"""
if using is None:
using = DEFAULT_DB_ALIAS
connection = connections[using]
thread_ident = thread.get_ident()
if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:
connection._savepoint_commit(sid)
##############
# DECORATORS #
##############
class Transaction(object):
"""
Acts as either a decorator, or a context manager. If it's a decorator it
takes a function and returns a wrapped function. If it's a contextmanager
it's used with the ``with`` statement. In either event entering/exiting
are called before and after, respectively, the function/block is executed.
autocommit, commit_on_success, and commit_manually contain the
implementations of entering and exiting.
"""
def __init__(self, entering, exiting, using):
self.entering = entering
self.exiting = exiting
self.using = using
def __enter__(self):
self.entering(self.using)
def __exit__(self, exc_type, exc_value, traceback):
self.exiting(exc_value, self.using)
def __call__(self, func):
@wraps(func)
def inner(*args, **kwargs):
# Once we drop support for Python 2.4 this block should become:
# with self:
# func(*args, **kwargs)
self.__enter__()
try:
res = func(*args, **kwargs)
except:
self.__exit__(*sys.exc_info())
raise
else:
self.__exit__(None, None, None)
return res
return inner
def _transaction_func(entering, exiting, using):
"""
Takes 3 things, an entering function (what to do to start this block of
transaction management), an exiting function (what to do to end it, on both
success and failure, and using which can be: None, indiciating using is
DEFAULT_DB_ALIAS, a callable, indicating that using is DEFAULT_DB_ALIAS and
to return the function already wrapped.
Returns either a Transaction objects, which is both a decorator and a
context manager, or a wrapped function, if using is a callable.
"""
# Note that although the first argument is *called* `using`, it
# may actually be a function; @autocommit and @autocommit('foo')
# are both allowed forms.
if using is None:
using = DEFAULT_DB_ALIAS
if callable(using):
return Transaction(entering, exiting, DEFAULT_DB_ALIAS)(using)
return Transaction(entering, exiting, using)
def autocommit(using=None):
"""
Decorator that activates commit on save. This is Django's default behavior;
this decorator is useful if you globally activated transaction management in
your settings file and want the default behavior in some view functions.
"""
def entering(using):
enter_transaction_management(managed=False, using=using)
managed(False, using=using)
def exiting(exc_value, using):
leave_transaction_management(using=using)
return _transaction_func(entering, exiting, using)
def commit_on_success(using=None):
"""
This decorator activates commit on response. This way, if the view function
runs successfully, a commit is made; if the viewfunc produces an exception,
a rollback is made. This is one of the most common ways to do transaction
control in Web apps.
"""
def entering(using):
enter_transaction_management(using=using)
managed(True, using=using)
def exiting(exc_value, using):
try:
if exc_value is not None:
if is_dirty(using=using):
rollback(using=using)
else:
if is_dirty(using=using):
try:
commit(using=using)
except:
rollback(using=using)
raise
finally:
leave_transaction_management(using=using)
return _transaction_func(entering, exiting, using)
def commit_manually(using=None):
"""
Decorator that activates manual transaction control. It just disables
automatic transaction control and doesn't do any commit/rollback of its
own -- it's up to the user to call the commit and rollback functions
themselves.
"""
def entering(using):
enter_transaction_management(using=using)
managed(True, using=using)
def exiting(exc_value, using):
leave_transaction_management(using=using)
return _transaction_func(entering, exiting, using)
| ajibawa-2023/Python-Code-Large/train/row_99033 | 205 | 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_99033:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 13], "level": 0, "parent": null, "vector": [8, 0, 0.0185, 0.0344, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nThis module implements a transaction manager that can be used to define\ntransaction handling in a request or view function. It is used by transaction\ncontrol middleware and decorators.\n\nThe transaction manager can be in managed or in auto state. Auto state means the\nsystem is using a commit-on-save strategy (actually it's more like\ncommit-on-change). As soon as the .save() or .delete() (or related) methods are"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Import_L14_C0", "label": "sys import sys", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.037, 0.0026, 0, 0.66, 0.0345, 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_99033:Try_L16_C0", "label": "try", "type": "try", "loc": [16, 19], "level": 0, "parent": null, "vector": [7, 0, 0.0463, 0.0106, 0, 0.66, 0.069, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import thread\nexcept ImportError:\n import dummy_thread as thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Import_L17_C4", "label": "thread import thread", "type": "import", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L16_C0", "vector": [1, 1, 0.045, 0.0026, 1, 0.78, 0.0, 260, 0, 1, 0, 0, 260, 0, 0], "semantic": {"name": "thread", "arg_names": [], "import_names": ["thread"], "rhs_call_name": "", "annotation": ""}, "snippet": " import thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Import_L19_C4", "label": "dummy_thread import thread", "type": "import", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L16_C0", "vector": [1, 1, 0.0503, 0.0026, 1, 0.78, 0.0, 231, 0, 1, 0, 0, 231, 0, 0], "semantic": {"name": "dummy_thread", "arg_names": [], "import_names": ["thread"], "rhs_call_name": "", "annotation": ""}, "snippet": " import dummy_thread as thread"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L20_C0", "label": "try", "type": "try", "loc": [20, 23], "level": 0, "parent": null, "vector": [7, 0, 0.0569, 0.0106, 0, 0.66, 0.1034, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from functools import wraps\nexcept ImportError:\n from django.utils.functional import wraps # Python 2.4 fallback."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:ImportFrom_L21_C4", "label": "from functools import wraps", "type": "import", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L20_C0", "vector": [1, 1, 0.0556, 0.0026, 1, 0.58, 0.0, 711, 0, 1, 0, 0, 711, 0, 0], "semantic": {"name": "functools", "arg_names": [], "import_names": ["wraps"], "rhs_call_name": "", "annotation": ""}, "snippet": " from functools import wraps"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:ImportFrom_L23_C4", "label": "from django.utils.functional import wraps", "type": "import", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L20_C0", "vector": [1, 1, 0.0608, 0.0026, 1, 0.58, 0.0, 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 # Python 2.4 fallback."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:ImportFrom_L25_C0", "label": "from django.conf import settings", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0661, 0.0026, 0, 0.66, 0.1379, 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_99033:ImportFrom_L26_C0", "label": "from django.db import connections, DEFAULT_DB_ALIAS", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0688, 0.0026, 0, 0.66, 0.1724, 40, 0, 2, 0, 0, 40, 0, 0], "semantic": {"name": "django.db", "arg_names": [], "import_names": ["connections", "DEFAULT_DB_ALIAS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db import connections, DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L28_C0", "label": "TransactionManagementError", "type": "class", "loc": [28, 33], "level": 0, "parent": null, "vector": [3, 0, 0.0807, 0.0159, 0, 0.66, 0.2069, 287, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "TransactionManagementError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TransactionManagementError(Exception):\n \"\"\"\n This exception is thrown when something bad happens with transaction\n management.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L29_C4", "label": "expression", "type": "expression", "loc": [29, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L28_C0", "vector": [8, 1, 0.0807, 0.0106, 1, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This exception is thrown when something bad happens with transaction\n management.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L38_C0", "label": "state =", "type": "assigned_variable", "loc": [38, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1005, 0.0026, 0, 0.66, 0.2414, 688, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "state = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L39_C0", "label": "savepoint_state =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.1032, 0.0026, 0, 0.66, 0.2759, 104, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "savepoint_state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "savepoint_state = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L46_C0", "label": "dirty =", "type": "assigned_variable", "loc": [46, 46], "level": 0, "parent": null, "vector": [14, 0, 0.1217, 0.0026, 0, 0.66, 0.3103, 332, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dirty", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "dirty = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "label": "enter_transaction_management", "type": "function", "loc": [48, 70], "level": 0, "parent": null, "vector": [2, 0, 0.1561, 0.0608, 0, 0.66, 0.3448, 871, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "enter_transaction_management", "arg_names": ["managed", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def enter_transaction_management(managed=True, using=None):\n \"\"\"\n Enters transaction management for a running thread. It must be balanced with\n the appropriate leave_transaction_management call, since the actual state is\n managed as a stack.\n\n The state and dirty flag are carried over from the surrounding block or\n from the settings, if there is no surrounding block (dirty is always false"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L49_C4", "label": "expression", "type": "expression", "loc": [49, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [8, 1, 0.1402, 0.0238, 1, 0.14, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Enters transaction management for a running thread. It must be balanced with\n the appropriate leave_transaction_management call, since the actual state is\n managed as a stack.\n\n The state and dirty flag are carried over from the surrounding block or\n from the settings, if there is no surrounding block (dirty is always false\n when no current block is running)."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L58_C4", "label": "if", "type": "if", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [4, 1, 0.1548, 0.0053, 1, 0.14, 0.1667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L59_C8", "label": "using =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L58_C4", "vector": [14, 2, 0.1561, 0.0026, 2, 0.69, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L60_C4", "label": "connection =", "type": "assigned_variable", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [14, 1, 0.1587, 0.0026, 1, 0.14, 0.3333, 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_99033:Assign_L61_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [14, 1, 0.1614, 0.0026, 1, 0.14, 0.5, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "label": "if", "type": "if", "loc": [62, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [4, 1, 0.1693, 0.0132, 1, 0.14, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in state and state[thread_ident].get(using):\n state[thread_ident][using].append(state[thread_ident][using][-1])\n else:\n state.setdefault(thread_ident, {})\n state[thread_ident][using] = [settings.TRANSACTIONS_MANAGED]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L63_C8", "label": "append()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "vector": [8, 2, 0.1667, 0.0026, 2, 0.92, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " state[thread_ident][using].append(state[thread_ident][using][-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L65_C8", "label": "setdefault()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "vector": [8, 2, 0.172, 0.0026, 2, 0.92, 0.5, 262, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setdefault", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " state.setdefault(thread_ident, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L66_C8", "label": "assign", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "vector": [14, 2, 0.1746, 0.0026, 2, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " state[thread_ident][using] = [settings.TRANSACTIONS_MANAGED]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4", "label": "if", "type": "if", "loc": [67, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [4, 1, 0.1799, 0.0079, 1, 0.14, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident not in dirty or using not in dirty[thread_ident]:\n dirty.setdefault(thread_ident, {})\n dirty[thread_ident][using] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L68_C8", "label": "setdefault()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4", "vector": [8, 2, 0.1799, 0.0026, 2, 0.05, 0.0, 262, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setdefault", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " dirty.setdefault(thread_ident, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L69_C8", "label": "assign", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4", "vector": [14, 2, 0.1825, 0.0026, 2, 0.05, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dirty[thread_ident][using] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L70_C4", "label": "_enter_transaction_management()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "vector": [8, 1, 0.1852, 0.0026, 1, 0.14, 1.0, 53, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "_enter_transaction_management", "annotation": ""}, "snippet": " connection._enter_transaction_management(managed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "label": "leave_transaction_management", "type": "function", "loc": [72, 90], "level": 0, "parent": null, "vector": [2, 0, 0.2143, 0.0503, 0, 0.66, 0.3793, 780, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "leave_transaction_management", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def leave_transaction_management(using=None):\n \"\"\"\n Leaves transaction management for a running thread. A dirty flag is carried\n over to the surrounding block, as a commit will commit all changes, even\n those from outside. (Commits are on connection level.)\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L73_C4", "label": "expression", "type": "expression", "loc": [73, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [8, 1, 0.1984, 0.0132, 1, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Leaves transaction management for a running thread. A dirty flag is carried\n over to the surrounding block, as a commit will commit all changes, even\n those from outside. (Commits are on connection level.)\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L78_C4", "label": "if", "type": "if", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [4, 1, 0.2077, 0.0053, 1, 0.99, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L79_C8", "label": "using =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L78_C4", "vector": [14, 2, 0.209, 0.0026, 2, 0.96, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L80_C4", "label": "connection =", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [14, 1, 0.2116, 0.0026, 1, 0.99, 0.2857, 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_99033:Expr_L81_C4", "label": "_leave_transaction_management()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [8, 1, 0.2143, 0.0026, 1, 0.99, 0.4286, 337, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_leave_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "_leave_transaction_management", "annotation": ""}, "snippet": " connection._leave_transaction_management(is_managed(using=using))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L82_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [14, 1, 0.2169, 0.0026, 1, 0.99, 0.5714, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L83_C4", "label": "if", "type": "if", "loc": [83, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [4, 1, 0.2235, 0.0106, 1, 0.99, 0.7143, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in state and state[thread_ident].get(using):\n del state[thread_ident][using][-1]\n else:\n raise TransactionManagementError(\"This code isn't under transaction management\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L87_C4", "label": "if", "type": "if", "loc": [87, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [4, 1, 0.2328, 0.0079, 1, 0.99, 0.8571, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dirty.get(thread_ident, {}).get(using, False):\n rollback(using=using)\n raise TransactionManagementError(\"Transaction managed block ended with pending COMMIT/ROLLBACK\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L88_C8", "label": "rollback()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L87_C4", "vector": [8, 2, 0.2328, 0.0026, 2, 0.59, 0.0, 484, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback", "arg_names": [], "import_names": [], "rhs_call_name": "rollback", "annotation": ""}, "snippet": " rollback(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L90_C4", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "vector": [14, 1, 0.2381, 0.0026, 1, 0.99, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dirty[thread_ident][using] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "label": "is_dirty", "type": "function", "loc": [92, 99], "level": 0, "parent": null, "vector": [2, 0, 0.2526, 0.0212, 0, 0.66, 0.4138, 447, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "is_dirty", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_dirty(using=None):\n \"\"\"\n Returns True if the current transaction requires a commit for changes to\n happen.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n return dirty.get(thread.get_ident(), {}).get(using, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L93_C4", "label": "expression", "type": "expression", "loc": [93, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "vector": [8, 1, 0.25, 0.0106, 1, 0.94, 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 the current transaction requires a commit for changes to\n happen.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L97_C4", "label": "if", "type": "if", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "vector": [4, 1, 0.2579, 0.0053, 1, 0.94, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L98_C8", "label": "using =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L97_C4", "vector": [14, 2, 0.2593, 0.0026, 2, 0.41, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "vector": [13, 1, 0.2619, 0.0026, 1, 0.94, 1.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dirty.get(thread.get_ident(), {}).get(using, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "label": "set_dirty", "type": "function", "loc": [101, 113], "level": 0, "parent": null, "vector": [2, 0, 0.2831, 0.0344, 0, 0.66, 0.4483, 47, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_dirty", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def set_dirty(using=None):\n \"\"\"\n Sets a dirty flag for the current thread and code streak. This can be used\n to decide in a managed block of code to decide whether there are open\n changes waiting for commit.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L102_C4", "label": "expression", "type": "expression", "loc": [102, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "vector": [8, 1, 0.2751, 0.0132, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Sets a dirty flag for the current thread and code streak. This can be used\n to decide in a managed block of code to decide whether there are open\n changes waiting for commit.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L107_C4", "label": "if", "type": "if", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "vector": [4, 1, 0.2844, 0.0053, 1, 0.25, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L108_C8", "label": "using =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L107_C4", "vector": [14, 2, 0.2857, 0.0026, 2, 0.38, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L109_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "vector": [14, 1, 0.2884, 0.0026, 1, 0.25, 0.6667, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L110_C4", "label": "if", "type": "if", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "vector": [4, 1, 0.295, 0.0106, 1, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in dirty and using in dirty[thread_ident]:\n dirty[thread_ident][using] = True\n else:\n raise TransactionManagementError(\"This code isn't under transaction management\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L111_C8", "label": "assign", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L110_C4", "vector": [14, 2, 0.2937, 0.0026, 2, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dirty[thread_ident][using] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "label": "set_clean", "type": "function", "loc": [115, 128], "level": 0, "parent": null, "vector": [2, 0, 0.3214, 0.037, 0, 0.66, 0.4828, 334, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "set_clean", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def set_clean(using=None):\n \"\"\"\n Resets a dirty flag for the current thread and code streak. This can be used\n to decide in a managed block of code to decide whether a commit or rollback\n should happen.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L116_C4", "label": "expression", "type": "expression", "loc": [116, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "vector": [8, 1, 0.3122, 0.0132, 1, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Resets a dirty flag for the current thread and code streak. This can be used\n to decide in a managed block of code to decide whether a commit or rollback\n should happen.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L121_C4", "label": "if", "type": "if", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "vector": [4, 1, 0.3214, 0.0053, 1, 0.6, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L122_C8", "label": "using =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L121_C4", "vector": [14, 2, 0.3228, 0.0026, 2, 0.42, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L123_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "vector": [14, 1, 0.3254, 0.0026, 1, 0.6, 0.5, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L124_C4", "label": "if", "type": "if", "loc": [124, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "vector": [4, 1, 0.332, 0.0106, 1, 0.6, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in dirty and using in dirty[thread_ident]:\n dirty[thread_ident][using] = False\n else:\n raise TransactionManagementError(\"This code isn't under transaction management\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L125_C8", "label": "assign", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L124_C4", "vector": [14, 2, 0.3307, 0.0026, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " dirty[thread_ident][using] = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L128_C4", "label": "clean_savepoints()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "vector": [8, 1, 0.3386, 0.0026, 1, 0.6, 1.0, 343, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clean_savepoints", "arg_names": [], "import_names": [], "rhs_call_name": "clean_savepoints", "annotation": ""}, "snippet": " clean_savepoints(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "label": "clean_savepoints", "type": "function", "loc": [130, 135], "level": 0, "parent": null, "vector": [2, 0, 0.3505, 0.0159, 0, 0.66, 0.5172, 343, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clean_savepoints", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def clean_savepoints(using=None):\n if using is None:\n using = DEFAULT_DB_ALIAS\n thread_ident = thread.get_ident()\n if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:\n del savepoint_state[thread_ident][using]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L131_C4", "label": "if", "type": "if", "loc": [131, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "vector": [4, 1, 0.3479, 0.0053, 1, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L132_C8", "label": "using =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L131_C4", "vector": [14, 2, 0.3492, 0.0026, 2, 0.83, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L133_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "vector": [14, 1, 0.3519, 0.0026, 1, 0.81, 0.5, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L134_C4", "label": "if", "type": "if", "loc": [134, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "vector": [4, 1, 0.3558, 0.0053, 1, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:\n del savepoint_state[thread_ident][using]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "label": "is_managed", "type": "function", "loc": [137, 147], "level": 0, "parent": null, "vector": [2, 0, 0.3757, 0.0291, 0, 0.66, 0.5517, 849, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_managed", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def is_managed(using=None):\n \"\"\"\n Checks whether the transaction manager is in manual or in auto state.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n thread_ident = thread.get_ident()\n if thread_ident in state and using in state[thread_ident]:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L138_C4", "label": "expression", "type": "expression", "loc": [138, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "vector": [8, 1, 0.3677, 0.0079, 1, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Checks whether the transaction manager is in manual or in auto state.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L141_C4", "label": "if", "type": "if", "loc": [141, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "vector": [4, 1, 0.3743, 0.0053, 1, 0.21, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L142_C8", "label": "using =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L141_C4", "vector": [14, 2, 0.3757, 0.0026, 2, 0.19, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L143_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [143, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "vector": [14, 1, 0.3783, 0.0026, 1, 0.21, 0.5, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L144_C4", "label": "if", "type": "if", "loc": [144, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "vector": [4, 1, 0.3836, 0.0079, 1, 0.21, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in state and using in state[thread_ident]:\n if state[thread_ident][using]:\n return state[thread_ident][using][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L145_C8", "label": "if", "type": "if", "loc": [145, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L144_C4", "vector": [4, 2, 0.3849, 0.0053, 2, 0.26, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if state[thread_ident][using]:\n return state[thread_ident][using][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L146_C12", "label": "return", "type": "return", "loc": [146, 146], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L145_C8", "vector": [13, 3, 0.3862, 0.0026, 3, 0.81, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return state[thread_ident][using][-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L147_C4", "label": "return", "type": "return", "loc": [147, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "vector": [13, 1, 0.3889, 0.0026, 1, 0.21, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return settings.TRANSACTIONS_MANAGED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "label": "managed", "type": "function", "loc": [149, 167], "level": 0, "parent": null, "vector": [2, 0, 0.418, 0.0503, 0, 0.66, 0.5862, 503, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "managed", "arg_names": ["flag", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def managed(flag=True, using=None):\n \"\"\"\n Puts the transaction manager into a manual state: managed transactions have\n to be committed explicitly by the user. If you switch off transaction\n management and there is a pending commit/rollback, the data will be\n commited.\n \"\"\"\n if using is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L150_C4", "label": "expression", "type": "expression", "loc": [150, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [8, 1, 0.4034, 0.0159, 1, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Puts the transaction manager into a manual state: managed transactions have\n to be committed explicitly by the user. If you switch off transaction\n management and there is a pending commit/rollback, the data will be\n commited.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L156_C4", "label": "if", "type": "if", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [4, 1, 0.414, 0.0053, 1, 0.33, 0.2, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L157_C8", "label": "using =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L156_C4", "vector": [14, 2, 0.4153, 0.0026, 2, 0.41, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L158_C4", "label": "connection =", "type": "assigned_variable", "loc": [158, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [14, 1, 0.418, 0.0026, 1, 0.33, 0.4, 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_99033:Assign_L159_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [159, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [14, 1, 0.4206, 0.0026, 1, 0.33, 0.6, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L160_C4", "label": "top = get()", "type": "assigned_variable", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [14, 1, 0.4233, 0.0026, 1, 0.33, 0.8, 208, 3, 2, 0, 0, 607, 10, 2], "semantic": {"name": "top", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " top = state.get(thread_ident, {}).get(using, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4", "label": "if", "type": "if", "loc": [161, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "vector": [4, 1, 0.4339, 0.0185, 1, 0.33, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if top:\n top[-1] = flag\n if not flag and is_dirty(using=using):\n connection._commit()\n set_clean(using=using)\n else:\n raise TransactionManagementError(\"This code isn't under transaction management\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L162_C8", "label": "assign", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4", "vector": [14, 2, 0.4286, 0.0026, 2, 0.71, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " top[-1] = flag"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8", "label": "if", "type": "if", "loc": [163, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4", "vector": [4, 2, 0.4339, 0.0079, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not flag and is_dirty(using=using):\n connection._commit()\n set_clean(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L164_C12", "label": "_commit()", "type": "expression", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8", "vector": [8, 3, 0.4339, 0.0026, 3, 0.48, 0.0, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_commit", "annotation": ""}, "snippet": " connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L165_C12", "label": "set_clean()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8", "vector": [8, 3, 0.4365, 0.0026, 3, 0.48, 1.0, 334, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_clean", "arg_names": [], "import_names": [], "rhs_call_name": "set_clean", "annotation": ""}, "snippet": " set_clean(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "label": "commit_unless_managed", "type": "function", "loc": [169, 180], "level": 0, "parent": null, "vector": [2, 0, 0.4616, 0.0317, 0, 0.66, 0.6207, 431, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "commit_unless_managed", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def commit_unless_managed(using=None):\n \"\"\"\n Commits changes if the system is not in managed transaction mode.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]\n if not is_managed(using=using):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L170_C4", "label": "expression", "type": "expression", "loc": [170, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "vector": [8, 1, 0.4524, 0.0079, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Commits changes if the system is not in managed transaction mode.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L173_C4", "label": "if", "type": "if", "loc": [173, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "vector": [4, 1, 0.459, 0.0053, 1, 0.81, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L174_C8", "label": "using =", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L173_C4", "vector": [14, 2, 0.4603, 0.0026, 2, 0.58, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L175_C4", "label": "connection =", "type": "assigned_variable", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "vector": [14, 1, 0.463, 0.0026, 1, 0.81, 0.6667, 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_99033:If_L176_C4", "label": "if", "type": "if", "loc": [176, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "vector": [4, 1, 0.4709, 0.0132, 1, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_managed(using=using):\n connection._commit()\n clean_savepoints(using=using)\n else:\n set_dirty(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L177_C8", "label": "_commit()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "vector": [8, 2, 0.4683, 0.0026, 2, 0.8, 0.0, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_commit", "annotation": ""}, "snippet": " connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L178_C8", "label": "clean_savepoints()", "type": "expression", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "vector": [8, 2, 0.4709, 0.0026, 2, 0.8, 0.5, 343, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clean_savepoints", "arg_names": [], "import_names": [], "rhs_call_name": "clean_savepoints", "annotation": ""}, "snippet": " clean_savepoints(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L180_C8", "label": "set_dirty()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "vector": [8, 2, 0.4762, 0.0026, 2, 0.8, 1.0, 47, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_dirty", "arg_names": [], "import_names": [], "rhs_call_name": "set_dirty", "annotation": ""}, "snippet": " set_dirty(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "label": "rollback_unless_managed", "type": "function", "loc": [182, 192], "level": 0, "parent": null, "vector": [2, 0, 0.4947, 0.0291, 0, 0.66, 0.6552, 419, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "rollback_unless_managed", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rollback_unless_managed(using=None):\n \"\"\"\n Rolls back changes if the system is not in managed transaction mode.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]\n if not is_managed(using=using):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L183_C4", "label": "expression", "type": "expression", "loc": [183, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "vector": [8, 1, 0.4868, 0.0079, 1, 0.8, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Rolls back changes if the system is not in managed transaction mode.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L186_C4", "label": "if", "type": "if", "loc": [186, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "vector": [4, 1, 0.4934, 0.0053, 1, 0.8, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L187_C8", "label": "using =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L186_C4", "vector": [14, 2, 0.4947, 0.0026, 2, 0.85, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L188_C4", "label": "connection =", "type": "assigned_variable", "loc": [188, 188], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "vector": [14, 1, 0.4974, 0.0026, 1, 0.8, 0.6667, 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_99033:If_L189_C4", "label": "if", "type": "if", "loc": [189, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "vector": [4, 1, 0.504, 0.0106, 1, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not is_managed(using=using):\n connection._rollback()\n else:\n set_dirty(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L190_C8", "label": "_rollback()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L189_C4", "vector": [8, 2, 0.5026, 0.0026, 2, 0.98, 0.0, 47, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "_rollback", "annotation": ""}, "snippet": " connection._rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L192_C8", "label": "set_dirty()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L189_C4", "vector": [8, 2, 0.5079, 0.0026, 2, 0.98, 1.0, 47, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_dirty", "arg_names": [], "import_names": [], "rhs_call_name": "set_dirty", "annotation": ""}, "snippet": " set_dirty(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "label": "commit", "type": "function", "loc": [194, 202], "level": 0, "parent": null, "vector": [2, 0, 0.5238, 0.0238, 0, 0.66, 0.6897, 281, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "commit", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def commit(using=None):\n \"\"\"\n Does the commit itself and resets the dirty flag.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]\n connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L195_C4", "label": "expression", "type": "expression", "loc": [195, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "vector": [8, 1, 0.5185, 0.0079, 1, 0.89, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Does the commit itself and resets the dirty flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L198_C4", "label": "if", "type": "if", "loc": [198, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "vector": [4, 1, 0.5251, 0.0053, 1, 0.89, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L199_C8", "label": "using =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L198_C4", "vector": [14, 2, 0.5265, 0.0026, 2, 0.32, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L200_C4", "label": "connection =", "type": "assigned_variable", "loc": [200, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "vector": [14, 1, 0.5291, 0.0026, 1, 0.89, 0.5, 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_99033:Expr_L201_C4", "label": "_commit()", "type": "expression", "loc": [201, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "vector": [8, 1, 0.5317, 0.0026, 1, 0.89, 0.75, 361, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_commit", "annotation": ""}, "snippet": " connection._commit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L202_C4", "label": "set_clean()", "type": "expression", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "vector": [8, 1, 0.5344, 0.0026, 1, 0.89, 1.0, 334, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_clean", "arg_names": [], "import_names": [], "rhs_call_name": "set_clean", "annotation": ""}, "snippet": " set_clean(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "label": "rollback", "type": "function", "loc": [204, 212], "level": 0, "parent": null, "vector": [2, 0, 0.5503, 0.0238, 0, 0.66, 0.7241, 484, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "rollback", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def rollback(using=None):\n \"\"\"\n This function does the rollback itself and resets the dirty flag.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]\n connection._rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L205_C4", "label": "expression", "type": "expression", "loc": [205, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "vector": [8, 1, 0.545, 0.0079, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This function does the rollback itself and resets the dirty flag.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L208_C4", "label": "if", "type": "if", "loc": [208, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "vector": [4, 1, 0.5516, 0.0053, 1, 0.25, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L209_C8", "label": "using =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L208_C4", "vector": [14, 2, 0.5529, 0.0026, 2, 0.54, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L210_C4", "label": "connection =", "type": "assigned_variable", "loc": [210, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "vector": [14, 1, 0.5556, 0.0026, 1, 0.25, 0.5, 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_99033:Expr_L211_C4", "label": "_rollback()", "type": "expression", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "vector": [8, 1, 0.5582, 0.0026, 1, 0.25, 0.75, 47, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "_rollback", "annotation": ""}, "snippet": " connection._rollback()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L212_C4", "label": "set_clean()", "type": "expression", "loc": [212, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "vector": [8, 1, 0.5608, 0.0026, 1, 0.25, 1.0, 334, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_clean", "arg_names": [], "import_names": [], "rhs_call_name": "set_clean", "annotation": ""}, "snippet": " set_clean(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "label": "savepoint", "type": "function", "loc": [214, 232], "level": 0, "parent": null, "vector": [2, 0, 0.5899, 0.0503, 0, 0.66, 0.7586, 525, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "savepoint", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def savepoint(using=None):\n \"\"\"\n Creates a savepoint (if supported and required by the backend) inside the\n current transaction. Returns an identifier for the savepoint that will be\n used for the subsequent rollback or commit.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L215_C4", "label": "expression", "type": "expression", "loc": [215, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [8, 1, 0.5741, 0.0132, 1, 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 a savepoint (if supported and required by the backend) inside the\n current transaction. Returns an identifier for the savepoint that will be\n used for the subsequent rollback or commit.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L220_C4", "label": "if", "type": "if", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [4, 1, 0.5833, 0.0053, 1, 0.66, 0.125, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L221_C8", "label": "using =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L220_C4", "vector": [14, 2, 0.5847, 0.0026, 2, 0.48, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L222_C4", "label": "connection =", "type": "assigned_variable", "loc": [222, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [14, 1, 0.5873, 0.0026, 1, 0.66, 0.25, 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_99033:Assign_L223_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [14, 1, 0.5899, 0.0026, 1, 0.66, 0.375, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "label": "if", "type": "if", "loc": [224, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [4, 1, 0.5979, 0.0132, 1, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:\n savepoint_state[thread_ident][using].append(None)\n else:\n savepoint_state.setdefault(thread_ident, {})\n savepoint_state[thread_ident][using] = [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L225_C8", "label": "append()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "vector": [8, 2, 0.5952, 0.0026, 2, 0.68, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " savepoint_state[thread_ident][using].append(None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L227_C8", "label": "setdefault()", "type": "expression", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "vector": [8, 2, 0.6005, 0.0026, 2, 0.68, 0.5, 262, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setdefault", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " savepoint_state.setdefault(thread_ident, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L228_C8", "label": "assign", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "vector": [14, 2, 0.6032, 0.0026, 2, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " savepoint_state[thread_ident][using] = [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L229_C4", "label": "tid = replace()", "type": "assigned_variable", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [14, 1, 0.6058, 0.0026, 1, 0.66, 0.625, 810, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "tid", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " tid = str(thread_ident).replace('-', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L230_C4", "label": "sid =", "type": "assigned_variable", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [14, 1, 0.6085, 0.0026, 1, 0.66, 0.75, 440, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sid = \"s%s_x%d\" % (tid, len(savepoint_state[thread_ident][using]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L231_C4", "label": "_savepoint()", "type": "expression", "loc": [231, 231], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [8, 1, 0.6111, 0.0026, 1, 0.66, 0.875, 801, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_savepoint", "arg_names": [], "import_names": [], "rhs_call_name": "_savepoint", "annotation": ""}, "snippet": " connection._savepoint(sid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L232_C4", "label": "return", "type": "return", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "vector": [13, 1, 0.6138, 0.0026, 1, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return sid"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "label": "savepoint_rollback", "type": "function", "loc": [234, 244], "level": 0, "parent": null, "vector": [2, 0, 0.6323, 0.0291, 0, 0.66, 0.7931, 417, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "savepoint_rollback", "arg_names": ["sid", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def savepoint_rollback(sid, using=None):\n \"\"\"\n Rolls back the most recent savepoint (if one exists). Does nothing if\n savepoints are not supported.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L235_C4", "label": "expression", "type": "expression", "loc": [235, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "vector": [8, 1, 0.6257, 0.0106, 1, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Rolls back the most recent savepoint (if one exists). Does nothing if\n savepoints are not supported.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L239_C4", "label": "if", "type": "if", "loc": [239, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "vector": [4, 1, 0.6336, 0.0053, 1, 0.31, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L240_C8", "label": "using =", "type": "assigned_variable", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L239_C4", "vector": [14, 2, 0.6349, 0.0026, 2, 0.5, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L241_C4", "label": "connection =", "type": "assigned_variable", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "vector": [14, 1, 0.6376, 0.0026, 1, 0.31, 0.5, 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_99033:Assign_L242_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "vector": [14, 1, 0.6402, 0.0026, 1, 0.31, 0.75, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L243_C4", "label": "if", "type": "if", "loc": [243, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "vector": [4, 1, 0.6442, 0.0053, 1, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:\n connection._savepoint_rollback(sid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L244_C8", "label": "_savepoint_rollback()", "type": "expression", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L243_C4", "vector": [8, 2, 0.6455, 0.0026, 2, 0.73, 0.0, 508, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_savepoint_rollback", "arg_names": [], "import_names": [], "rhs_call_name": "_savepoint_rollback", "annotation": ""}, "snippet": " connection._savepoint_rollback(sid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "label": "savepoint_commit", "type": "function", "loc": [246, 256], "level": 0, "parent": null, "vector": [2, 0, 0.664, 0.0291, 0, 0.66, 0.8276, 492, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "savepoint_commit", "arg_names": ["sid", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def savepoint_commit(sid, using=None):\n \"\"\"\n Commits the most recent savepoint (if one exists). Does nothing if\n savepoints are not supported.\n \"\"\"\n if using is None:\n using = DEFAULT_DB_ALIAS\n connection = connections[using]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L247_C4", "label": "expression", "type": "expression", "loc": [247, 250], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "vector": [8, 1, 0.6574, 0.0106, 1, 0.96, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Commits the most recent savepoint (if one exists). Does nothing if\n savepoints are not supported.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L251_C4", "label": "if", "type": "if", "loc": [251, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "vector": [4, 1, 0.6653, 0.0053, 1, 0.96, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L252_C8", "label": "using =", "type": "assigned_variable", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L251_C4", "vector": [14, 2, 0.6667, 0.0026, 2, 0.56, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L253_C4", "label": "connection =", "type": "assigned_variable", "loc": [253, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "vector": [14, 1, 0.6693, 0.0026, 1, 0.96, 0.5, 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_99033:Assign_L254_C4", "label": "thread_ident = get_ident()", "type": "assigned_variable", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "vector": [14, 1, 0.672, 0.0026, 1, 0.96, 0.75, 924, 3, 0, 0, 0, 674, 10, 1], "semantic": {"name": "thread_ident", "arg_names": [], "import_names": [], "rhs_call_name": "get_ident", "annotation": ""}, "snippet": " thread_ident = thread.get_ident()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L255_C4", "label": "if", "type": "if", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "vector": [4, 1, 0.6759, 0.0053, 1, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if thread_ident in savepoint_state and using in savepoint_state[thread_ident]:\n connection._savepoint_commit(sid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L256_C8", "label": "_savepoint_commit()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L255_C4", "vector": [8, 2, 0.6772, 0.0026, 2, 0.23, 0.0, 735, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_savepoint_commit", "arg_names": [], "import_names": [], "rhs_call_name": "_savepoint_commit", "annotation": ""}, "snippet": " connection._savepoint_commit(sid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "label": "Transaction", "type": "class", "loc": [262, 298], "level": 0, "parent": null, "vector": [3, 0, 0.7407, 0.0979, 0, 0.66, 0.8621, 893, 0, 5, 0, 0, 186, 0, 8], "semantic": {"name": "Transaction", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Transaction(object):\n \"\"\"\n Acts as either a decorator, or a context manager. If it's a decorator it\n takes a function and returns a wrapped function. If it's a contextmanager\n it's used with the ``with`` statement. In either event entering/exiting\n are called before and after, respectively, the function/block is executed.\n\n autocommit, commit_on_success, and commit_manually contain the"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L263_C4", "label": "expression", "type": "expression", "loc": [263, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "vector": [8, 1, 0.7063, 0.0238, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Acts as either a decorator, or a context manager. If it's a decorator it\n takes a function and returns a wrapped function. If it's a contextmanager\n it's used with the ``with`` statement. In either event entering/exiting\n are called before and after, respectively, the function/block is executed.\n\n autocommit, commit_on_success, and commit_manually contain the\n implementations of entering and exiting."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "label": "__init__", "type": "function", "loc": [272, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "vector": [2, 1, 0.7235, 0.0106, 1, 0.62, 0.25, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "entering", "exiting", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, entering, exiting, using):\n self.entering = entering\n self.exiting = exiting\n self.using = using"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L273_C8", "label": "self.entering =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "vector": [14, 2, 0.7222, 0.0026, 2, 0.73, 0.0, 786, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.entering", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.entering = entering"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L274_C8", "label": "self.exiting =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "vector": [14, 2, 0.7249, 0.0026, 2, 0.73, 0.5, 925, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.exiting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exiting = exiting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L275_C8", "label": "self.using =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "vector": [14, 2, 0.7275, 0.0026, 2, 0.73, 1.0, 734, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.using = using"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L277_C4", "label": "__enter__", "type": "function", "loc": [277, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "vector": [2, 1, 0.7341, 0.0053, 1, 0.62, 0.5, 230, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__enter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __enter__(self):\n self.entering(self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L278_C8", "label": "entering()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L277_C4", "vector": [8, 2, 0.7354, 0.0026, 2, 0.78, 0.0, 271, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "entering", "arg_names": [], "import_names": [], "rhs_call_name": "entering", "annotation": ""}, "snippet": " self.entering(self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L280_C4", "label": "__exit__", "type": "function", "loc": [280, 281], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "vector": [2, 1, 0.7421, 0.0053, 1, 0.62, 0.75, 12, 0, 4, 0, 0, 0, 0, 1], "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.exiting(exc_value, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L281_C8", "label": "exiting()", "type": "expression", "loc": [281, 281], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L280_C4", "vector": [8, 2, 0.7434, 0.0026, 2, 0.91, 0.0, 399, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "exiting", "arg_names": [], "import_names": [], "rhs_call_name": "exiting", "annotation": ""}, "snippet": " self.exiting(exc_value, self.using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4", "label": "__call__", "type": "function", "loc": [283, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "vector": [2, 1, 0.7685, 0.0423, 1, 0.62, 1.0, 319, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "__call__", "arg_names": ["self", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, func):\n @wraps(func)\n def inner(*args, **kwargs):\n # Once we drop support for Python 2.4 this block should become:\n # with self:\n # func(*args, **kwargs)\n self.__enter__()\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8", "label": "inner", "type": "function", "loc": [285, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4", "vector": [2, 2, 0.7698, 0.0344, 2, 0.45, 0.0, 763, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "inner", "arg_names": ["args", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def inner(*args, **kwargs):\n # Once we drop support for Python 2.4 this block should become:\n # with self:\n # func(*args, **kwargs)\n self.__enter__()\n try:\n res = func(*args, **kwargs)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L289_C12", "label": "__enter__()", "type": "expression", "loc": [289, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8", "vector": [8, 3, 0.7646, 0.0026, 3, 0.25, 0.0, 230, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "__enter__", "arg_names": [], "import_names": [], "rhs_call_name": "__enter__", "annotation": ""}, "snippet": " self.__enter__()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "label": "try", "type": "try", "loc": [290, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8", "vector": [7, 3, 0.7765, 0.0212, 3, 0.25, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n res = func(*args, **kwargs)\n except:\n self.__exit__(*sys.exc_info())\n raise\n else:\n self.__exit__(None, None, None)\n return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L291_C16", "label": "res = func()", "type": "assigned_variable", "loc": [291, 291], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "vector": [14, 4, 0.7698, 0.0026, 4, 0.54, 0.0, 413, 3, 2, 0, 0, 856, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "func", "annotation": ""}, "snippet": " res = func(*args, **kwargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L293_C16", "label": "__exit__()", "type": "expression", "loc": [293, 293], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "vector": [8, 4, 0.7751, 0.0026, 4, 0.54, 0.0, 12, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__exit__", "arg_names": [], "import_names": [], "rhs_call_name": "__exit__", "annotation": ""}, "snippet": " self.__exit__(*sys.exc_info())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L296_C16", "label": "__exit__()", "type": "expression", "loc": [296, 296], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "vector": [8, 4, 0.7831, 0.0026, 4, 0.54, 0.5, 12, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__exit__", "arg_names": [], "import_names": [], "rhs_call_name": "__exit__", "annotation": ""}, "snippet": " self.__exit__(None, None, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L297_C16", "label": "return", "type": "return", "loc": [297, 297], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "vector": [13, 4, 0.7857, 0.0026, 4, 0.54, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L298_C8", "label": "return", "type": "return", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4", "vector": [13, 2, 0.7884, 0.0026, 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 inner"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "label": "_transaction_func", "type": "function", "loc": [300, 318], "level": 0, "parent": null, "vector": [2, 0, 0.8175, 0.0503, 0, 0.66, 0.8966, 678, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "_transaction_func", "arg_names": ["entering", "exiting", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _transaction_func(entering, exiting, using):\n \"\"\"\n Takes 3 things, an entering function (what to do to start this block of\n transaction management), an exiting function (what to do to end it, on both\n success and failure, and using which can be: None, indiciating using is\n DEFAULT_DB_ALIAS, a callable, indicating that using is DEFAULT_DB_ALIAS and\n to return the function already wrapped.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L301_C4", "label": "expression", "type": "expression", "loc": [301, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "vector": [8, 1, 0.8082, 0.0265, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Takes 3 things, an entering function (what to do to start this block of\n transaction management), an exiting function (what to do to end it, on both\n success and failure, and using which can be: None, indiciating using is\n DEFAULT_DB_ALIAS, a callable, indicating that using is DEFAULT_DB_ALIAS and\n to return the function already wrapped.\n\n Returns either a Transaction objects, which is both a decorator and a"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L314_C4", "label": "if", "type": "if", "loc": [314, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "vector": [4, 1, 0.832, 0.0053, 1, 0.36, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if using is None:\n using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L315_C8", "label": "using =", "type": "assigned_variable", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L314_C4", "vector": [14, 2, 0.8333, 0.0026, 2, 0.2, 0.0, 699, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "using", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " using = DEFAULT_DB_ALIAS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L316_C4", "label": "if", "type": "if", "loc": [316, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "vector": [4, 1, 0.8373, 0.0053, 1, 0.36, 0.6667, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if callable(using):\n return Transaction(entering, exiting, DEFAULT_DB_ALIAS)(using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L317_C8", "label": "return", "type": "return", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L316_C4", "vector": [13, 2, 0.8386, 0.0026, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Transaction(entering, exiting, DEFAULT_DB_ALIAS)(using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L318_C4", "label": "return", "type": "return", "loc": [318, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "vector": [13, 1, 0.8413, 0.0026, 1, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Transaction(entering, exiting, using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "label": "autocommit", "type": "function", "loc": [321, 334], "level": 0, "parent": null, "vector": [2, 0, 0.8664, 0.037, 0, 0.66, 0.931, 615, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "autocommit", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def autocommit(using=None):\n \"\"\"\n Decorator that activates commit on save. This is Django's default behavior;\n this decorator is useful if you globally activated transaction management in\n your settings file and want the default behavior in some view functions.\n \"\"\"\n def entering(using):\n enter_transaction_management(managed=False, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L322_C4", "label": "expression", "type": "expression", "loc": [322, 326], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "vector": [8, 1, 0.8571, 0.0132, 1, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Decorator that activates commit on save. This is Django's default behavior;\n this decorator is useful if you globally activated transaction management in\n your settings file and want the default behavior in some view functions.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4", "label": "entering", "type": "function", "loc": [327, 329], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "vector": [2, 1, 0.8677, 0.0079, 1, 0.55, 0.3333, 271, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "entering", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def entering(using):\n enter_transaction_management(managed=False, using=using)\n managed(False, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L328_C8", "label": "enter_transaction_management()", "type": "expression", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4", "vector": [8, 2, 0.8677, 0.0026, 2, 0.35, 0.0, 871, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "enter_transaction_management", "arg_names": [], "import_names": [], "rhs_call_name": "enter_transaction_management", "annotation": ""}, "snippet": " enter_transaction_management(managed=False, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L329_C8", "label": "managed()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4", "vector": [8, 2, 0.8704, 0.0026, 2, 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": " managed(False, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L331_C4", "label": "exiting", "type": "function", "loc": [331, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "vector": [2, 1, 0.877, 0.0053, 1, 0.55, 0.6667, 399, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "exiting", "arg_names": ["exc_value", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exiting(exc_value, using):\n leave_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L332_C8", "label": "leave_transaction_management()", "type": "expression", "loc": [332, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L331_C4", "vector": [8, 2, 0.8783, 0.0026, 2, 0.96, 0.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": " leave_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L334_C4", "label": "return", "type": "return", "loc": [334, 334], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "vector": [13, 1, 0.8836, 0.0026, 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 _transaction_func(entering, exiting, using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "label": "commit_on_success", "type": "function", "loc": [336, 362], "level": 0, "parent": null, "vector": [2, 0, 0.9233, 0.0714, 0, 0.66, 0.9655, 731, 0, 1, 1, 0, 0, 0, 9], "semantic": {"name": "commit_on_success", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def commit_on_success(using=None):\n \"\"\"\n This decorator activates commit on response. This way, if the view function\n runs successfully, a commit is made; if the viewfunc produces an exception,\n a rollback is made. This is one of the most common ways to do transaction\n control in Web apps.\n \"\"\"\n def entering(using):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L337_C4", "label": "expression", "type": "expression", "loc": [337, 342], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "vector": [8, 1, 0.8981, 0.0159, 1, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n This decorator activates commit on response. This way, if the view function\n runs successfully, a commit is made; if the viewfunc produces an exception,\n a rollback is made. This is one of the most common ways to do transaction\n control in Web apps.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4", "label": "entering", "type": "function", "loc": [343, 345], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "vector": [2, 1, 0.9101, 0.0079, 1, 0.99, 0.3333, 271, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "entering", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def entering(using):\n enter_transaction_management(using=using)\n managed(True, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L344_C8", "label": "enter_transaction_management()", "type": "expression", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4", "vector": [8, 2, 0.9101, 0.0026, 2, 0.18, 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": " enter_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L345_C8", "label": "managed()", "type": "expression", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4", "vector": [8, 2, 0.9127, 0.0026, 2, 0.18, 1.0, 503, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "managed", "annotation": ""}, "snippet": " managed(True, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L347_C4", "label": "exiting", "type": "function", "loc": [347, 360], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "vector": [2, 1, 0.9352, 0.037, 1, 0.99, 0.6667, 399, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "exiting", "arg_names": ["exc_value", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exiting(exc_value, using):\n try:\n if exc_value is not None:\n if is_dirty(using=using):\n rollback(using=using)\n else:\n if is_dirty(using=using):\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8", "label": "try", "type": "try", "loc": [348, 360], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L347_C4", "vector": [7, 2, 0.9365, 0.0344, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if exc_value is not None:\n if is_dirty(using=using):\n rollback(using=using)\n else:\n if is_dirty(using=using):\n try:\n commit(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12", "label": "if", "type": "if", "loc": [349, 358], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8", "vector": [4, 3, 0.9352, 0.0265, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_value is not None:\n if is_dirty(using=using):\n rollback(using=using)\n else:\n if is_dirty(using=using):\n try:\n commit(using=using)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L350_C16", "label": "if", "type": "if", "loc": [350, 351], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12", "vector": [4, 4, 0.9272, 0.0053, 4, 0.04, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_dirty(using=using):\n rollback(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L351_C20", "label": "rollback()", "type": "expression", "loc": [351, 351], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L350_C16", "vector": [8, 5, 0.9286, 0.0026, 5, 0.68, 0.0, 484, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback", "arg_names": [], "import_names": [], "rhs_call_name": "rollback", "annotation": ""}, "snippet": " rollback(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L353_C16", "label": "if", "type": "if", "loc": [353, 358], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12", "vector": [4, 4, 0.9405, 0.0159, 4, 0.04, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if is_dirty(using=using):\n try:\n commit(using=using)\n except:\n rollback(using=using)\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20", "label": "try", "type": "try", "loc": [354, 358], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L353_C16", "vector": [7, 5, 0.9418, 0.0132, 5, 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 commit(using=using)\n except:\n rollback(using=using)\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L355_C24", "label": "commit()", "type": "expression", "loc": [355, 355], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20", "vector": [8, 6, 0.9392, 0.0026, 6, 0.83, 0.0, 281, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "commit", "arg_names": [], "import_names": [], "rhs_call_name": "commit", "annotation": ""}, "snippet": " commit(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L357_C24", "label": "rollback()", "type": "expression", "loc": [357, 357], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20", "vector": [8, 6, 0.9444, 0.0026, 6, 0.83, 0.0, 484, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rollback", "arg_names": [], "import_names": [], "rhs_call_name": "rollback", "annotation": ""}, "snippet": " rollback(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L360_C12", "label": "leave_transaction_management()", "type": "expression", "loc": [360, 360], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8", "vector": [8, 3, 0.9524, 0.0026, 3, 0.37, 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": " leave_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L362_C4", "label": "return", "type": "return", "loc": [362, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "vector": [13, 1, 0.9577, 0.0026, 1, 0.99, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _transaction_func(entering, exiting, using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "label": "commit_manually", "type": "function", "loc": [364, 378], "level": 0, "parent": null, "vector": [2, 0, 0.9815, 0.0397, 0, 0.66, 1.0, 422, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "commit_manually", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def commit_manually(using=None):\n \"\"\"\n Decorator that activates manual transaction control. It just disables\n automatic transaction control and doesn't do any commit/rollback of its\n own -- it's up to the user to call the commit and rollback functions\n themselves.\n \"\"\"\n def entering(using):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L365_C4", "label": "expression", "type": "expression", "loc": [365, 370], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "vector": [8, 1, 0.9722, 0.0159, 1, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Decorator that activates manual transaction control. It just disables\n automatic transaction control and doesn't do any commit/rollback of its\n own -- it's up to the user to call the commit and rollback functions\n themselves.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4", "label": "entering", "type": "function", "loc": [371, 373], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "vector": [2, 1, 0.9841, 0.0079, 1, 0.86, 0.3333, 271, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "entering", "arg_names": ["using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def entering(using):\n enter_transaction_management(using=using)\n managed(True, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L372_C8", "label": "enter_transaction_management()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4", "vector": [8, 2, 0.9841, 0.0026, 2, 0.44, 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": " enter_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L373_C8", "label": "managed()", "type": "expression", "loc": [373, 373], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4", "vector": [8, 2, 0.9868, 0.0026, 2, 0.44, 1.0, 503, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "managed", "arg_names": [], "import_names": [], "rhs_call_name": "managed", "annotation": ""}, "snippet": " managed(True, using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L375_C4", "label": "exiting", "type": "function", "loc": [375, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "vector": [2, 1, 0.9934, 0.0053, 1, 0.86, 0.6667, 399, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "exiting", "arg_names": ["exc_value", "using"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exiting(exc_value, using):\n leave_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L376_C8", "label": "leave_transaction_management()", "type": "expression", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L375_C4", "vector": [8, 2, 0.9947, 0.0026, 2, 0.86, 0.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": " leave_transaction_management(using=using)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L378_C4", "label": "return", "type": "return", "loc": [378, 378], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "vector": [13, 1, 1.0, 0.0026, 1, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _transaction_func(entering, exiting, using)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Import_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Import_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:ImportFrom_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:ImportFrom_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L131_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L130_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L145_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L146_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L169_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L186_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L186_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L182_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L204_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L212_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L234_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L243_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L243_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L251_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L246_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:ClassDef_L262_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L291_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L293_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L296_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L290_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L297_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L283_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L314_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L314_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Assign_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L300_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L318_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L322_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L327_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L331_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L331_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L332_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L343_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L345_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L347_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L347_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L350_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L350_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L351_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L349_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L353_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:If_L353_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L355_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L354_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L357_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:Try_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L360_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L336_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L362_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L365_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L371_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L375_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L375_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Expr_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99033:FunctionDef_L364_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99033:Return_L378_C4"}] |
from django.db.backends.postgresql.introspection import DatabaseIntrospection as PostgresDatabaseIntrospection
class DatabaseIntrospection(PostgresDatabaseIntrospection):
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():
# row[0] and row[1] are single-item lists, so grab the single item.
relations[row[0][0] - 1] = (row[1][0] - 1, row[2])
return relations
| ajibawa-2023/Python-Code-Large/train/row_99034 | 9 | 21 | 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_99034:ImportFrom_L1_C0", "label": "from django.db.backends.postgresql.introspection import PostgresDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0476, 0, 0.66, 0.0, 789, 0, 1, 0, 0, 789, 0, 0], "semantic": {"name": "django.db.backends.postgresql.introspection", "arg_names": [], "import_names": ["PostgresDatabaseIntrospection"], "rhs_call_name": "", "annotation": ""}, "snippet": "from django.db.backends.postgresql.introspection import DatabaseIntrospection as PostgresDatabaseIntrospection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99034:ClassDef_L3_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [3, 21], "level": 0, "parent": null, "vector": [3, 0, 0.5714, 0.9048, 0, 0.66, 1.0, 77, 0, 1, 0, 0, 531, 0, 2], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(PostgresDatabaseIntrospection):\n\n 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(\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "label": "get_relations", "type": "function", "loc": [5, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:ClassDef_L3_C0", "vector": [2, 1, 0.619, 0.8095, 1, 0.21, 0.0, 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 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_99034:Expr_L6_C8", "label": "expression", "type": "expression", "loc": [6, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "vector": [8, 2, 0.3571, 0.1905, 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 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_99034:Expr_L10_C8", "label": "execute()", "type": "expression", "loc": [10, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "vector": [8, 2, 0.619, 0.3333, 2, 0.97, 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_99034:Assign_L17_C8", "label": "relations =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "vector": [14, 2, 0.8095, 0.0476, 2, 0.97, 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_99034:For_L18_C8", "label": "for row", "type": "for", "loc": [18, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "vector": [6, 2, 0.9048, 0.1429, 2, 0.97, 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[0] and row[1] are single-item lists, so grab the single item.\n relations[row[0][0] - 1] = (row[1][0] - 1, row[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99034:Assign_L20_C12", "label": "assign", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:For_L18_C8", "vector": [14, 3, 0.9524, 0.0476, 3, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations[row[0][0] - 1] = (row[1][0] - 1, row[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99034:Return_L21_C8", "label": "return", "type": "return", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "vector": [13, 2, 1.0, 0.0476, 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 relations"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99034:ClassDef_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:Expr_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:For_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:For_L18_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:Assign_L20_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99034:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99034:Return_L21_C8"}] |
from django.db.backends import BaseDatabaseIntrospection
from MySQLdb import ProgrammingError, OperationalError
from MySQLdb.constants import FIELD_TYPE
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseIntrospection):
data_types_reverse = {
FIELD_TYPE.BLOB: 'TextField',
FIELD_TYPE.CHAR: 'CharField',
FIELD_TYPE.DECIMAL: 'DecimalField',
FIELD_TYPE.NEWDECIMAL: 'DecimalField',
FIELD_TYPE.DATE: 'DateField',
FIELD_TYPE.DATETIME: 'DateTimeField',
FIELD_TYPE.DOUBLE: 'FloatField',
FIELD_TYPE.FLOAT: 'FloatField',
FIELD_TYPE.INT24: 'IntegerField',
FIELD_TYPE.LONG: 'IntegerField',
FIELD_TYPE.LONGLONG: 'BigIntegerField',
FIELD_TYPE.SHORT: 'IntegerField',
FIELD_TYPE.STRING: 'CharField',
FIELD_TYPE.TIMESTAMP: 'DateTimeField',
FIELD_TYPE.TINY: 'IntegerField',
FIELD_TYPE.TINY_BLOB: 'TextField',
FIELD_TYPE.MEDIUM_BLOB: 'TextField',
FIELD_TYPE.LONG_BLOB: 'TextField',
FIELD_TYPE.VAR_STRING: 'CharField',
}
def get_table_list(self, cursor):
"Returns a list of table names in the current database."
cursor.execute("SHOW TABLES")
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 _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.
"""
my_field_dict = self._name_to_index(cursor, table_name)
constraints = []
relations = {}
try:
# This should work for MySQL 5.0.
cursor.execute("""
SELECT column_name, referenced_table_name, referenced_column_name
FROM information_schema.key_column_usage
WHERE table_name = %s
AND table_schema = DATABASE()
AND referenced_table_name IS NOT NULL
AND referenced_column_name IS NOT NULL""", [table_name])
constraints.extend(cursor.fetchall())
except (ProgrammingError, OperationalError):
# Fall back to "SHOW CREATE TABLE", for previous MySQL versions.
# Go through all constraints and save the equal matches.
cursor.execute("SHOW CREATE TABLE %s" % self.connection.ops.quote_name(table_name))
for row in cursor.fetchall():
pos = 0
while True:
match = foreign_key_re.search(row[1], pos)
if match == None:
break
pos = match.end()
constraints.append(match.groups())
for my_fieldname, other_table, other_field in constraints:
other_field_index = self._name_to_index(cursor, other_table)[other_field]
my_field_index = my_field_dict[my_fieldname]
relations[my_field_index] = (other_field_index, other_table)
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}
"""
cursor.execute("SHOW INDEX FROM %s" % self.connection.ops.quote_name(table_name))
indexes = {}
for row in cursor.fetchall():
indexes[row[4]] = {'primary_key': (row[2] == 'PRIMARY'), 'unique': not bool(row[1])}
return indexes
| ajibawa-2023/Python-Code-Large/train/row_99036 | 46 | 98 | 15 | ["cat_id", "level", "center", "span", "parent_depth", "parent_weight", "sibling_index", "name_hash", "rhs_type", "arg_count", "return_type", "is_async", "module_hash", "value_type", "calls_count"] | [{"id": "ajibawa-2023/Python-Code-Large/train/row_99036:ImportFrom_L1_C0", "label": "from django.db.backends import BaseDatabaseIntrospection", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0102, 0.0102, 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_99036:ImportFrom_L2_C0", "label": "from MySQLdb import ProgrammingError, OperationalError", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0204, 0.0102, 0, 0.66, 0.2, 838, 0, 2, 0, 0, 838, 0, 0], "semantic": {"name": "MySQLdb", "arg_names": [], "import_names": ["ProgrammingError", "OperationalError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from MySQLdb import ProgrammingError, OperationalError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:ImportFrom_L3_C0", "label": "from MySQLdb.constants import FIELD_TYPE", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0306, 0.0102, 0, 0.66, 0.4, 412, 0, 1, 0, 0, 412, 0, 0], "semantic": {"name": "MySQLdb.constants", "arg_names": [], "import_names": ["FIELD_TYPE"], "rhs_call_name": "", "annotation": ""}, "snippet": "from MySQLdb.constants import FIELD_TYPE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Import_L4_C0", "label": "re import re", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0408, 0.0102, 0, 0.66, 0.6, 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_99036:Assign_L6_C0", "label": "foreign_key_re = compile()", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.0612, 0.0102, 0, 0.66, 0.8, 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_99036:ClassDef_L8_C0", "label": "DatabaseIntrospection", "type": "class", "loc": [8, 97], "level": 0, "parent": null, "vector": [3, 0, 0.5357, 0.9184, 0, 0.66, 1.0, 77, 0, 5, 0, 0, 41, 0, 23], "semantic": {"name": "DatabaseIntrospection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DatabaseIntrospection(BaseDatabaseIntrospection):\n data_types_reverse = {\n FIELD_TYPE.BLOB: 'TextField',\n FIELD_TYPE.CHAR: 'CharField',\n FIELD_TYPE.DECIMAL: 'DecimalField',\n FIELD_TYPE.NEWDECIMAL: 'DecimalField',\n FIELD_TYPE.DATE: 'DateField',\n FIELD_TYPE.DATETIME: 'DateTimeField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L9_C4", "label": "data_types_reverse =", "type": "assigned_variable", "loc": [9, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [14, 1, 0.1939, 0.2143, 1, 0.69, 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 FIELD_TYPE.BLOB: 'TextField',\n FIELD_TYPE.CHAR: 'CharField',\n FIELD_TYPE.DECIMAL: 'DecimalField',\n FIELD_TYPE.NEWDECIMAL: 'DecimalField',\n FIELD_TYPE.DATE: 'DateField',\n FIELD_TYPE.DATETIME: 'DateTimeField',\n FIELD_TYPE.DOUBLE: 'FloatField',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "label": "get_table_list", "type": "function", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [2, 1, 0.3316, 0.0408, 1, 0.69, 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 cursor.execute(\"SHOW TABLES\")\n return [row[0] for row in cursor.fetchall()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L32_C8", "label": "expression", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "vector": [8, 2, 0.3265, 0.0102, 2, 0.3, 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_99036:Expr_L33_C8", "label": "execute()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "vector": [8, 2, 0.3367, 0.0102, 2, 0.3, 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(\"SHOW TABLES\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L34_C8", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "vector": [13, 2, 0.3469, 0.0102, 2, 0.3, 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_99036:FunctionDef_L36_C4", "label": "get_table_description", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [2, 1, 0.3827, 0.0408, 1, 0.69, 0.4, 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_99036:Expr_L37_C8", "label": "expression", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "vector": [8, 2, 0.3776, 0.0102, 2, 0.77, 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_99036:Expr_L38_C8", "label": "execute()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "vector": [8, 2, 0.3878, 0.0102, 2, 0.77, 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_99036:Return_L39_C8", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "vector": [13, 2, 0.398, 0.0102, 2, 0.77, 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_99036:FunctionDef_L41_C4", "label": "_name_to_index", "type": "function", "loc": [41, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [2, 1, 0.4439, 0.0612, 1, 0.69, 0.6, 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_99036:Expr_L42_C8", "label": "expression", "type": "expression", "loc": [42, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L41_C4", "vector": [8, 2, 0.4439, 0.0408, 2, 0.56, 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_99036:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L41_C4", "vector": [13, 2, 0.4694, 0.0102, 2, 0.56, 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_99036:FunctionDef_L48_C4", "label": "get_relations", "type": "function", "loc": [48, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [2, 1, 0.6735, 0.3776, 1, 0.69, 0.8, 814, 0, 3, 1, 0, 0, 0, 12], "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 my_field_dict = self._name_to_index(cursor, table_name)\n constraints = []\n relations = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L49_C8", "label": "expression", "type": "expression", "loc": [49, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [8, 2, 0.5153, 0.0408, 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 {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_99036:Assign_L53_C8", "label": "my_field_dict = _name_to_index()", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [14, 2, 0.5408, 0.0102, 2, 0.63, 0.1667, 716, 3, 2, 0, 0, 950, 10, 1], "semantic": {"name": "my_field_dict", "arg_names": [], "import_names": [], "rhs_call_name": "_name_to_index", "annotation": ""}, "snippet": " my_field_dict = self._name_to_index(cursor, table_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L54_C8", "label": "constraints =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [14, 2, 0.551, 0.0102, 2, 0.63, 0.3333, 394, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "constraints", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " constraints = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L55_C8", "label": "relations =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [14, 2, 0.5612, 0.0102, 2, 0.63, 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_99036:Try_L56_C8", "label": "try", "type": "try", "loc": [56, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [7, 2, 0.6786, 0.2245, 2, 0.63, 0.6667, 0, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n # This should work for MySQL 5.0.\n cursor.execute(\"\"\"\n SELECT column_name, referenced_table_name, referenced_column_name\n FROM information_schema.key_column_usage\n WHERE table_name = %s\n AND table_schema = DATABASE()\n AND referenced_table_name IS NOT NULL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L58_C12", "label": "execute()", "type": "expression", "loc": [58, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "vector": [8, 3, 0.6224, 0.0714, 3, 0.0, 0.0, 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 column_name, referenced_table_name, referenced_column_name\n FROM information_schema.key_column_usage\n WHERE table_name = %s\n AND table_schema = DATABASE()\n AND referenced_table_name IS NOT NULL\n AND referenced_column_name IS NOT NULL\"\"\", [table_name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L65_C12", "label": "extend()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "vector": [8, 3, 0.6633, 0.0102, 3, 0.0, 1.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " constraints.extend(cursor.fetchall())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L69_C12", "label": "execute()", "type": "expression", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "vector": [8, 3, 0.7041, 0.0102, 3, 0.0, 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(\"SHOW CREATE TABLE %s\" % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12", "label": "for row", "type": "for", "loc": [70, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "vector": [6, 3, 0.75, 0.0816, 3, 0.0, 1.0, 767, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n pos = 0\n while True:\n match = foreign_key_re.search(row[1], pos)\n if match == None:\n break\n pos = match.end()\n constraints.append(match.groups())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L71_C16", "label": "pos =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12", "vector": [14, 4, 0.7245, 0.0102, 4, 0.84, 0.0, 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_99036:While_L72_C16", "label": "while", "type": "while", "loc": [72, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12", "vector": [5, 4, 0.7602, 0.0612, 4, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while True:\n match = foreign_key_re.search(row[1], pos)\n if match == None:\n break\n pos = match.end()\n constraints.append(match.groups())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L73_C20", "label": "match = search()", "type": "assigned_variable", "loc": [73, 73], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "vector": [14, 5, 0.7449, 0.0102, 5, 0.75, 0.0, 36, 3, 2, 0, 0, 163, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " match = foreign_key_re.search(row[1], pos)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:If_L74_C20", "label": "if", "type": "if", "loc": [74, 75], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "vector": [4, 5, 0.7602, 0.0204, 5, 0.75, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match == None:\n break"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L76_C20", "label": "pos = end()", "type": "assigned_variable", "loc": [76, 76], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "vector": [14, 5, 0.7755, 0.0102, 5, 0.75, 0.6667, 627, 3, 0, 0, 0, 128, 10, 1], "semantic": {"name": "pos", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " pos = match.end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L77_C20", "label": "append()", "type": "expression", "loc": [77, 77], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "vector": [8, 5, 0.7857, 0.0102, 5, 0.75, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " constraints.append(match.groups())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "label": "for my_fieldname, other_table, other_field", "type": "for", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [6, 2, 0.8214, 0.0408, 2, 0.63, 0.8333, 914, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "my_fieldname, other_table, other_field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for my_fieldname, other_table, other_field in constraints:\n other_field_index = self._name_to_index(cursor, other_table)[other_field]\n my_field_index = my_field_dict[my_fieldname]\n relations[my_field_index] = (other_field_index, other_table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L80_C12", "label": "other_field_index =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "vector": [14, 3, 0.8163, 0.0102, 3, 0.58, 0.0, 771, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "other_field_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " other_field_index = self._name_to_index(cursor, other_table)[other_field]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L81_C12", "label": "my_field_index =", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "vector": [14, 3, 0.8265, 0.0102, 3, 0.58, 0.5, 540, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "my_field_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " my_field_index = my_field_dict[my_fieldname]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L82_C12", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "vector": [14, 3, 0.8367, 0.0102, 3, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " relations[my_field_index] = (other_field_index, other_table)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "vector": [13, 2, 0.8571, 0.0102, 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 relations"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "label": "get_indexes", "type": "function", "loc": [86, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "vector": [2, 1, 0.9337, 0.1224, 1, 0.69, 1.0, 808, 0, 3, 1, 0, 0, 0, 4], "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 cursor.execute(\"SHOW INDEX FROM %s\" % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L87_C8", "label": "expression", "type": "expression", "loc": [87, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "vector": [8, 2, 0.9133, 0.0612, 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 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_99036:Expr_L93_C8", "label": "execute()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "vector": [8, 2, 0.949, 0.0102, 2, 0.11, 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(\"SHOW INDEX FROM %s\" % self.connection.ops.quote_name(table_name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L94_C8", "label": "indexes =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "vector": [14, 2, 0.9592, 0.0102, 2, 0.11, 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_99036:For_L95_C8", "label": "for row", "type": "for", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "vector": [6, 2, 0.9745, 0.0204, 2, 0.11, 0.75, 767, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in cursor.fetchall():\n indexes[row[4]] = {'primary_key': (row[2] == 'PRIMARY'), 'unique': not bool(row[1])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L96_C12", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L95_C8", "vector": [14, 3, 0.9796, 0.0102, 3, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indexes[row[4]] = {'primary_key': (row[2] == 'PRIMARY'), 'unique': not bool(row[1])}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L97_C8", "label": "return", "type": "return", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "vector": [13, 2, 0.9898, 0.0102, 2, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return indexes"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:Try_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L70_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L73_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:If_L74_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L76_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:While_L72_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L77_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:For_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99036:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99036:Return_L97_C8"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.