sequence
stringlengths
1.37k
35.1k
docstring
stringlengths
17
102
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all_fix_names'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fixer_pkg'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'remove_prefix'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '20', '33', '37', '87']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'pkg'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '__import__'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16', '17', '18']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'fixer_pkg'}; {'id': '16', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '17', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '18', 'type': 'list', 'children': ['19'], 'value': '["*"]'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"*"'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'fixer_dir'}; {'id': '23', 'type': 'call', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'pkg'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '__file__'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'fix_names'}; {'id': '36', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '48']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'fixer_dir'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'if_statement', 'children': ['50', '63']}; {'id': '50', 'type': 'boolean_operator', 'children': ['51', '57'], 'value': 'and'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"fix_"'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'string', 'children': [], 'value': '".py"'}; {'id': '63', 'type': 'block', 'children': ['64', '75']}; {'id': '64', 'type': 'if_statement', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'remove_prefix'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '72', 'type': 'slice', 'children': ['73', '74']}; {'id': '73', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '74', 'type': 'colon', 'children': []}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'fix_names'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '83', 'type': 'slice', 'children': ['84', '85']}; {'id': '84', 'type': 'colon', 'children': []}; {'id': '85', 'type': 'unary_operator', 'children': ['86'], 'value': '-'}; {'id': '86', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'fix_names'}
Return a sorted list of all available fix names in the given package.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'check'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '8', '40']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'unsorted'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'iter'}; {'id': '10', 'type': 'generator_expression', 'children': ['11', '14', '25']}; {'id': '11', 'type': 'subscript', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '14', 'type': 'for_in_clause', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '24'], 'value': '-'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '25', 'type': 'if_clause', 'children': ['26']}; {'id': '26', 'type': 'not_operator', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'le'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '35']}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '+'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '40', 'type': 'block', 'children': ['41']}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'resort'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'unsorted'}
re-sort any items in self that are not sorted
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'df_all'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'phot'}; {'id': '6', 'type': 'block', 'children': ['7', '30']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'concat'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'list_comprehension', 'children': ['16', '22']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'to_df'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '22', 'type': 'for_in_clause', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'get_filenames'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'phot'}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'df'}
Subclasses may want to sort this
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'searchsorted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'N'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '18', '22', '31', '90']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'L'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'R'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '-'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'N'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'done'}; {'id': '21', 'type': 'False', 'children': []}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '30'], 'value': '//'}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '29'], 'value': '+'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'L'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'R'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '31', 'type': 'while_statement', 'children': ['32', '34']}; {'id': '32', 'type': 'not_operator', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'done'}; {'id': '34', 'type': 'block', 'children': ['35', '72', '81']}; {'id': '35', 'type': 'if_statement', 'children': ['36', '41', '48', '61']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '40'], 'value': '<'}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'L'}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '+'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '48', 'type': 'elif_clause', 'children': ['49', '54']}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '53'], 'value': '>'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'R'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '60'], 'value': '-'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '60', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '61', 'type': 'elif_clause', 'children': ['62', '67']}; {'id': '62', 'type': 'comparison_operator', 'children': ['63', '66'], 'value': '=='}; {'id': '63', 'type': 'subscript', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'done'}; {'id': '71', 'type': 'True', 'children': []}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '75', 'type': 'binary_operator', 'children': ['76', '80'], 'value': '//'}; {'id': '76', 'type': '()', 'children': ['77']}; {'id': '77', 'type': 'binary_operator', 'children': ['78', '79'], 'value': '+'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'L'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'R'}; {'id': '80', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '81', 'type': 'if_statement', 'children': ['82', '85']}; {'id': '82', 'type': 'comparison_operator', 'children': ['83', '84'], 'value': '>'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'L'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'R'}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'done'}; {'id': '89', 'type': 'True', 'children': []}; {'id': '90', 'type': 'return_statement', 'children': ['91']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'L'}
N is length of arr
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_fn_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fn_list'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '30']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'dt_list'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'get_dt_list'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fn_list'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'fn_list_sort'}; {'id': '16', 'type': 'list_comprehension', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '22']}; {'id': '19', 'type': 'tuple_pattern', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dt'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'dt_list'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'fn_list'}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'fn_list_sort'}
Sort input filename list by datetime
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'glob'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '25']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'file_glob'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'BASE_NAME'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '23', '24']}; {'id': '19', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '23', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '24', 'type': 'string', 'children': [], 'value': "'.*'"}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'file_glob'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'lambda', 'children': ['33', '35']}; {'id': '33', 'type': 'lambda_parameters', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'f'}
Returns a sorted glob of files belonging to a given problem
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'event'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'value_key'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '9', 'type': 'block', 'children': ['10', '30', '57', '84']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'LOG'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '18'], 'value': '%'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"RPCFunctions.event: interface_id = %s, address = %s, value_key = %s, value = %s"'}; {'id': '18', 'type': 'tuple', 'children': ['19', '20', '21', '26']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'value_key'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '49']}; {'id': '32', 'type': 'attribute', 'children': ['33', '48']}; {'id': '33', 'type': 'subscript', 'children': ['34', '47']}; {'id': '34', 'type': 'subscript', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'devices_all'}; {'id': '38', 'type': 'subscript', 'children': ['39', '45']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '45', 'type': 'unary_operator', 'children': ['46'], 'value': '-'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51', '56']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'value_key'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'eventcallback'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'eventcallback'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '71', '74', '81']}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'interface_id'}; {'id': '71', 'type': 'keyword_argument', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'address'}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'value_key'}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'value_key'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '80', 'type': 'argument_list', 'children': []}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '84', 'type': 'return_statement', 'children': ['85']}; {'id': '85', 'type': 'True', 'children': []}
If a device emits some sort event, we will handle it here.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_combine_regions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'all_regions'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ref_regions'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '28', '47', '51', '81', '90', '106']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'chrom_order'}; {'id': '10', 'type': 'dictionary', 'children': []}; {'id': '11', 'type': 'for_statement', 'children': ['12', '15', '19']}; {'id': '12', 'type': 'pattern_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'ref_regions'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '27']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'chrom_order'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'chrom'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '28', 'type': 'function_definition', 'children': ['29', '30', '32']}; {'id': '29', 'type': 'function_name', 'children': [], 'value': 'wchrom_key'}; {'id': '30', 'type': 'parameters', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '32', 'type': 'block', 'children': ['33', '40']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '39']}; {'id': '35', 'type': 'pattern_list', 'children': ['36', '37', '38']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'chrom'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'tuple', 'children': ['42', '45', '46']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'chrom_order'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'chrom'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'all_intervals'}; {'id': '50', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '51', 'type': 'for_statement', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'region_group'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'all_regions'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'for_statement', 'children': ['56', '57', '58']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'region_group'}; {'id': '58', 'type': 'block', 'children': ['59']}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'all_intervals'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'tuple', 'children': ['66', '69', '75']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'chrom'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'all_intervals'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'keyword_argument', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'wchrom_key'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'bed_lines'}; {'id': '93', 'type': 'list_comprehension', 'children': ['94', '100']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '%'}; {'id': '95', 'type': 'string', 'children': [], 'value': '"%s\\t%s\\t%s"'}; {'id': '96', 'type': 'tuple', 'children': ['97', '98', '99']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '100', 'type': 'for_in_clause', 'children': ['101', '105']}; {'id': '101', 'type': 'tuple_pattern', 'children': ['102', '103', '104']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'all_intervals'}; {'id': '106', 'type': 'return_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'pybedtools'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'BedTool'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '118']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'bed_lines'}; {'id': '118', 'type': 'keyword_argument', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'from_string'}; {'id': '120', 'type': 'True', 'children': []}
Combine multiple BEDtools regions of regions into sorted final BEDtool.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'report'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '10', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'is_paired'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'bait_file'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'target_file'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '12', 'type': 'block', 'children': ['13', '22', '32', '36', '46', '60', '144', '153', '168', '172', '193', '214']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'dup_metrics'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_get_current_dup_metrics'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'align_metrics'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_collect_align_metrics'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'gc_graph'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '42']}; {'id': '38', 'type': 'pattern_list', 'children': ['39', '40', '41']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'insert_graph'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'insert_metrics'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'hybrid_metrics'}; {'id': '42', 'type': 'tuple', 'children': ['43', '44', '45']}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'None', 'children': []}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'if_statement', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'is_paired'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '54']}; {'id': '51', 'type': 'pattern_list', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'insert_graph'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'insert_metrics'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_insert_sizes'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '60', 'type': 'if_statement', 'children': ['61', '64', '100']}; {'id': '61', 'type': 'boolean_operator', 'children': ['62', '63'], 'value': 'and'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'bait_file'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'target_file'}; {'id': '64', 'type': 'block', 'children': ['65', '77', '89']}; {'id': '65', 'type': 'assert_statement', 'children': ['66', '74']}; {'id': '66', 'type': 'call', 'children': ['67', '72']}; {'id': '67', 'type': 'attribute', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'bait_file'}; {'id': '74', 'type': 'tuple', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'bait_file'}; {'id': '76', 'type': 'string', 'children': [], 'value': '"does not exist!"'}; {'id': '77', 'type': 'assert_statement', 'children': ['78', '86']}; {'id': '78', 'type': 'call', 'children': ['79', '84']}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '84', 'type': 'argument_list', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'target_file'}; {'id': '86', 'type': 'tuple', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'target_file'}; {'id': '88', 'type': 'string', 'children': [], 'value': '"does not exist!"'}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'assignment', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'hybrid_metrics'}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': '_hybrid_select_metrics'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98', '99']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'bait_file'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'target_file'}; {'id': '100', 'type': 'elif_clause', 'children': ['101', '120']}; {'id': '101', 'type': '()', 'children': ['102']}; {'id': '102', 'type': 'boolean_operator', 'children': ['103', '104'], 'value': 'and'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '104', 'type': 'comparison_operator', 'children': ['105', '118'], 'value': 'in'}; {'id': '105', 'type': 'call', 'children': ['106', '117']}; {'id': '106', 'type': 'attribute', 'children': ['107', '116']}; {'id': '107', 'type': 'call', 'children': ['108', '113']}; {'id': '108', 'type': 'attribute', 'children': ['109', '112']}; {'id': '109', 'type': 'subscript', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '111', 'type': 'string', 'children': [], 'value': '"algorithm"'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '115']}; {'id': '114', 'type': 'string', 'children': [], 'value': '"coverage_interval"'}; {'id': '115', 'type': 'string', 'children': [], 'value': '""'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '117', 'type': 'argument_list', 'children': []}; {'id': '118', 'type': 'list', 'children': ['119'], 'value': '["exome"]'}; {'id': '119', 'type': 'string', 'children': [], 'value': '"exome"'}; {'id': '120', 'type': 'block', 'children': ['121', '133']}; {'id': '121', 'type': 'assert_statement', 'children': ['122', '130']}; {'id': '122', 'type': 'call', 'children': ['123', '128']}; {'id': '123', 'type': 'attribute', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '128', 'type': 'argument_list', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '130', 'type': 'tuple', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '132', 'type': 'string', 'children': [], 'value': '"does not exist"'}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'assignment', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'hybrid_metrics'}; {'id': '136', 'type': 'call', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': '_hybrid_select_metrics'}; {'id': '140', 'type': 'argument_list', 'children': ['141', '142', '143']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'variant_region_file'}; {'id': '144', 'type': 'expression_statement', 'children': ['145']}; {'id': '145', 'type': 'assignment', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'vrn_vals'}; {'id': '147', 'type': 'call', 'children': ['148', '151']}; {'id': '148', 'type': 'attribute', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': '_variant_eval_metrics'}; {'id': '151', 'type': 'argument_list', 'children': ['152']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '153', 'type': 'expression_statement', 'children': ['154']}; {'id': '154', 'type': 'assignment', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'summary_info'}; {'id': '156', 'type': 'call', 'children': ['157', '162']}; {'id': '157', 'type': 'attribute', 'children': ['158', '161']}; {'id': '158', 'type': 'attribute', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': '_parser'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'get_summary_metrics'}; {'id': '162', 'type': 'argument_list', 'children': ['163', '164', '165', '166', '167']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'align_metrics'}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'dup_metrics'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'insert_metrics'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'hybrid_metrics'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'vrn_vals'}; {'id': '168', 'type': 'expression_statement', 'children': ['169']}; {'id': '169', 'type': 'assignment', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'graphs'}; {'id': '171', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '172', 'type': 'if_statement', 'children': ['173', '183']}; {'id': '173', 'type': 'boolean_operator', 'children': ['174', '175'], 'value': 'and'}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'gc_graph'}; {'id': '175', 'type': 'call', 'children': ['176', '181']}; {'id': '176', 'type': 'attribute', 'children': ['177', '180']}; {'id': '177', 'type': 'attribute', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '181', 'type': 'argument_list', 'children': ['182']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'gc_graph'}; {'id': '183', 'type': 'block', 'children': ['184']}; {'id': '184', 'type': 'expression_statement', 'children': ['185']}; {'id': '185', 'type': 'call', 'children': ['186', '189']}; {'id': '186', 'type': 'attribute', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'graphs'}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '189', 'type': 'argument_list', 'children': ['190']}; {'id': '190', 'type': 'tuple', 'children': ['191', '192']}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'gc_graph'}; {'id': '192', 'type': 'string', 'children': [], 'value': '"Distribution of GC content across reads"'}; {'id': '193', 'type': 'if_statement', 'children': ['194', '204']}; {'id': '194', 'type': 'boolean_operator', 'children': ['195', '196'], 'value': 'and'}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'insert_graph'}; {'id': '196', 'type': 'call', 'children': ['197', '202']}; {'id': '197', 'type': 'attribute', 'children': ['198', '201']}; {'id': '198', 'type': 'attribute', 'children': ['199', '200']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '202', 'type': 'argument_list', 'children': ['203']}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'insert_graph'}; {'id': '204', 'type': 'block', 'children': ['205']}; {'id': '205', 'type': 'expression_statement', 'children': ['206']}; {'id': '206', 'type': 'call', 'children': ['207', '210']}; {'id': '207', 'type': 'attribute', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'graphs'}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '210', 'type': 'argument_list', 'children': ['211']}; {'id': '211', 'type': 'tuple', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'insert_graph'}; {'id': '213', 'type': 'string', 'children': [], 'value': '"Distribution of paired end insert sizes"'}; {'id': '214', 'type': 'return_statement', 'children': ['215']}; {'id': '215', 'type': 'expression_list', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'summary_info'}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'graphs'}
Produce report metrics using Picard with sorted aligned BAM file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'apply_recal'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '28', '141', '163', '200']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'orig_bam'}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '16'], 'value': 'or'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_align_bam'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'get_work_bam'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'had_work_bam'}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': 'in'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '39', '74', '120']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '36'], 'value': 'in'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_recalibrate'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '36', 'type': 'list', 'children': ['37', '38'], 'value': '[True, "gatk"]'}; {'id': '37', 'type': 'True', 'children': []}; {'id': '38', 'type': 'string', 'children': [], 'value': '"gatk"'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'if_statement', 'children': ['41', '47']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'string', 'children': [], 'value': '"prep_recal"'}; {'id': '47', 'type': 'block', 'children': ['48', '65']}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'binary_operator', 'children': ['55', '56'], 'value': '%'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"Applying BQSR recalibration with GATK: %s "'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'get_sample_name'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '70']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '69', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_gatk_apply_bqsr'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '74', 'type': 'elif_clause', 'children': ['75', '83']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '82'], 'value': '=='}; {'id': '76', 'type': 'call', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'get_recalibrate'}; {'id': '80', 'type': 'argument_list', 'children': ['81']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"sentieon"'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'if_statement', 'children': ['85', '91']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'string', 'children': [], 'value': '"prep_recal"'}; {'id': '91', 'type': 'block', 'children': ['92', '109']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'binary_operator', 'children': ['99', '100'], 'value': '%'}; {'id': '99', 'type': 'string', 'children': [], 'value': '"Applying BQSR recalibration with sentieon: %s "'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'get_sample_name'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '114']}; {'id': '111', 'type': 'subscript', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '113', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'sentieon'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'apply_bqsr'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '120', 'type': 'elif_clause', 'children': ['121', '127']}; {'id': '121', 'type': 'call', 'children': ['122', '125']}; {'id': '122', 'type': 'attribute', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'get_recalibrate'}; {'id': '125', 'type': 'argument_list', 'children': ['126']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '127', 'type': 'block', 'children': ['128']}; {'id': '128', 'type': 'raise_statement', 'children': ['129']}; {'id': '129', 'type': 'call', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'NotImplementedError'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'binary_operator', 'children': ['133', '134'], 'value': '%'}; {'id': '133', 'type': 'string', 'children': [], 'value': '"Unsupported recalibration type: %s"'}; {'id': '134', 'type': '()', 'children': ['135']}; {'id': '135', 'type': 'call', 'children': ['136', '139']}; {'id': '136', 'type': 'attribute', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'get_recalibrate'}; {'id': '139', 'type': 'argument_list', 'children': ['140']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '141', 'type': 'if_statement', 'children': ['142', '151']}; {'id': '142', 'type': 'boolean_operator', 'children': ['143', '145'], 'value': 'and'}; {'id': '143', 'type': 'not_operator', 'children': ['144']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'had_work_bam'}; {'id': '145', 'type': 'call', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'get_work_bam'}; {'id': '149', 'type': 'argument_list', 'children': ['150']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '151', 'type': 'block', 'children': ['152']}; {'id': '152', 'type': 'expression_statement', 'children': ['153']}; {'id': '153', 'type': 'assignment', 'children': ['154', '157']}; {'id': '154', 'type': 'subscript', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '156', 'type': 'string', 'children': [], 'value': '"align_bam"'}; {'id': '157', 'type': 'call', 'children': ['158', '161']}; {'id': '158', 'type': 'attribute', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'get_work_bam'}; {'id': '161', 'type': 'argument_list', 'children': ['162']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '163', 'type': 'if_statement', 'children': ['164', '181']}; {'id': '164', 'type': 'boolean_operator', 'children': ['165', '173'], 'value': 'and'}; {'id': '165', 'type': 'comparison_operator', 'children': ['166', '167'], 'value': '!='}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'orig_bam'}; {'id': '167', 'type': 'call', 'children': ['168', '171']}; {'id': '168', 'type': 'attribute', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'get_work_bam'}; {'id': '171', 'type': 'argument_list', 'children': ['172']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '173', 'type': 'comparison_operator', 'children': ['174', '175'], 'value': '!='}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'orig_bam'}; {'id': '175', 'type': 'call', 'children': ['176', '179']}; {'id': '176', 'type': 'attribute', 'children': ['177', '178']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'get_align_bam'}; {'id': '179', 'type': 'argument_list', 'children': ['180']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '181', 'type': 'block', 'children': ['182']}; {'id': '182', 'type': 'expression_statement', 'children': ['183']}; {'id': '183', 'type': 'call', 'children': ['184', '187']}; {'id': '184', 'type': 'attribute', 'children': ['185', '186']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'save_diskspace'}; {'id': '187', 'type': 'argument_list', 'children': ['188', '189', '197']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'orig_bam'}; {'id': '189', 'type': 'binary_operator', 'children': ['190', '191'], 'value': '%'}; {'id': '190', 'type': 'string', 'children': [], 'value': '"BAM recalibrated to %s"'}; {'id': '191', 'type': 'call', 'children': ['192', '195']}; {'id': '192', 'type': 'attribute', 'children': ['193', '194']}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'get_work_bam'}; {'id': '195', 'type': 'argument_list', 'children': ['196']}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '197', 'type': 'subscript', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '199', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '200', 'type': 'return_statement', 'children': ['201']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'data'}
Apply recalibration tables to the sorted aligned BAM, producing recalibrated BAM.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_prep_callable_bed'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'work_dir'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'stats'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '8', 'type': 'block', 'children': ['9', '37', '47', '106']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'work_dir'}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '22'], 'value': '%'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"%s-merge.bed.gz"'}; {'id': '22', 'type': 'subscript', 'children': ['23', '36']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '34']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'gsort'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"gsort"'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '56']}; {'id': '48', 'type': 'not_operator', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'file_uptodate'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'with_statement', 'children': ['58', '68']}; {'id': '58', 'type': 'with_clause', 'children': ['59']}; {'id': '59', 'type': 'with_item', 'children': ['60']}; {'id': '60', 'type': 'as_pattern', 'children': ['61', '66']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '66', 'type': 'as_pattern_target', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '68', 'type': 'block', 'children': ['69', '83', '90']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'fai_file'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'fasta_idx'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'get_ref_file'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '86', 'type': '()', 'children': ['87']}; {'id': '87', 'type': 'concatenated_string', 'children': ['88', '89']}; {'id': '88', 'type': 'string', 'children': [], 'value': '"{gsort} {in_file} {fai_file} | bedtools merge -i - -d {stats[merge_size]} | "'}; {'id': '89', 'type': 'string', 'children': [], 'value': '"bgzip -c > {tx_out_file}"'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'do'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '95', 'type': 'argument_list', 'children': ['96', '105']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'dictionary_splat', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'string', 'children': [], 'value': '"Prepare SV callable BED regions"'}; {'id': '106', 'type': 'return_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'vcfutils'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'bgzip_and_index'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '113', 'type': 'subscript', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '115', 'type': 'string', 'children': [], 'value': '"config"'}
Sort and merge callable BED regions to prevent SV double counting
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'fake_index'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '53']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'index_file'}; {'id': '10', 'type': 'binary_operator', 'children': ['11', '12'], 'value': '%'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"%s.bai"'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '21']}; {'id': '14', 'type': 'not_operator', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'index_file'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'with_statement', 'children': ['23', '33']}; {'id': '23', 'type': 'with_clause', 'children': ['24']}; {'id': '24', 'type': 'with_item', 'children': ['25']}; {'id': '25', 'type': 'as_pattern', 'children': ['26', '31']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'index_file'}; {'id': '31', 'type': 'as_pattern_target', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'with_statement', 'children': ['35', '45']}; {'id': '35', 'type': 'with_clause', 'children': ['36']}; {'id': '36', 'type': 'with_item', 'children': ['37']}; {'id': '37', 'type': 'as_pattern', 'children': ['38', '43']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '42', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '43', 'type': 'as_pattern_target', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"name sorted -- no index"'}; {'id': '53', 'type': 'return_statement', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'index_file'}
Create a fake index file for namesorted BAMs. bais require by CWL for consistency.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '8', 'type': 'string', 'children': [], 'value': '"coordinate"'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'out_dir'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '21', '31', '40', '46', '203']}; {'id': '13', 'type': 'assert_statement', 'children': ['14', '18']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'is_bam'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '20'], 'value': '%'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"%s in not a BAM file"'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '28']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'bam_already_sorted'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26', '27']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sort_stem'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_get_sort_stem'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38', '39']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'out_dir'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sort_file'}; {'id': '43', 'type': 'binary_operator', 'children': ['44', '45'], 'value': '+'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sort_stem'}; {'id': '45', 'type': 'string', 'children': [], 'value': '".bam"'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '54']}; {'id': '47', 'type': 'not_operator', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sort_file'}; {'id': '54', 'type': 'block', 'children': ['55', '65', '77']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'samtools'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'string', 'children': [], 'value': '"samtools"'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '68', 'type': 'call', 'children': ['69', '74']}; {'id': '69', 'type': 'attribute', 'children': ['70', '73']}; {'id': '70', 'type': 'subscript', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '72', 'type': 'string', 'children': [], 'value': '"algorithm"'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'string', 'children': [], 'value': '"num_cores"'}; {'id': '76', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '77', 'type': 'with_statement', 'children': ['78', '88']}; {'id': '78', 'type': 'with_clause', 'children': ['79']}; {'id': '79', 'type': 'with_item', 'children': ['80']}; {'id': '80', 'type': 'as_pattern', 'children': ['81', '86']}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sort_file'}; {'id': '86', 'type': 'as_pattern_target', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'tx_sort_file'}; {'id': '88', 'type': 'block', 'children': ['89', '102', '118', '127', '137', '161', '168']}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'assignment', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'tx_sort_stem'}; {'id': '92', 'type': 'subscript', 'children': ['93', '101']}; {'id': '93', 'type': 'call', 'children': ['94', '99']}; {'id': '94', 'type': 'attribute', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'tx_sort_file'}; {'id': '101', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'tx_dir'}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'safe_makedir'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '116']}; {'id': '111', 'type': 'attribute', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'tx_sort_file'}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'order_flag'}; {'id': '121', 'type': 'conditional_expression', 'children': ['122', '123', '126'], 'value': 'if'}; {'id': '122', 'type': 'string', 'children': [], 'value': '"-n"'}; {'id': '123', 'type': 'comparison_operator', 'children': ['124', '125'], 'value': '=='}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '125', 'type': 'string', 'children': [], 'value': '"queryname"'}; {'id': '126', 'type': 'string', 'children': [], 'value': '""'}; {'id': '127', 'type': 'expression_statement', 'children': ['128']}; {'id': '128', 'type': 'assignment', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'resources'}; {'id': '130', 'type': 'call', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'get_resources'}; {'id': '134', 'type': 'argument_list', 'children': ['135', '136']}; {'id': '135', 'type': 'string', 'children': [], 'value': '"samtools"'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'assignment', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '140', 'type': 'call', 'children': ['141', '160']}; {'id': '141', 'type': 'attribute', 'children': ['142', '159']}; {'id': '142', 'type': 'call', 'children': ['143', '146']}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'adjust_memory'}; {'id': '146', 'type': 'argument_list', 'children': ['147', '154', '155', '156']}; {'id': '147', 'type': 'call', 'children': ['148', '151']}; {'id': '148', 'type': 'attribute', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'resources'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '151', 'type': 'argument_list', 'children': ['152', '153']}; {'id': '152', 'type': 'string', 'children': [], 'value': '"memory"'}; {'id': '153', 'type': 'string', 'children': [], 'value': '"2G"'}; {'id': '154', 'type': 'float', 'children': [], 'value': '1.25'}; {'id': '155', 'type': 'string', 'children': [], 'value': '"decrease"'}; {'id': '156', 'type': 'keyword_argument', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'out_modifier'}; {'id': '158', 'type': 'string', 'children': [], 'value': '"M"'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '160', 'type': 'argument_list', 'children': []}; {'id': '161', 'type': 'expression_statement', 'children': ['162']}; {'id': '162', 'type': 'assignment', 'children': ['163', '164']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '164', 'type': '()', 'children': ['165']}; {'id': '165', 'type': 'concatenated_string', 'children': ['166', '167']}; {'id': '166', 'type': 'string', 'children': [], 'value': '"{samtools} sort -@ {cores} -m {mem} -O BAM {order_flag} "'}; {'id': '167', 'type': 'string', 'children': [], 'value': '"-T {tx_sort_stem}-sort -o {tx_sort_file} {in_bam}"'}; {'id': '168', 'type': 'expression_statement', 'children': ['169']}; {'id': '169', 'type': 'call', 'children': ['170', '173']}; {'id': '170', 'type': 'attribute', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'do'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '173', 'type': 'argument_list', 'children': ['174', '183']}; {'id': '174', 'type': 'call', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '178', 'type': 'argument_list', 'children': ['179']}; {'id': '179', 'type': 'dictionary_splat', 'children': ['180']}; {'id': '180', 'type': 'call', 'children': ['181', '182']}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '182', 'type': 'argument_list', 'children': []}; {'id': '183', 'type': 'binary_operator', 'children': ['184', '185'], 'value': '%'}; {'id': '184', 'type': 'string', 'children': [], 'value': '"Sort BAM file %s: %s to %s"'}; {'id': '185', 'type': 'tuple', 'children': ['186', '187', '195']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '187', 'type': 'call', 'children': ['188', '193']}; {'id': '188', 'type': 'attribute', 'children': ['189', '192']}; {'id': '189', 'type': 'attribute', 'children': ['190', '191']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '193', 'type': 'argument_list', 'children': ['194']}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '195', 'type': 'call', 'children': ['196', '201']}; {'id': '196', 'type': 'attribute', 'children': ['197', '200']}; {'id': '197', 'type': 'attribute', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '201', 'type': 'argument_list', 'children': ['202']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'sort_file'}; {'id': '203', 'type': 'return_statement', 'children': ['204']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'sort_file'}
Sort a BAM file, skipping if already present.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'samblaster_dedup_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'tx_sr_file'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'tx_disc_file'}; {'id': '8', 'type': 'block', 'children': ['9', '21', '33', '46', '51', '63', '81', '100', '148', '152', '164', '184', '204', '211']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'samblaster'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"samblaster"'}; {'id': '18', 'type': 'subscript', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'samtools'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"samtools"'}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '32', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tmp_prefix'}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '38'], 'value': '%'}; {'id': '37', 'type': 'string', 'children': [], 'value': '"%s-sorttmp"'}; {'id': '38', 'type': 'subscript', 'children': ['39', '45']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'tobam_cmd'}; {'id': '49', 'type': '()', 'children': ['50']}; {'id': '50', 'type': 'string', 'children': [], 'value': '"{samtools} sort {sort_opt} -@ {cores} -m {mem} -T {tmp_prefix}-{dext} {out_file} -"'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '56']}; {'id': '53', 'type': 'pattern_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_get_cores_memory'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'downscale'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'ds_cmd'}; {'id': '66', 'type': 'conditional_expression', 'children': ['67', '68', '74'], 'value': 'if'}; {'id': '67', 'type': 'None', 'children': []}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'string', 'children': [], 'value': '"align_split"'}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'get_maxcov_downsample_cl'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '80', 'type': 'string', 'children': [], 'value': '"samtools"'}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'sort_opt'}; {'id': '84', 'type': 'conditional_expression', 'children': ['85', '86', '99'], 'value': 'if'}; {'id': '85', 'type': 'string', 'children': [], 'value': '"-n"'}; {'id': '86', 'type': 'boolean_operator', 'children': ['87', '93'], 'value': 'and'}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'string', 'children': [], 'value': '"align_split"'}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'get_mark_duplicates'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '99', 'type': 'string', 'children': [], 'value': '""'}; {'id': '100', 'type': 'if_statement', 'children': ['101', '102', '126']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'ds_cmd'}; {'id': '102', 'type': 'block', 'children': ['103']}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'assignment', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'dedup_cmd'}; {'id': '106', 'type': 'binary_operator', 'children': ['107', '108'], 'value': '%'}; {'id': '107', 'type': 'string', 'children': [], 'value': '"%s %s > %s"'}; {'id': '108', 'type': 'tuple', 'children': ['109', '124', '125']}; {'id': '109', 'type': 'call', 'children': ['110', '113']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'tobam_cmd'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '117', '120']}; {'id': '114', 'type': 'keyword_argument', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '116', 'type': 'string', 'children': [], 'value': '""'}; {'id': '117', 'type': 'keyword_argument', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'dext'}; {'id': '119', 'type': 'string', 'children': [], 'value': '"full"'}; {'id': '120', 'type': 'dictionary_splat', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '123', 'type': 'argument_list', 'children': []}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'ds_cmd'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '126', 'type': 'else_clause', 'children': ['127']}; {'id': '127', 'type': 'block', 'children': ['128']}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'assignment', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'dedup_cmd'}; {'id': '131', 'type': 'call', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'tobam_cmd'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '135', 'type': 'argument_list', 'children': ['136', '141', '144']}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '138', 'type': 'binary_operator', 'children': ['139', '140'], 'value': '%'}; {'id': '139', 'type': 'string', 'children': [], 'value': '"-o %s"'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '141', 'type': 'keyword_argument', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'dext'}; {'id': '143', 'type': 'string', 'children': [], 'value': '"full"'}; {'id': '144', 'type': 'dictionary_splat', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '147', 'type': 'argument_list', 'children': []}; {'id': '148', 'type': 'expression_statement', 'children': ['149']}; {'id': '149', 'type': 'assignment', 'children': ['150', '151']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'sort_opt'}; {'id': '151', 'type': 'string', 'children': [], 'value': '""'}; {'id': '152', 'type': 'expression_statement', 'children': ['153']}; {'id': '153', 'type': 'assignment', 'children': ['154', '157']}; {'id': '154', 'type': 'pattern_list', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '157', 'type': 'call', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': '_get_cores_memory'}; {'id': '159', 'type': 'argument_list', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '161', 'type': 'keyword_argument', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'downscale'}; {'id': '163', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '164', 'type': 'expression_statement', 'children': ['165']}; {'id': '165', 'type': 'assignment', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'splitter_cmd'}; {'id': '167', 'type': 'call', 'children': ['168', '171']}; {'id': '168', 'type': 'attribute', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'tobam_cmd'}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '171', 'type': 'argument_list', 'children': ['172', '177', '180']}; {'id': '172', 'type': 'keyword_argument', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '174', 'type': 'binary_operator', 'children': ['175', '176'], 'value': '%'}; {'id': '175', 'type': 'string', 'children': [], 'value': '"-o %s"'}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'tx_sr_file'}; {'id': '177', 'type': 'keyword_argument', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'dext'}; {'id': '179', 'type': 'string', 'children': [], 'value': '"spl"'}; {'id': '180', 'type': 'dictionary_splat', 'children': ['181']}; {'id': '181', 'type': 'call', 'children': ['182', '183']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '183', 'type': 'argument_list', 'children': []}; {'id': '184', 'type': 'expression_statement', 'children': ['185']}; {'id': '185', 'type': 'assignment', 'children': ['186', '187']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'discordant_cmd'}; {'id': '187', 'type': 'call', 'children': ['188', '191']}; {'id': '188', 'type': 'attribute', 'children': ['189', '190']}; {'id': '189', 'type': 'identifier', 'children': [], 'value': 'tobam_cmd'}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '191', 'type': 'argument_list', 'children': ['192', '197', '200']}; {'id': '192', 'type': 'keyword_argument', 'children': ['193', '194']}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '194', 'type': 'binary_operator', 'children': ['195', '196'], 'value': '%'}; {'id': '195', 'type': 'string', 'children': [], 'value': '"-o %s"'}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'tx_disc_file'}; {'id': '197', 'type': 'keyword_argument', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'dext'}; {'id': '199', 'type': 'string', 'children': [], 'value': '"disc"'}; {'id': '200', 'type': 'dictionary_splat', 'children': ['201']}; {'id': '201', 'type': 'call', 'children': ['202', '203']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '203', 'type': 'argument_list', 'children': []}; {'id': '204', 'type': 'expression_statement', 'children': ['205']}; {'id': '205', 'type': 'assignment', 'children': ['206', '207']}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '207', 'type': '()', 'children': ['208']}; {'id': '208', 'type': 'concatenated_string', 'children': ['209', '210']}; {'id': '209', 'type': 'string', 'children': [], 'value': '"{samblaster} --addMateTags -M --splitterFile >({splitter_cmd}) --discordantFile >({discordant_cmd}) "'}; {'id': '210', 'type': 'string', 'children': [], 'value': '"| {dedup_cmd}"'}; {'id': '211', 'type': 'return_statement', 'children': ['212']}; {'id': '212', 'type': 'call', 'children': ['213', '216']}; {'id': '213', 'type': 'attribute', 'children': ['214', '215']}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '216', 'type': 'argument_list', 'children': ['217']}; {'id': '217', 'type': 'dictionary_splat', 'children': ['218']}; {'id': '218', 'type': 'call', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '220', 'type': 'argument_list', 'children': []}
Deduplicate and sort with samblaster, produces split read and discordant pair files.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_biobambam_dedup_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '6', 'type': 'block', 'children': ['7', '19', '31', '44', '124']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'samtools'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': '"samtools"'}; {'id': '16', 'type': 'subscript', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'pattern_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'mem'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_get_cores_memory'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'downscale'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'tmp_file'}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '%'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"%s-sorttmp"'}; {'id': '36', 'type': 'subscript', 'children': ['37', '43']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'if_statement', 'children': ['45', '51', '75']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'string', 'children': [], 'value': '"align_split"'}; {'id': '51', 'type': 'block', 'children': ['52', '69']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sort_opt'}; {'id': '55', 'type': 'conditional_expression', 'children': ['56', '57', '68'], 'value': 'if'}; {'id': '56', 'type': 'string', 'children': [], 'value': '"-n"'}; {'id': '57', 'type': 'boolean_operator', 'children': ['58', '64'], 'value': 'and'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'string', 'children': [], 'value': '"align_split"'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '_check_dedup'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '68', 'type': 'string', 'children': [], 'value': '""'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '72', 'type': 'binary_operator', 'children': ['73', '74'], 'value': '%'}; {'id': '73', 'type': 'string', 'children': [], 'value': '"{samtools} sort %s -@ {cores} -m {mem} -O bam -T {tmp_file}-namesort -o {tx_out_file} -"'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sort_opt'}; {'id': '75', 'type': 'else_clause', 'children': ['76']}; {'id': '76', 'type': 'block', 'children': ['77', '95', '105', '115']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '80', 'type': 'call', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '82', 'type': 'argument_list', 'children': ['83', '84']}; {'id': '83', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '86', 'type': 'argument_list', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'math'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'ceil'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '94'], 'value': '*'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'cores'}; {'id': '94', 'type': 'float', 'children': [], 'value': '0.75'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'assignment', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'ds_cmd'}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'get_maxcov_downsample_cl'}; {'id': '102', 'type': 'argument_list', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '104', 'type': 'string', 'children': [], 'value': '"bamsormadup"'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'assignment', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'bamsormadup'}; {'id': '108', 'type': 'call', 'children': ['109', '112']}; {'id': '109', 'type': 'attribute', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'config_utils'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'get_program'}; {'id': '112', 'type': 'argument_list', 'children': ['113', '114']}; {'id': '113', 'type': 'string', 'children': [], 'value': '"bamsormadup"'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '118', 'type': '()', 'children': ['119']}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '123'], 'value': '%'}; {'id': '120', 'type': 'concatenated_string', 'children': ['121', '122']}; {'id': '121', 'type': 'string', 'children': [], 'value': '"{bamsormadup} inputformat=sam threads={cores} tmpfile={tmp_file}-markdup "'}; {'id': '122', 'type': 'string', 'children': [], 'value': '"SO=coordinate %s > {tx_out_file}"'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'ds_cmd'}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'dictionary_splat', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '133', 'type': 'argument_list', 'children': []}
Perform streaming deduplication and sorting with biobambam's bamsormadup
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_prepare_bam_file'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'bam_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'tmp_dir'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '30']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sort_mode'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_get_sort_order'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'bam_file'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': '!='}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sort_mode'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"queryname"'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'bam_file'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'bam_file'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"queryname"'}; {'id': '30', 'type': 'return_statement', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'bam_file'}
Pipe sort by name cmd in case sort by coordinates
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_combine_files'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'tsv_files'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'work_dir'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '7', 'type': 'block', 'children': ['8', '28', '37', '52', '122']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'string', 'children': [], 'value': '"\\t"'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'list', 'children': ['17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27'], 'value': '["caller", "sample", "chrom", "start", "end", "svtype",\n "lof", "annotation", "split_read_support", "paired_support_PE", "paired_support_PR"]'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"caller"'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"sample"'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"start"'}; {'id': '21', 'type': 'string', 'children': [], 'value': '"end"'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"svtype"'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"lof"'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"annotation"'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"split_read_support"'}; {'id': '26', 'type': 'string', 'children': [], 'value': '"paired_support_PE"'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"paired_support_PR"'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get_sample_name'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'work_dir'}; {'id': '48', 'type': 'binary_operator', 'children': ['49', '50'], 'value': '%'}; {'id': '49', 'type': 'string', 'children': [], 'value': '"%s-prioritize.tsv"'}; {'id': '50', 'type': '()', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '52', 'type': 'if_statement', 'children': ['53', '60']}; {'id': '53', 'type': 'not_operator', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'with_statement', 'children': ['62', '72']}; {'id': '62', 'type': 'with_clause', 'children': ['63']}; {'id': '63', 'type': 'with_item', 'children': ['64']}; {'id': '64', 'type': 'as_pattern', 'children': ['65', '70']}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '70', 'type': 'as_pattern_target', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '72', 'type': 'block', 'children': ['73', '84', '93', '102', '106']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'tmpdir'}; {'id': '76', 'type': 'call', 'children': ['77', '82']}; {'id': '77', 'type': 'attribute', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'input_files'}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'tsv_files'}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'sort_cmd'}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'bedutils'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'get_sort_cmd'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'tmpdir'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '105', 'type': 'string', 'children': [], 'value': '"{{ echo \'{header}\'; cat {input_files} | {sort_cmd} -k3,3 -k4,4n; }} > {tx_out_file}"'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'do'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '111', 'type': 'argument_list', 'children': ['112', '121']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'dictionary_splat', 'children': ['118']}; {'id': '118', 'type': 'call', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '120', 'type': 'argument_list', 'children': []}; {'id': '121', 'type': 'string', 'children': [], 'value': '"Combine prioritized from multiple callers"'}; {'id': '122', 'type': 'return_statement', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'out_file'}
Combine multiple priority tsv files into a final sorted output.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_filenames'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '45']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'basenames'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '18']}; {'id': '10', 'type': 'call', 'children': ['11', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'indexes'}; {'id': '24', 'type': 'list_comprehension', 'children': ['25', '28']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'for_in_clause', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '37']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'basenames'}; {'id': '37', 'type': 'keyword_argument', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '39', 'type': 'lambda', 'children': ['40', '42']}; {'id': '40', 'type': 'lambda_parameters', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'list_comprehension', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'filenames'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '50', 'type': 'for_in_clause', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'indexes'}
sort a list of files by filename only, ignoring the directory names
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_csv'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '73']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '9', 'type': 'binary_operator', 'children': ['10', '11'], 'value': '%'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"%s.sort"'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '12', 'type': 'if_statement', 'children': ['13', '34']}; {'id': '13', 'type': 'not_operator', 'children': ['14']}; {'id': '14', 'type': '()', 'children': ['15']}; {'id': '15', 'type': 'boolean_operator', 'children': ['16', '24'], 'value': 'and'}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '33'], 'value': '>'}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'getsize'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '34', 'type': 'block', 'children': ['35', '43']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'cl'}; {'id': '38', 'type': 'list', 'children': ['39', '40', '41', '42'], 'value': '["sort", "-k", "1,1", in_file]'}; {'id': '39', 'type': 'string', 'children': [], 'value': '"sort"'}; {'id': '40', 'type': 'string', 'children': [], 'value': '"-k"'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"1,1"'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '43', 'type': 'with_statement', 'children': ['44', '54']}; {'id': '44', 'type': 'with_clause', 'children': ['45']}; {'id': '45', 'type': 'with_item', 'children': ['46']}; {'id': '46', 'type': 'as_pattern', 'children': ['47', '52']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '51', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '52', 'type': 'as_pattern_target', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '54', 'type': 'block', 'children': ['55', '67']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'subprocess'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'Popen'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'cl'}; {'id': '64', 'type': 'keyword_argument', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '72', 'type': 'argument_list', 'children': []}; {'id': '73', 'type': 'return_statement', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'out_file'}
Sort a CSV file by read name, allowing direct comparison.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '18']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'picard_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12', '15']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '8', 'type': 'string', 'children': [], 'value': '"coordinate"'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'compression_level'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'default_parameter', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '17', 'type': 'False', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19', '32', '45', '121']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'pattern_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '24', 'type': 'call', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': 'is'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '%'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"%s-sort%s"'}; {'id': '42', 'type': 'tuple', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '45', 'type': 'if_statement', 'children': ['46', '51']}; {'id': '46', 'type': 'not_operator', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'with_statement', 'children': ['53', '64']}; {'id': '53', 'type': 'with_clause', 'children': ['54']}; {'id': '54', 'type': 'with_item', 'children': ['55']}; {'id': '55', 'type': 'as_pattern', 'children': ['56', '62']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'tx_tmpdir'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '62', 'type': 'as_pattern_target', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'tmp_dir'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'id': '65', 'type': 'with_statement', 'children': ['66', '78']}; {'id': '66', 'type': 'with_clause', 'children': ['67']}; {'id': '67', 'type': 'with_item', 'children': ['68']}; {'id': '68', 'type': 'as_pattern', 'children': ['69', '76']}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '76', 'type': 'as_pattern_target', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '78', 'type': 'block', 'children': ['79', '98', '110']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '82', 'type': 'list', 'children': ['83', '86', '92', '95'], 'value': '[("INPUT", align_bam),\n ("OUTPUT", out_file if pipe else tx_out_file),\n ("TMP_DIR", tmp_dir),\n ("SORT_ORDER", sort_order)]'}; {'id': '83', 'type': 'tuple', 'children': ['84', '85']}; {'id': '84', 'type': 'string', 'children': [], 'value': '"INPUT"'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'align_bam'}; {'id': '86', 'type': 'tuple', 'children': ['87', '88']}; {'id': '87', 'type': 'string', 'children': [], 'value': '"OUTPUT"'}; {'id': '88', 'type': 'conditional_expression', 'children': ['89', '90', '91'], 'value': 'if'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '92', 'type': 'tuple', 'children': ['93', '94']}; {'id': '93', 'type': 'string', 'children': [], 'value': '"TMP_DIR"'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'tmp_dir'}; {'id': '95', 'type': 'tuple', 'children': ['96', '97']}; {'id': '96', 'type': 'string', 'children': [], 'value': '"SORT_ORDER"'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'compression_level'}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'tuple', 'children': ['108', '109']}; {'id': '108', 'type': 'string', 'children': [], 'value': '"COMPRESSION_LEVEL"'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'compression_level'}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '115', 'type': 'argument_list', 'children': ['116', '117', '118']}; {'id': '116', 'type': 'string', 'children': [], 'value': '"SortSam"'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '118', 'type': 'keyword_argument', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '121', 'type': 'return_statement', 'children': ['122']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'out_file'}
Sort a BAM file by coordinates.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'picard_fix_rgs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '7', 'type': 'block', 'children': ['8', '23', '110']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '11', 'type': 'binary_operator', 'children': ['12', '13'], 'value': '%'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"%s-fixrgs.bam"'}; {'id': '13', 'type': 'subscript', 'children': ['14', '22']}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'splitext'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '29']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'with_statement', 'children': ['31', '42']}; {'id': '31', 'type': 'with_clause', 'children': ['32']}; {'id': '32', 'type': 'with_item', 'children': ['33']}; {'id': '33', 'type': 'as_pattern', 'children': ['34', '40']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tx_tmpdir'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '40', 'type': 'as_pattern_target', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tmp_dir'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'with_statement', 'children': ['44', '56']}; {'id': '44', 'type': 'with_clause', 'children': ['45']}; {'id': '45', 'type': 'with_item', 'children': ['46']}; {'id': '46', 'type': 'as_pattern', 'children': ['47', '54']}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_config'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '54', 'type': 'as_pattern_target', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '56', 'type': 'block', 'children': ['57', '102']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '60', 'type': 'list', 'children': ['61', '64', '67', '70', '75', '84', '89', '94', '99'], 'value': '[("INPUT", in_bam),\n ("OUTPUT", tx_out_file),\n ("SORT_ORDER", "coordinate"),\n ("RGID", names["rg"]),\n ("RGLB", names.get("lb", "unknown")),\n ("RGPL", names["pl"]),\n ("RGPU", names["pu"]),\n ("RGSM", names["sample"]),\n ("TMP_DIR", tmp_dir)]'}; {'id': '61', 'type': 'tuple', 'children': ['62', '63']}; {'id': '62', 'type': 'string', 'children': [], 'value': '"INPUT"'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'in_bam'}; {'id': '64', 'type': 'tuple', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': '"OUTPUT"'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '67', 'type': 'tuple', 'children': ['68', '69']}; {'id': '68', 'type': 'string', 'children': [], 'value': '"SORT_ORDER"'}; {'id': '69', 'type': 'string', 'children': [], 'value': '"coordinate"'}; {'id': '70', 'type': 'tuple', 'children': ['71', '72']}; {'id': '71', 'type': 'string', 'children': [], 'value': '"RGID"'}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '74', 'type': 'string', 'children': [], 'value': '"rg"'}; {'id': '75', 'type': 'tuple', 'children': ['76', '77']}; {'id': '76', 'type': 'string', 'children': [], 'value': '"RGLB"'}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '83']}; {'id': '82', 'type': 'string', 'children': [], 'value': '"lb"'}; {'id': '83', 'type': 'string', 'children': [], 'value': '"unknown"'}; {'id': '84', 'type': 'tuple', 'children': ['85', '86']}; {'id': '85', 'type': 'string', 'children': [], 'value': '"RGPL"'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '88', 'type': 'string', 'children': [], 'value': '"pl"'}; {'id': '89', 'type': 'tuple', 'children': ['90', '91']}; {'id': '90', 'type': 'string', 'children': [], 'value': '"RGPU"'}; {'id': '91', 'type': 'subscript', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '93', 'type': 'string', 'children': [], 'value': '"pu"'}; {'id': '94', 'type': 'tuple', 'children': ['95', '96']}; {'id': '95', 'type': 'string', 'children': [], 'value': '"RGSM"'}; {'id': '96', 'type': 'subscript', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '98', 'type': 'string', 'children': [], 'value': '"sample"'}; {'id': '99', 'type': 'tuple', 'children': ['100', '101']}; {'id': '100', 'type': 'string', 'children': [], 'value': '"TMP_DIR"'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'tmp_dir'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'picard'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '109']}; {'id': '108', 'type': 'string', 'children': [], 'value': '"AddOrReplaceReadGroups"'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'opts'}; {'id': '110', 'type': 'return_statement', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'out_file'}
Add read group information to BAM files and coordinate sort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sv_callers'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '33']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'callers'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'for_statement', 'children': ['15', '16', '23']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sv'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"sv"'}; {'id': '22', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'callers'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sv'}; {'id': '32', 'type': 'string', 'children': [], 'value': '"variantcaller"'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '52']}; {'id': '35', 'type': 'attribute', 'children': ['36', '51']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'list_comprehension', 'children': ['43', '44', '47']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '44', 'type': 'for_in_clause', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'callers'}; {'id': '47', 'type': 'if_clause', 'children': ['48']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': '!='}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"sv-ensemble"'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '52', 'type': 'argument_list', 'children': []}
return a sorted list of all of the structural variant callers run
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'clean_file'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '8', 'type': 'string', 'children': [], 'value': '""'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'bedprep_dir'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'simple'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '23']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'simple'}; {'id': '19', 'type': 'conditional_expression', 'children': ['20', '21', '22'], 'value': 'if'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"iconv -c -f utf-8 -t ascii | sed \'s/ //g\' |"'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'simple'}; {'id': '22', 'type': 'string', 'children': [], 'value': '""'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '25', 'type': 'block', 'children': ['26', '51', '70', '93', '103', '120', '216', '233']}; {'id': '26', 'type': 'if_statement', 'children': ['27', '29']}; {'id': '27', 'type': 'not_operator', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'bedprep_dir'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'bedprep_dir'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'safe_makedir'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '50']}; {'id': '45', 'type': 'subscript', 'children': ['46', '49']}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '48', 'type': 'string', 'children': [], 'value': '"dirs"'}; {'id': '49', 'type': 'string', 'children': [], 'value': '"work"'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"bedprep"'}; {'id': '51', 'type': 'if_statement', 'children': ['52', '67']}; {'id': '52', 'type': 'boolean_operator', 'children': ['53', '54'], 'value': 'and'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '54', 'type': 'call', 'children': ['55', '65']}; {'id': '55', 'type': 'attribute', 'children': ['56', '64']}; {'id': '56', 'type': 'call', 'children': ['57', '62']}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'return_statement', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '73', 'type': 'call', 'children': ['74', '79']}; {'id': '74', 'type': 'attribute', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'bedprep_dir'}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '83'], 'value': '%'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"%s%s"'}; {'id': '83', 'type': 'tuple', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '85', 'type': 'call', 'children': ['86', '91']}; {'id': '86', 'type': 'attribute', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102']}; {'id': '101', 'type': 'string', 'children': [], 'value': '".interval_list"'}; {'id': '102', 'type': 'string', 'children': [], 'value': '".bed"'}; {'id': '103', 'type': 'if_statement', 'children': ['104', '110']}; {'id': '104', 'type': 'call', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'string', 'children': [], 'value': '".gz"'}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'assignment', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '114', 'type': 'subscript', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '116', 'type': 'slice', 'children': ['117', '118']}; {'id': '117', 'type': 'colon', 'children': []}; {'id': '118', 'type': 'unary_operator', 'children': ['119'], 'value': '-'}; {'id': '119', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '120', 'type': 'if_statement', 'children': ['121', '129']}; {'id': '121', 'type': 'not_operator', 'children': ['122']}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'file_uptodate'}; {'id': '126', 'type': 'argument_list', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '129', 'type': 'block', 'children': ['130', '136', '142']}; {'id': '130', 'type': 'expression_statement', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'check_bed_contigs'}; {'id': '133', 'type': 'argument_list', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '136', 'type': 'expression_statement', 'children': ['137']}; {'id': '137', 'type': 'call', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'check_bed_coords'}; {'id': '139', 'type': 'argument_list', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '142', 'type': 'with_statement', 'children': ['143', '153']}; {'id': '143', 'type': 'with_clause', 'children': ['144']}; {'id': '144', 'type': 'with_item', 'children': ['145']}; {'id': '145', 'type': 'as_pattern', 'children': ['146', '151']}; {'id': '146', 'type': 'call', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '148', 'type': 'argument_list', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '151', 'type': 'as_pattern_target', 'children': ['152']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '153', 'type': 'block', 'children': ['154', '160', '172', '186', '199']}; {'id': '154', 'type': 'expression_statement', 'children': ['155']}; {'id': '155', 'type': 'assignment', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'bcbio_py'}; {'id': '157', 'type': 'attribute', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'executable'}; {'id': '160', 'type': 'expression_statement', 'children': ['161']}; {'id': '161', 'type': 'assignment', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'cat_cmd'}; {'id': '163', 'type': 'conditional_expression', 'children': ['164', '165', '171'], 'value': 'if'}; {'id': '164', 'type': 'string', 'children': [], 'value': '"zcat"'}; {'id': '165', 'type': 'call', 'children': ['166', '169']}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '169', 'type': 'argument_list', 'children': ['170']}; {'id': '170', 'type': 'string', 'children': [], 'value': '".gz"'}; {'id': '171', 'type': 'string', 'children': [], 'value': '"cat"'}; {'id': '172', 'type': 'expression_statement', 'children': ['173']}; {'id': '173', 'type': 'assignment', 'children': ['174', '175']}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'sort_cmd'}; {'id': '175', 'type': 'call', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'get_sort_cmd'}; {'id': '177', 'type': 'argument_list', 'children': ['178']}; {'id': '178', 'type': 'call', 'children': ['179', '184']}; {'id': '179', 'type': 'attribute', 'children': ['180', '183']}; {'id': '180', 'type': 'attribute', 'children': ['181', '182']}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '184', 'type': 'argument_list', 'children': ['185']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '186', 'type': 'expression_statement', 'children': ['187']}; {'id': '187', 'type': 'assignment', 'children': ['188', '189']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '189', 'type': '()', 'children': ['190']}; {'id': '190', 'type': 'binary_operator', 'children': ['191', '196'], 'value': '^'}; {'id': '191', 'type': 'binary_operator', 'children': ['192', '193', '195'], 'value': '-'}; {'id': '192', 'type': 'string', 'children': [], 'value': '"{cat_cmd} {in_file} | grep -v ^track | grep -v ^browser | grep -v ^@ | "'}; {'id': '193', 'type': 'ERROR', 'children': ['194']}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'grep'}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '196', 'type': 'concatenated_string', 'children': ['197', '198']}; {'id': '197', 'type': 'string', 'children': [], 'value': '"{bcbio_py} -c \'from bcbio.variation import bedutils; bedutils.remove_bad()\' | "'}; {'id': '198', 'type': 'string', 'children': [], 'value': '"{sort_cmd} -k1,1 -k2,2n > {tx_out_file}"'}; {'id': '199', 'type': 'expression_statement', 'children': ['200']}; {'id': '200', 'type': 'call', 'children': ['201', '204']}; {'id': '201', 'type': 'attribute', 'children': ['202', '203']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'do'}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '204', 'type': 'argument_list', 'children': ['205', '214', '215']}; {'id': '205', 'type': 'call', 'children': ['206', '209']}; {'id': '206', 'type': 'attribute', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '209', 'type': 'argument_list', 'children': ['210']}; {'id': '210', 'type': 'dictionary_splat', 'children': ['211']}; {'id': '211', 'type': 'call', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '213', 'type': 'argument_list', 'children': []}; {'id': '214', 'type': 'string', 'children': [], 'value': '"Prepare cleaned BED file"'}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '216', 'type': 'expression_statement', 'children': ['217']}; {'id': '217', 'type': 'call', 'children': ['218', '221']}; {'id': '218', 'type': 'attribute', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'vcfutils'}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'bgzip_and_index'}; {'id': '221', 'type': 'argument_list', 'children': ['222', '223', '230']}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '223', 'type': 'call', 'children': ['224', '227']}; {'id': '224', 'type': 'attribute', 'children': ['225', '226']}; {'id': '225', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '227', 'type': 'argument_list', 'children': ['228', '229']}; {'id': '228', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '229', 'type': 'dictionary', 'children': []}; {'id': '230', 'type': 'keyword_argument', 'children': ['231', '232']}; {'id': '231', 'type': 'identifier', 'children': [], 'value': 'remove_orig'}; {'id': '232', 'type': 'False', 'children': []}; {'id': '233', 'type': 'return_statement', 'children': ['234']}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'out_file'}
Prepare a clean sorted input BED file without headers
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_by_region'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fnames'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '8', 'type': 'block', 'children': ['9', '13', '36', '40', '53', '60', '174', '180']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'contig_order'}; {'id': '12', 'type': 'dictionary', 'children': []}; {'id': '13', 'type': 'for_statement', 'children': ['14', '17', '27']}; {'id': '14', 'type': 'pattern_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sq'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'file_contigs'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '35']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'contig_order'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sq'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'sitems'}; {'id': '39', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '40', 'type': 'assert_statement', 'children': ['41', '50']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '46'], 'value': '=='}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fnames'}; {'id': '50', 'type': 'tuple', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'fnames'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'added_fnames'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '60', 'type': 'for_statement', 'children': ['61', '64', '69']}; {'id': '61', 'type': 'pattern_list', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'fnames'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'if_statement', 'children': ['71', '74']}; {'id': '71', 'type': 'comparison_operator', 'children': ['72', '73'], 'value': 'not'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'added_fnames'}; {'id': '74', 'type': 'block', 'children': ['75', '152', '167']}; {'id': '75', 'type': 'if_statement', 'children': ['76', '83', '91', '138']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '80', 'type': 'tuple', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '90']}; {'id': '86', 'type': 'pattern_list', 'children': ['87', '88', '89']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '91', 'type': 'elif_clause', 'children': ['92', '108']}; {'id': '92', 'type': 'boolean_operator', 'children': ['93', '100'], 'value': 'and'}; {'id': '93', 'type': 'call', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '95', 'type': 'argument_list', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '100', 'type': 'comparison_operator', 'children': ['101', '107'], 'value': '>='}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '105', 'type': 'argument_list', 'children': ['106']}; {'id': '106', 'type': 'string', 'children': [], 'value': '":"'}; {'id': '107', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '108', 'type': 'block', 'children': ['109', '120']}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '114']}; {'id': '111', 'type': 'pattern_list', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'string', 'children': [], 'value': '":"'}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'assignment', 'children': ['122', '125']}; {'id': '122', 'type': 'pattern_list', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '125', 'type': 'list_comprehension', 'children': ['126', '130']}; {'id': '126', 'type': 'call', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '128', 'type': 'argument_list', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '130', 'type': 'for_in_clause', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '132', 'type': 'call', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'coords'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '136', 'type': 'argument_list', 'children': ['137']}; {'id': '137', 'type': 'string', 'children': [], 'value': '"-"'}; {'id': '138', 'type': 'else_clause', 'children': ['139']}; {'id': '139', 'type': 'block', 'children': ['140', '144']}; {'id': '140', 'type': 'expression_statement', 'children': ['141']}; {'id': '141', 'type': 'assignment', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '144', 'type': 'expression_statement', 'children': ['145']}; {'id': '145', 'type': 'assignment', 'children': ['146', '149']}; {'id': '146', 'type': 'pattern_list', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '149', 'type': 'expression_list', 'children': ['150', '151']}; {'id': '150', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '151', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '152', 'type': 'expression_statement', 'children': ['153']}; {'id': '153', 'type': 'call', 'children': ['154', '157']}; {'id': '154', 'type': 'attribute', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'sitems'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '157', 'type': 'argument_list', 'children': ['158']}; {'id': '158', 'type': 'tuple', 'children': ['159', '165', '166']}; {'id': '159', 'type': 'tuple', 'children': ['160', '163', '164']}; {'id': '160', 'type': 'subscript', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'contig_order'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '167', 'type': 'expression_statement', 'children': ['168']}; {'id': '168', 'type': 'call', 'children': ['169', '172']}; {'id': '169', 'type': 'attribute', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'added_fnames'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '172', 'type': 'argument_list', 'children': ['173']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '174', 'type': 'expression_statement', 'children': ['175']}; {'id': '175', 'type': 'call', 'children': ['176', '179']}; {'id': '176', 'type': 'attribute', 'children': ['177', '178']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'sitems'}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '179', 'type': 'argument_list', 'children': []}; {'id': '180', 'type': 'return_statement', 'children': ['181']}; {'id': '181', 'type': 'list_comprehension', 'children': ['182', '189']}; {'id': '182', 'type': 'tuple', 'children': ['183', '186']}; {'id': '183', 'type': 'subscript', 'children': ['184', '185']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '185', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '186', 'type': 'subscript', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '188', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '189', 'type': 'for_in_clause', 'children': ['190', '191']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'sitems'}
Sort a set of regionally split files by region for ordered output.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_file_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'orig_files'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '9', 'type': 'block', 'children': ['10', '20', '46', '102', '117', '130', '155']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sorted_files'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_sort_by_region'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '18', '19']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'orig_files'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '23', 'type': 'list_comprehension', 'children': ['24', '27', '32']}; {'id': '24', 'type': 'tuple', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '31']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sorted_files'}; {'id': '32', 'type': 'if_clause', 'children': ['33']}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '42'], 'value': 'and'}; {'id': '34', 'type': 'call', 'children': ['35', '40']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'vcf_has_variants'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '53', '73', '90']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '52'], 'value': '=='}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '57', 'type': 'list_comprehension', 'children': ['58', '59', '64']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '59', 'type': 'for_in_clause', 'children': ['60', '63']}; {'id': '60', 'type': 'pattern_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sorted_files'}; {'id': '64', 'type': 'if_clause', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '71']}; {'id': '66', 'type': 'attribute', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '73', 'type': 'elif_clause', 'children': ['74', '80']}; {'id': '74', 'type': 'comparison_operator', 'children': ['75', '79'], 'value': '>'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '79', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '80', 'type': 'block', 'children': ['81']}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': '_fix_gatk_header'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88', '89']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '90', 'type': 'else_clause', 'children': ['91']}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '95', 'type': 'list_comprehension', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '97', 'type': 'for_in_clause', 'children': ['98', '101']}; {'id': '98', 'type': 'pattern_list', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'ready_files'}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'run_multicore'}; {'id': '107', 'type': 'argument_list', 'children': ['108', '109', '116']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'p_bgzip_and_index'}; {'id': '109', 'type': 'list_comprehension', 'children': ['110', '113']}; {'id': '110', 'type': 'list', 'children': ['111', '112'], 'value': '[x, config]'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '113', 'type': 'for_in_clause', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'exist_files'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'assignment', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'input_file_list'}; {'id': '120', 'type': 'binary_operator', 'children': ['121', '122'], 'value': '%'}; {'id': '121', 'type': 'string', 'children': [], 'value': '"%s-files.list"'}; {'id': '122', 'type': 'subscript', 'children': ['123', '129']}; {'id': '123', 'type': 'call', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '127', 'type': 'argument_list', 'children': ['128']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '129', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '130', 'type': 'with_statement', 'children': ['131', '141']}; {'id': '131', 'type': 'with_clause', 'children': ['132']}; {'id': '132', 'type': 'with_item', 'children': ['133']}; {'id': '133', 'type': 'as_pattern', 'children': ['134', '139']}; {'id': '134', 'type': 'call', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '136', 'type': 'argument_list', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'input_file_list'}; {'id': '138', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '139', 'type': 'as_pattern_target', 'children': ['140']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '141', 'type': 'block', 'children': ['142']}; {'id': '142', 'type': 'for_statement', 'children': ['143', '144', '145']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'ready_files'}; {'id': '145', 'type': 'block', 'children': ['146']}; {'id': '146', 'type': 'expression_statement', 'children': ['147']}; {'id': '147', 'type': 'call', 'children': ['148', '151']}; {'id': '148', 'type': 'attribute', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '151', 'type': 'argument_list', 'children': ['152']}; {'id': '152', 'type': 'binary_operator', 'children': ['153', '154'], 'value': '+'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '154', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '155', 'type': 'return_statement', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'input_file_list'}
Create file with region sorted list of non-empty VCFs for concatenating.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_ref'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'vcf_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '148']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '10', 'type': 'binary_operator', 'children': ['11', '12'], 'value': '%'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"%s-prep.vcf.gz"'}; {'id': '12', 'type': 'subscript', 'children': ['13', '19']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'vcf_file'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '29']}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'file_uptodate'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'vcf_file'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'with_statement', 'children': ['31', '41']}; {'id': '31', 'type': 'with_clause', 'children': ['32']}; {'id': '32', 'type': 'with_item', 'children': ['33']}; {'id': '33', 'type': 'as_pattern', 'children': ['34', '39']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'file_transaction'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '39', 'type': 'as_pattern_target', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '41', 'type': 'block', 'children': ['42', '55', '115']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'header_file'}; {'id': '45', 'type': 'binary_operator', 'children': ['46', '47'], 'value': '%'}; {'id': '46', 'type': 'string', 'children': [], 'value': '"%s-header.txt"'}; {'id': '47', 'type': 'subscript', 'children': ['48', '54']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'splitext_plus'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '55', 'type': 'with_statement', 'children': ['56', '66']}; {'id': '56', 'type': 'with_clause', 'children': ['57']}; {'id': '57', 'type': 'with_item', 'children': ['58']}; {'id': '58', 'type': 'as_pattern', 'children': ['59', '64']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'header_file'}; {'id': '63', 'type': 'string', 'children': [], 'value': '"w"'}; {'id': '64', 'type': 'as_pattern_target', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'for_statement', 'children': ['68', '69', '83']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'ref'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'file_contigs'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '80']}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'get_ref_file'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'out_handle'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '107']}; {'id': '90', 'type': 'ERROR', 'children': ['91', '100', '105']}; {'id': '91', 'type': 'attribute', 'children': ['92', '97', '99']}; {'id': '92', 'type': 'concatenated_string', 'children': ['93', '94', '96']}; {'id': '93', 'type': 'string', 'children': [], 'value': '"\n cat_cmd = "'}; {'id': '94', 'type': 'ERROR', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'zcat'}; {'id': '96', 'type': 'string', 'children': [], 'value': '" if vcf_file.endswith("'}; {'id': '97', 'type': 'ERROR', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'vcf'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'gz'}; {'id': '100', 'type': 'concatenated_string', 'children': ['101', '102', '104']}; {'id': '101', 'type': 'string', 'children': [], 'value': '") else "'}; {'id': '102', 'type': 'ERROR', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'cat'}; {'id': '104', 'type': 'string', 'children': [], 'value': '"\n cmd = ("'}; {'id': '105', 'type': 'set', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'cat_cmd'}; {'id': '107', 'type': 'binary_operator', 'children': ['108', '110'], 'value': '|'}; {'id': '108', 'type': 'set', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'vcf_file'}; {'id': '110', 'type': 'binary_operator', 'children': ['111', '114'], 'value': '^'}; {'id': '111', 'type': 'binary_operator', 'children': ['112', '113'], 'value': '-'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'grep'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '114', 'type': 'string', 'children': [], 'value': '"vt sort -m full -o {tx_out_file} -"'}; {'id': '115', 'type': 'with_statement', 'children': ['116', '131']}; {'id': '116', 'type': 'with_clause', 'children': ['117']}; {'id': '117', 'type': 'with_item', 'children': ['118']}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'chdir'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'call', 'children': ['124', '129']}; {'id': '124', 'type': 'attribute', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '129', 'type': 'argument_list', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'tx_out_file'}; {'id': '131', 'type': 'block', 'children': ['132']}; {'id': '132', 'type': 'expression_statement', 'children': ['133']}; {'id': '133', 'type': 'call', 'children': ['134', '137']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'do'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '137', 'type': 'argument_list', 'children': ['138', '147']}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'cmd'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'dictionary_splat', 'children': ['144']}; {'id': '144', 'type': 'call', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'locals'}; {'id': '146', 'type': 'argument_list', 'children': []}; {'id': '147', 'type': 'string', 'children': [], 'value': '"Sort VCF by reference"'}; {'id': '148', 'type': 'return_statement', 'children': ['149']}; {'id': '149', 'type': 'call', 'children': ['150', '151']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'bgzip_and_index'}; {'id': '151', 'type': 'argument_list', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '153', 'type': 'subscript', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '155', 'type': 'string', 'children': [], 'value': '"config"'}
Sort a VCF file by genome reference and position, adding contig information.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'align_to_sort_bam'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fastq2'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '8', 'type': 'block', 'children': ['9', '15', '28', '47', '55', '72', '85', '122', '211']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '12', 'type': 'subscript', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '14', 'type': 'string', 'children': [], 'value': '"rgnames"'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'align_dir_parts'}; {'id': '18', 'type': 'list', 'children': ['19', '24', '25'], 'value': '[data["dirs"]["work"], "align", names["sample"]]'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"dirs"'}; {'id': '23', 'type': 'string', 'children': [], 'value': '"work"'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"align"'}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"sample"'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '35']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': '"disambiguate"'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'align_dir_parts'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'subscript', 'children': ['43', '46']}; {'id': '43', 'type': 'subscript', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '45', 'type': 'string', 'children': [], 'value': '"disambiguate"'}; {'id': '46', 'type': 'string', 'children': [], 'value': '"genome_build"'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'aligner_index'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': '_get_aligner_index'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'align_dir'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'safe_makedir'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '69']}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'list_splat', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'align_dir_parts'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '75', 'type': 'call', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'tz'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'get_in'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '84']}; {'id': '80', 'type': 'tuple', 'children': ['81', '82', '83']}; {'id': '81', 'type': 'string', 'children': [], 'value': '"reference"'}; {'id': '82', 'type': 'string', 'children': [], 'value': '"fasta"'}; {'id': '83', 'type': 'string', 'children': [], 'value': '"base"'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '85', 'type': 'if_statement', 'children': ['86', '92', '106']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'string', 'children': [], 'value': '".bam"'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': '_align_from_bam'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '100', '101', '102', '103', '104', '105']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'aligner_index'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'align_dir'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '106', 'type': 'else_clause', 'children': ['107']}; {'id': '107', 'type': 'block', 'children': ['108']}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': '_align_from_fastq'}; {'id': '113', 'type': 'argument_list', 'children': ['114', '115', '116', '117', '118', '119', '120', '121']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'fastq2'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'aligner_index'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'ref_file'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'align_dir'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '122', 'type': 'if_statement', 'children': ['123', '135']}; {'id': '123', 'type': 'boolean_operator', 'children': ['124', '127'], 'value': 'and'}; {'id': '124', 'type': 'subscript', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '126', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '127', 'type': 'call', 'children': ['128', '131']}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'subscript', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '134', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '135', 'type': 'block', 'children': ['136', '175']}; {'id': '136', 'type': 'if_statement', 'children': ['137', '150', '161']}; {'id': '137', 'type': 'boolean_operator', 'children': ['138', '144'], 'value': 'and'}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'string', 'children': [], 'value': '"align_split"'}; {'id': '144', 'type': 'call', 'children': ['145', '148']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'get_mark_duplicates'}; {'id': '148', 'type': 'argument_list', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '150', 'type': 'block', 'children': ['151']}; {'id': '151', 'type': 'expression_statement', 'children': ['152']}; {'id': '152', 'type': 'call', 'children': ['153', '156']}; {'id': '153', 'type': 'attribute', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'fake_index'}; {'id': '156', 'type': 'argument_list', 'children': ['157', '160']}; {'id': '157', 'type': 'subscript', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '159', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '161', 'type': 'else_clause', 'children': ['162']}; {'id': '162', 'type': 'block', 'children': ['163']}; {'id': '163', 'type': 'expression_statement', 'children': ['164']}; {'id': '164', 'type': 'call', 'children': ['165', '168']}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '168', 'type': 'argument_list', 'children': ['169', '172']}; {'id': '169', 'type': 'subscript', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '171', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '172', 'type': 'subscript', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '174', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '175', 'type': 'for_statement', 'children': ['176', '177', '180']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'extra'}; {'id': '177', 'type': 'list', 'children': ['178', '179'], 'value': '["-sr", "-disc"]'}; {'id': '178', 'type': 'string', 'children': [], 'value': '"-sr"'}; {'id': '179', 'type': 'string', 'children': [], 'value': '"-disc"'}; {'id': '180', 'type': 'block', 'children': ['181', '193']}; {'id': '181', 'type': 'expression_statement', 'children': ['182']}; {'id': '182', 'type': 'assignment', 'children': ['183', '184']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'extra_bam'}; {'id': '184', 'type': 'call', 'children': ['185', '188']}; {'id': '185', 'type': 'attribute', 'children': ['186', '187']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'append_stem'}; {'id': '188', 'type': 'argument_list', 'children': ['189', '192']}; {'id': '189', 'type': 'subscript', 'children': ['190', '191']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '191', 'type': 'string', 'children': [], 'value': "'work_bam'"}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'extra'}; {'id': '193', 'type': 'if_statement', 'children': ['194', '200']}; {'id': '194', 'type': 'call', 'children': ['195', '198']}; {'id': '195', 'type': 'attribute', 'children': ['196', '197']}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'file_exists'}; {'id': '198', 'type': 'argument_list', 'children': ['199']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'extra_bam'}; {'id': '200', 'type': 'block', 'children': ['201']}; {'id': '201', 'type': 'expression_statement', 'children': ['202']}; {'id': '202', 'type': 'call', 'children': ['203', '206']}; {'id': '203', 'type': 'attribute', 'children': ['204', '205']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '206', 'type': 'argument_list', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'extra_bam'}; {'id': '208', 'type': 'subscript', 'children': ['209', '210']}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '210', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '211', 'type': 'return_statement', 'children': ['212']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'data'}
Align to the named genome build, returning a sorted BAM file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_align_from_fastq'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '10', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fastq2'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'align_ref'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sam_ref'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'align_dir'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '12', 'type': 'block', 'children': ['13', '19', '27', '39']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '16', 'type': 'subscript', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"config"'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'align_fn'}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'TOOLS'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'aligner'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'align_fn'}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'align_fn'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '34', '35', '36', '37', '38']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'fastq1'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'fastq2'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'align_ref'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'align_dir'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '45', '68']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '45', 'type': 'block', 'children': ['46', '66']}; {'id': '46', 'type': 'assert_statement', 'children': ['47', '53']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '53', 'type': 'tuple', 'children': ['54', '60']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'dd'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'get_sample_name'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '68', 'type': 'else_clause', 'children': ['69']}; {'id': '69', 'type': 'block', 'children': ['70', '80', '92']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'work_bam'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'sam_to_bam'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '85']}; {'id': '82', 'type': 'subscript', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '84', 'type': 'string', 'children': [], 'value': '"work_bam"'}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'bam'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '89', 'type': 'argument_list', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'work_bam'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '92', 'type': 'return_statement', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'data'}
Align from fastq inputs, producing sorted BAM output.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'gather_command_line_options'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filter_disabled'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '22', '40']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'filter_disabled'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'filter_disabled'}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'SETTINGS'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'COMMAND_LINE'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'SHOW_DISABLED_OPTIONS'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '25', 'type': 'list_comprehension', 'children': ['26', '27', '33']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'get_inheritors'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'CommandLineOption'}; {'id': '33', 'type': 'if_clause', 'children': ['34']}; {'id': '34', 'type': 'boolean_operator', 'children': ['35', '37'], 'value': 'or'}; {'id': '35', 'type': 'not_operator', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'filter_disabled'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_enabled'}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '47', 'type': 'lambda', 'children': ['48', '50']}; {'id': '48', 'type': 'lambda_parameters', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'opt'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '__name__'}
Get a sorted list of all CommandLineOption subclasses.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'AddShapePointObjectUnsorted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '7', 'type': 'block', 'children': ['8', '70', '100', '199', '216', '228', '240']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '29', '39', '54']}; {'id': '9', 'type': '()', 'children': ['10']}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '19'], 'value': 'or'}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '18'], 'value': '=='}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '23'], 'value': '>='}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '23', 'type': 'subscript', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '27', 'type': 'unary_operator', 'children': ['28'], 'value': '-'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '39', 'type': 'elif_clause', 'children': ['40', '49']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '44'], 'value': '<='}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '44', 'type': 'subscript', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '54', 'type': 'else_clause', 'children': ['55']}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'bisect'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'bisect'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '70', 'type': 'if_statement', 'children': ['71', '78']}; {'id': '71', 'type': 'comparison_operator', 'children': ['72', '75'], 'value': 'in'}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'InvalidValue'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '86', '89']}; {'id': '85', 'type': 'string', 'children': [], 'value': "'shape_pt_sequence'"}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '89', 'type': 'binary_operator', 'children': ['90', '93'], 'value': '%'}; {'id': '90', 'type': 'concatenated_string', 'children': ['91', '92']}; {'id': '91', 'type': 'string', 'children': [], 'value': "'The sequence number %d occurs more than once in '"}; {'id': '92', 'type': 'string', 'children': [], 'value': "'shape %s.'"}; {'id': '93', 'type': 'tuple', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'shape_id'}; {'id': '100', 'type': 'if_statement', 'children': ['101', '115']}; {'id': '101', 'type': 'boolean_operator', 'children': ['102', '107'], 'value': 'and'}; {'id': '102', 'type': 'comparison_operator', 'children': ['103', '106'], 'value': 'is'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '106', 'type': 'None', 'children': []}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '114'], 'value': '>'}; {'id': '108', 'type': 'call', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '114', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '115', 'type': 'block', 'children': ['116', '158']}; {'id': '116', 'type': 'if_statement', 'children': ['117', '136']}; {'id': '117', 'type': '()', 'children': ['118']}; {'id': '118', 'type': 'boolean_operator', 'children': ['119', '127'], 'value': 'and'}; {'id': '119', 'type': 'comparison_operator', 'children': ['120', '121'], 'value': '!='}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '123', 'type': 'argument_list', 'children': ['124']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '127', 'type': 'comparison_operator', 'children': ['128', '131'], 'value': '>'}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '131', 'type': 'subscript', 'children': ['132', '135']}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '136', 'type': 'block', 'children': ['137']}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'InvalidValue'}; {'id': '142', 'type': 'argument_list', 'children': ['143', '144', '147']}; {'id': '143', 'type': 'string', 'children': [], 'value': "'shape_dist_traveled'"}; {'id': '144', 'type': 'attribute', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '147', 'type': 'binary_operator', 'children': ['148', '153'], 'value': '%'}; {'id': '148', 'type': 'concatenated_string', 'children': ['149', '150', '151', '152']}; {'id': '149', 'type': 'string', 'children': [], 'value': "'Each subsequent point in a shape should have '"}; {'id': '150', 'type': 'string', 'children': [], 'value': "'a distance value that shouldn\\'t be larger '"}; {'id': '151', 'type': 'string', 'children': [], 'value': "'than the next ones. In this case, the next '"}; {'id': '152', 'type': 'string', 'children': [], 'value': "'distance was %f.'"}; {'id': '153', 'type': 'subscript', 'children': ['154', '157']}; {'id': '154', 'type': 'attribute', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '158', 'type': 'if_statement', 'children': ['159', '175']}; {'id': '159', 'type': '()', 'children': ['160']}; {'id': '160', 'type': 'boolean_operator', 'children': ['161', '164'], 'value': 'and'}; {'id': '161', 'type': 'comparison_operator', 'children': ['162', '163'], 'value': '>'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '163', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '164', 'type': 'comparison_operator', 'children': ['165', '168'], 'value': '<'}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '168', 'type': 'subscript', 'children': ['169', '172']}; {'id': '169', 'type': 'attribute', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '172', 'type': 'binary_operator', 'children': ['173', '174'], 'value': '-'}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '174', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '175', 'type': 'block', 'children': ['176']}; {'id': '176', 'type': 'expression_statement', 'children': ['177']}; {'id': '177', 'type': 'call', 'children': ['178', '181']}; {'id': '178', 'type': 'attribute', 'children': ['179', '180']}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'InvalidValue'}; {'id': '181', 'type': 'argument_list', 'children': ['182', '183', '186']}; {'id': '182', 'type': 'string', 'children': [], 'value': "'shape_dist_traveled'"}; {'id': '183', 'type': 'attribute', 'children': ['184', '185']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '186', 'type': 'binary_operator', 'children': ['187', '192'], 'value': '%'}; {'id': '187', 'type': 'concatenated_string', 'children': ['188', '189', '190', '191']}; {'id': '188', 'type': 'string', 'children': [], 'value': "'Each subsequent point in a shape should have '"}; {'id': '189', 'type': 'string', 'children': [], 'value': "'a distance value that\\'s at least as large as '"}; {'id': '190', 'type': 'string', 'children': [], 'value': "'the previous ones. In this case, the previous '"}; {'id': '191', 'type': 'string', 'children': [], 'value': "'distance was %f.'"}; {'id': '192', 'type': 'subscript', 'children': ['193', '196']}; {'id': '193', 'type': 'attribute', 'children': ['194', '195']}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '196', 'type': 'binary_operator', 'children': ['197', '198'], 'value': '-'}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '198', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '199', 'type': 'if_statement', 'children': ['200', '207']}; {'id': '200', 'type': 'comparison_operator', 'children': ['201', '204'], 'value': '>'}; {'id': '201', 'type': 'attribute', 'children': ['202', '203']}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '204', 'type': 'attribute', 'children': ['205', '206']}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'max_distance'}; {'id': '207', 'type': 'block', 'children': ['208']}; {'id': '208', 'type': 'expression_statement', 'children': ['209']}; {'id': '209', 'type': 'assignment', 'children': ['210', '213']}; {'id': '210', 'type': 'attribute', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'max_distance'}; {'id': '213', 'type': 'attribute', 'children': ['214', '215']}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '216', 'type': 'expression_statement', 'children': ['217']}; {'id': '217', 'type': 'call', 'children': ['218', '223']}; {'id': '218', 'type': 'attribute', 'children': ['219', '222']}; {'id': '219', 'type': 'attribute', 'children': ['220', '221']}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '221', 'type': 'identifier', 'children': [], 'value': 'sequence'}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '223', 'type': 'argument_list', 'children': ['224', '225']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '225', 'type': 'attribute', 'children': ['226', '227']}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'shape_pt_sequence'}; {'id': '228', 'type': 'expression_statement', 'children': ['229']}; {'id': '229', 'type': 'call', 'children': ['230', '235']}; {'id': '230', 'type': 'attribute', 'children': ['231', '234']}; {'id': '231', 'type': 'attribute', 'children': ['232', '233']}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '235', 'type': 'argument_list', 'children': ['236', '237']}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '237', 'type': 'attribute', 'children': ['238', '239']}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '240', 'type': 'expression_statement', 'children': ['241']}; {'id': '241', 'type': 'call', 'children': ['242', '247']}; {'id': '242', 'type': 'attribute', 'children': ['243', '246']}; {'id': '243', 'type': 'attribute', 'children': ['244', '245']}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '245', 'type': 'identifier', 'children': [], 'value': 'points'}; {'id': '246', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '247', 'type': 'argument_list', 'children': ['248', '249']}; {'id': '248', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '249', 'type': 'tuple', 'children': ['250', '253', '256']}; {'id': '250', 'type': 'attribute', 'children': ['251', '252']}; {'id': '251', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '252', 'type': 'identifier', 'children': [], 'value': 'shape_pt_lat'}; {'id': '253', 'type': 'attribute', 'children': ['254', '255']}; {'id': '254', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '255', 'type': 'identifier', 'children': [], 'value': 'shape_pt_lon'}; {'id': '256', 'type': 'attribute', 'children': ['257', '258']}; {'id': '257', 'type': 'identifier', 'children': [], 'value': 'shapepoint'}; {'id': '258', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}
Insert a point into a correct position by sequence.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetStopTimes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '21', '37', '41', '51', '62', '138']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '12', 'type': 'call', 'children': ['13', '20']}; {'id': '13', 'type': 'attribute', 'children': ['14', '19']}; {'id': '14', 'type': 'attribute', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_schedule'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_connection'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '33']}; {'id': '27', 'type': 'concatenated_string', 'children': ['28', '29', '30', '31', '32']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'SELECT arrival_secs,departure_secs,stop_headsign,pickup_type,'"}; {'id': '29', 'type': 'string', 'children': [], 'value': "'drop_off_type,shape_dist_traveled,stop_id,stop_sequence,timepoint '"}; {'id': '30', 'type': 'string', 'children': [], 'value': "'FROM stop_times '"}; {'id': '31', 'type': 'string', 'children': [], 'value': "'WHERE trip_id=? '"}; {'id': '32', 'type': 'string', 'children': [], 'value': "'ORDER BY stop_sequence'"}; {'id': '33', 'type': 'tuple', 'children': ['34']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'trip_id'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'stop_times'}; {'id': '40', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'stoptime_class'}; {'id': '44', 'type': 'attribute', 'children': ['45', '50']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'GetGtfsFactory'}; {'id': '49', 'type': 'argument_list', 'children': []}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'StopTime'}; {'id': '51', 'type': 'if_statement', 'children': ['52', '55']}; {'id': '52', 'type': 'comparison_operator', 'children': ['53', '54'], 'value': 'is'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '54', 'type': 'None', 'children': []}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'problems_module'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'default_problem_reporter'}; {'id': '62', 'type': 'for_statement', 'children': ['63', '64', '69']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'fetchall'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'block', 'children': ['70', '83']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '73', 'type': 'call', 'children': ['74', '79']}; {'id': '74', 'type': 'attribute', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '_schedule'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'GetStop'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '82', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'stop_times'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'stoptime_class'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '95', '98', '103', '108', '113', '118', '123', '128', '133']}; {'id': '92', 'type': 'keyword_argument', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'problems'}; {'id': '95', 'type': 'keyword_argument', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '98', 'type': 'keyword_argument', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'arrival_secs'}; {'id': '100', 'type': 'subscript', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '102', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '103', 'type': 'keyword_argument', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'departure_secs'}; {'id': '105', 'type': 'subscript', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '107', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '108', 'type': 'keyword_argument', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'stop_headsign'}; {'id': '110', 'type': 'subscript', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '112', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '113', 'type': 'keyword_argument', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'pickup_type'}; {'id': '115', 'type': 'subscript', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '117', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '118', 'type': 'keyword_argument', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'drop_off_type'}; {'id': '120', 'type': 'subscript', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '122', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '123', 'type': 'keyword_argument', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'shape_dist_traveled'}; {'id': '125', 'type': 'subscript', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '127', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '128', 'type': 'keyword_argument', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'stop_sequence'}; {'id': '130', 'type': 'subscript', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '132', 'type': 'integer', 'children': [], 'value': '7'}; {'id': '133', 'type': 'keyword_argument', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'timepoint'}; {'id': '135', 'type': 'subscript', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '137', 'type': 'integer', 'children': [], 'value': '8'}; {'id': '138', 'type': 'return_statement', 'children': ['139']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'stop_times'}
Return a sorted list of StopTime objects for this trip.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_line'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '7', 'type': 'block', 'children': ['8', '18', '24']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '11', 'type': 'subscript', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'in_lines'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'augmented_assignment', 'children': ['20', '23'], 'value': '+='}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'line'}
Returns the current line from the file while incrementing the index.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '22', '24']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_add_comments'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '17']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'comments'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'generic_type', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Optional'}; {'id': '10', 'type': 'type_parameter', 'children': ['11']}; {'id': '11', 'type': 'type', 'children': ['12']}; {'id': '12', 'type': 'generic_type', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Sequence'}; {'id': '14', 'type': 'type_parameter', 'children': ['15']}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '17', 'type': 'typed_default_parameter', 'children': ['18', '19', '21']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'original_string'}; {'id': '19', 'type': 'type', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '21', 'type': 'string', 'children': [], 'value': '""'}; {'id': '22', 'type': 'type', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '24', 'type': 'block', 'children': ['25', '41']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '31']}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'ignore_comments'"}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'subscript', 'children': ['34', '40']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_strip_comments'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'original_string'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '41', 'type': 'if_statement', 'children': ['42', '44', '47']}; {'id': '42', 'type': 'not_operator', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'comments'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'original_string'}; {'id': '47', 'type': 'else_clause', 'children': ['48']}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"{0}{1} {2}"'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '63', '68']}; {'id': '55', 'type': 'subscript', 'children': ['56', '62']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_strip_comments'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'original_string'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '63', 'type': 'subscript', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'comment_prefix'"}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': '"; "'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'comments'}
Returns a string with comments added if ignore_comments is not set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_wrap'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '11', 'type': 'block', 'children': ['12', '20', '370']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'wrap_mode'}; {'id': '15', 'type': 'subscript', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'multi_line_output'"}; {'id': '20', 'type': 'if_statement', 'children': ['21', '37', '333']}; {'id': '21', 'type': 'boolean_operator', 'children': ['22', '32'], 'value': 'and'}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '27'], 'value': '>'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '27', 'type': 'subscript', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'line_length'"}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': '!='}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'wrap_mode'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'WrapModes'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'NOQA'}; {'id': '37', 'type': 'block', 'children': ['38', '42', '46']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'line_without_comment'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'comment'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'if_statement', 'children': ['47', '56']}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '49', '52'], 'value': 'in'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'\n line_without_comment, comment = line.split('"}; {'id': '49', 'type': 'ERROR', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'for'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '52', 'type': 'tuple', 'children': ['53', '54', '55']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"import "'}; {'id': '54', 'type': 'string', 'children': [], 'value': '"."'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"as "'}; {'id': '56', 'type': 'block', 'children': ['57', '70']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '69'], 'value': '+'}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '63'], 'value': '+'}; {'id': '62', 'type': 'string', 'children': [], 'value': 'r"\\b"'}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'escape'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '69', 'type': 'string', 'children': [], 'value': 'r"\\b"'}; {'id': '70', 'type': 'if_statement', 'children': ['71', '90']}; {'id': '71', 'type': 'boolean_operator', 'children': ['72', '79'], 'value': 'and'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '76', 'type': 'argument_list', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'line_without_comment'}; {'id': '79', 'type': 'not_operator', 'children': ['80']}; {'id': '80', 'type': 'call', 'children': ['81', '88']}; {'id': '81', 'type': 'attribute', 'children': ['82', '87']}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'line_without_comment'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '86', 'type': 'argument_list', 'children': []}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '90', 'type': 'block', 'children': ['91', '101', '115', '159', '171', '195', '321']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'line_parts'}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'exp'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'line_without_comment'}; {'id': '101', 'type': 'if_statement', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'comment'}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'assignment', 'children': ['106', '110', '114']}; {'id': '106', 'type': 'subscript', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'line_parts'}; {'id': '108', 'type': 'unary_operator', 'children': ['109'], 'value': '-'}; {'id': '109', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '110', 'type': 'ERROR', 'children': ['111', '113']}; {'id': '111', 'type': 'interpolation', 'children': ['112']}; {'id': '112', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'next_line'}; {'id': '114', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '115', 'type': 'while_statement', 'children': ['116', '138']}; {'id': '116', 'type': 'boolean_operator', 'children': ['117', '137'], 'value': 'and'}; {'id': '117', 'type': 'comparison_operator', 'children': ['118', '125'], 'value': '>'}; {'id': '118', 'type': '()', 'children': ['119']}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '124'], 'value': '+'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '124', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '125', 'type': '()', 'children': ['126']}; {'id': '126', 'type': 'boolean_operator', 'children': ['127', '132'], 'value': 'or'}; {'id': '127', 'type': 'subscript', 'children': ['128', '131']}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '131', 'type': 'string', 'children': [], 'value': "'wrap_length'"}; {'id': '132', 'type': 'subscript', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '136', 'type': 'string', 'children': [], 'value': "'line_length'"}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'line_parts'}; {'id': '138', 'type': 'block', 'children': ['139', '150']}; {'id': '139', 'type': 'expression_statement', 'children': ['140']}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'next_line'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'line_parts'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '149', 'type': 'argument_list', 'children': []}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'assignment', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '153', 'type': 'call', 'children': ['154', '157']}; {'id': '154', 'type': 'attribute', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '157', 'type': 'argument_list', 'children': ['158']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'line_parts'}; {'id': '159', 'type': 'if_statement', 'children': ['160', '162']}; {'id': '160', 'type': 'not_operator', 'children': ['161']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '162', 'type': 'block', 'children': ['163']}; {'id': '163', 'type': 'expression_statement', 'children': ['164']}; {'id': '164', 'type': 'assignment', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '166', 'type': 'call', 'children': ['167', '170']}; {'id': '167', 'type': 'attribute', 'children': ['168', '169']}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'next_line'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '170', 'type': 'argument_list', 'children': []}; {'id': '171', 'type': 'expression_statement', 'children': ['172']}; {'id': '172', 'type': 'assignment', 'children': ['173', '174']}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'cont_line'}; {'id': '174', 'type': 'call', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': '_wrap'}; {'id': '178', 'type': 'argument_list', 'children': ['179']}; {'id': '179', 'type': 'binary_operator', 'children': ['180', '185'], 'value': '+'}; {'id': '180', 'type': 'subscript', 'children': ['181', '184']}; {'id': '181', 'type': 'attribute', 'children': ['182', '183']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '184', 'type': 'string', 'children': [], 'value': "'indent'"}; {'id': '185', 'type': 'call', 'children': ['186', '194']}; {'id': '186', 'type': 'attribute', 'children': ['187', '193']}; {'id': '187', 'type': 'call', 'children': ['188', '191']}; {'id': '188', 'type': 'attribute', 'children': ['189', '190']}; {'id': '189', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '191', 'type': 'argument_list', 'children': ['192']}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'next_line'}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'lstrip'}; {'id': '194', 'type': 'argument_list', 'children': []}; {'id': '195', 'type': 'if_statement', 'children': ['196', '201']}; {'id': '196', 'type': 'subscript', 'children': ['197', '200']}; {'id': '197', 'type': 'attribute', 'children': ['198', '199']}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '200', 'type': 'string', 'children': [], 'value': "'use_parentheses'"}; {'id': '201', 'type': 'block', 'children': ['202', '238', '249', '312']}; {'id': '202', 'type': 'expression_statement', 'children': ['203']}; {'id': '203', 'type': 'assignment', 'children': ['204', '205']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '205', 'type': 'call', 'children': ['206', '209']}; {'id': '206', 'type': 'attribute', 'children': ['207', '208']}; {'id': '207', 'type': 'string', 'children': [], 'value': '"{0}{1}({2}{3}{4}{5})"'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '209', 'type': 'argument_list', 'children': ['210', '211', '212', '215', '216', '224']}; {'id': '210', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '212', 'type': 'attribute', 'children': ['213', '214']}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'line_separator'}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'cont_line'}; {'id': '216', 'type': 'conditional_expression', 'children': ['217', '218', '223'], 'value': 'if'}; {'id': '217', 'type': 'string', 'children': [], 'value': '","'}; {'id': '218', 'type': 'subscript', 'children': ['219', '222']}; {'id': '219', 'type': 'attribute', 'children': ['220', '221']}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '221', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '222', 'type': 'string', 'children': [], 'value': "'include_trailing_comma'"}; {'id': '223', 'type': 'string', 'children': [], 'value': '""'}; {'id': '224', 'type': 'conditional_expression', 'children': ['225', '228', '237'], 'value': 'if'}; {'id': '225', 'type': 'attribute', 'children': ['226', '227']}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'line_separator'}; {'id': '228', 'type': 'comparison_operator', 'children': ['229', '230'], 'value': 'in'}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'wrap_mode'}; {'id': '230', 'type': 'set', 'children': ['231', '234']}; {'id': '231', 'type': 'attribute', 'children': ['232', '233']}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 'WrapModes'}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'VERTICAL_HANGING_INDENT'}; {'id': '234', 'type': 'attribute', 'children': ['235', '236']}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'WrapModes'}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'VERTICAL_GRID_GROUPED'}; {'id': '237', 'type': 'string', 'children': [], 'value': '""'}; {'id': '238', 'type': 'expression_statement', 'children': ['239']}; {'id': '239', 'type': 'assignment', 'children': ['240', '241']}; {'id': '240', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '241', 'type': 'call', 'children': ['242', '245']}; {'id': '242', 'type': 'attribute', 'children': ['243', '244']}; {'id': '243', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '245', 'type': 'argument_list', 'children': ['246']}; {'id': '246', 'type': 'attribute', 'children': ['247', '248']}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '248', 'type': 'identifier', 'children': [], 'value': 'line_separator'}; {'id': '249', 'type': 'if_statement', 'children': ['250', '270']}; {'id': '250', 'type': 'boolean_operator', 'children': ['251', '261'], 'value': 'and'}; {'id': '251', 'type': 'comparison_operator', 'children': ['252', '257'], 'value': 'in'}; {'id': '252', 'type': 'subscript', 'children': ['253', '256']}; {'id': '253', 'type': 'attribute', 'children': ['254', '255']}; {'id': '254', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '255', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '256', 'type': 'string', 'children': [], 'value': "'comment_prefix'"}; {'id': '257', 'type': 'subscript', 'children': ['258', '259']}; {'id': '258', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '259', 'type': 'unary_operator', 'children': ['260'], 'value': '-'}; {'id': '260', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '261', 'type': 'call', 'children': ['262', '268']}; {'id': '262', 'type': 'attribute', 'children': ['263', '267']}; {'id': '263', 'type': 'subscript', 'children': ['264', '265']}; {'id': '264', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '265', 'type': 'unary_operator', 'children': ['266'], 'value': '-'}; {'id': '266', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '267', 'type': 'identifier', 'children': [], 'value': 'endswith'}; {'id': '268', 'type': 'argument_list', 'children': ['269']}; {'id': '269', 'type': 'string', 'children': [], 'value': "')'"}; {'id': '270', 'type': 'block', 'children': ['271', '290']}; {'id': '271', 'type': 'expression_statement', 'children': ['272']}; {'id': '272', 'type': 'assignment', 'children': ['273', '276']}; {'id': '273', 'type': 'pattern_list', 'children': ['274', '275']}; {'id': '274', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '275', 'type': 'identifier', 'children': [], 'value': 'comment'}; {'id': '276', 'type': 'call', 'children': ['277', '283']}; {'id': '277', 'type': 'attribute', 'children': ['278', '282']}; {'id': '278', 'type': 'subscript', 'children': ['279', '280']}; {'id': '279', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '280', 'type': 'unary_operator', 'children': ['281'], 'value': '-'}; {'id': '281', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '282', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '283', 'type': 'argument_list', 'children': ['284', '289']}; {'id': '284', 'type': 'subscript', 'children': ['285', '288']}; {'id': '285', 'type': 'attribute', 'children': ['286', '287']}; {'id': '286', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '287', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '288', 'type': 'string', 'children': [], 'value': "'comment_prefix'"}; {'id': '289', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '290', 'type': 'expression_statement', 'children': ['291']}; {'id': '291', 'type': 'assignment', 'children': ['292', '296']}; {'id': '292', 'type': 'subscript', 'children': ['293', '294']}; {'id': '293', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '294', 'type': 'unary_operator', 'children': ['295'], 'value': '-'}; {'id': '295', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '296', 'type': 'binary_operator', 'children': ['297', '306'], 'value': '+'}; {'id': '297', 'type': 'binary_operator', 'children': ['298', '301'], 'value': '+'}; {'id': '298', 'type': 'binary_operator', 'children': ['299', '300'], 'value': '+'}; {'id': '299', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '300', 'type': 'string', 'children': [], 'value': "')'"}; {'id': '301', 'type': 'subscript', 'children': ['302', '305']}; {'id': '302', 'type': 'attribute', 'children': ['303', '304']}; {'id': '303', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '304', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '305', 'type': 'string', 'children': [], 'value': "'comment_prefix'"}; {'id': '306', 'type': 'subscript', 'children': ['307', '308']}; {'id': '307', 'type': 'identifier', 'children': [], 'value': 'comment'}; {'id': '308', 'type': 'slice', 'children': ['309', '310']}; {'id': '309', 'type': 'colon', 'children': []}; {'id': '310', 'type': 'unary_operator', 'children': ['311'], 'value': '-'}; {'id': '311', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '312', 'type': 'return_statement', 'children': ['313']}; {'id': '313', 'type': 'call', 'children': ['314', '319']}; {'id': '314', 'type': 'attribute', 'children': ['315', '318']}; {'id': '315', 'type': 'attribute', 'children': ['316', '317']}; {'id': '316', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '317', 'type': 'identifier', 'children': [], 'value': 'line_separator'}; {'id': '318', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '319', 'type': 'argument_list', 'children': ['320']}; {'id': '320', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '321', 'type': 'return_statement', 'children': ['322']}; {'id': '322', 'type': 'call', 'children': ['323', '326']}; {'id': '323', 'type': 'attribute', 'children': ['324', '325']}; {'id': '324', 'type': 'string', 'children': [], 'value': '"{0}{1}\\\\{2}{3}"'}; {'id': '325', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '326', 'type': 'argument_list', 'children': ['327', '328', '329', '332']}; {'id': '327', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '328', 'type': 'identifier', 'children': [], 'value': 'splitter'}; {'id': '329', 'type': 'attribute', 'children': ['330', '331']}; {'id': '330', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '331', 'type': 'identifier', 'children': [], 'value': 'line_separator'}; {'id': '332', 'type': 'identifier', 'children': [], 'value': 'cont_line'}; {'id': '333', 'type': 'elif_clause', 'children': ['334', '352', '369']}; {'id': '334', 'type': 'boolean_operator', 'children': ['335', '345'], 'value': 'and'}; {'id': '335', 'type': 'comparison_operator', 'children': ['336', '340'], 'value': '>'}; {'id': '336', 'type': 'call', 'children': ['337', '338']}; {'id': '337', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '338', 'type': 'argument_list', 'children': ['339']}; {'id': '339', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '340', 'type': 'subscript', 'children': ['341', '344']}; {'id': '341', 'type': 'attribute', 'children': ['342', '343']}; {'id': '342', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '343', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '344', 'type': 'string', 'children': [], 'value': "'line_length'"}; {'id': '345', 'type': 'comparison_operator', 'children': ['346', '347'], 'value': '=='}; {'id': '346', 'type': 'identifier', 'children': [], 'value': 'wrap_mode'}; {'id': '347', 'type': 'attribute', 'children': ['348', '351']}; {'id': '348', 'type': 'attribute', 'children': ['349', '350']}; {'id': '349', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '350', 'type': 'identifier', 'children': [], 'value': 'WrapModes'}; {'id': '351', 'type': 'identifier', 'children': [], 'value': 'NOQA'}; {'id': '352', 'type': 'ERROR', 'children': ['353', '360']}; {'id': '353', 'type': 'ERROR', 'children': ['354', '355', '357', '359']}; {'id': '354', 'type': 'string', 'children': [], 'value': '"\n return "'}; {'id': '355', 'type': 'set', 'children': ['356']}; {'id': '356', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '357', 'type': 'set', 'children': ['358']}; {'id': '358', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '359', 'type': 'identifier', 'children': [], 'value': 'NOQA'}; {'id': '360', 'type': 'call', 'children': ['361', '362']}; {'id': '361', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '362', 'type': 'argument_list', 'children': ['363', '364']}; {'id': '363', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '364', 'type': 'subscript', 'children': ['365', '368']}; {'id': '365', 'type': 'attribute', 'children': ['366', '367']}; {'id': '366', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '367', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '368', 'type': 'string', 'children': [], 'value': "'comment_prefix'"}; {'id': '369', 'type': 'block', 'children': [], 'value': ''}; {'id': '370', 'type': 'return_statement', 'children': ['371']}; {'id': '371', 'type': 'identifier', 'children': [], 'value': 'line'}
Returns an import wrapped to the specified line-length, if possible.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortby'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '19', '34']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'reldepth'"}; {'id': '10', 'type': 'subscript', 'children': ['11', '18']}; {'id': '11', 'type': 'attribute', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'gosubdag'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'prt_attr'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'flds'"}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'list', 'children': ['22', '25', '31'], 'value': '[ntd.NS, -1*ntd.dcnt, ntd.reldepth]'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'NS'}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '28'], 'value': '*'}; {'id': '26', 'type': 'unary_operator', 'children': ['27'], 'value': '-'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dcnt'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'reldepth'}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'list', 'children': ['38', '41', '47'], 'value': '[ntd.NS, -1*ntd.dcnt, ntd.depth]'}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'NS'}; {'id': '41', 'type': 'binary_operator', 'children': ['42', '44'], 'value': '*'}; {'id': '42', 'type': 'unary_operator', 'children': ['43'], 'value': '-'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'dcnt'}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'ntd'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'depth'}
Return function for sorting.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_nts_sorted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '8', 'type': 'block', 'children': ['9', '13', '23']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'nts_flat'}; {'id': '12', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_sorted_hdrgo2usrgos'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20', '21', '22']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'nts_flat'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'nts_flat'}
Return a flat list of grouped and sorted GO terms.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sorted_hdrgo2usrgos'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'flat_list'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '11', 'type': 'True', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '14', 'type': 'True', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '20', '30', '39', '68', '182']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sorted_hdrgos_usrgos'}; {'id': '19', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'h2u_get'}; {'id': '23', 'type': 'attribute', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'hdrgo2usrgos'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'hdr_go2nt'}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_get_go2nt'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '43']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': 'is'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '42', 'type': 'True', 'children': []}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'hdr_go2nt'}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '55']}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'hdr_go2nt'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '54', 'type': 'argument_list', 'children': []}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '57', 'type': 'lambda', 'children': ['58', '60']}; {'id': '58', 'type': 'lambda_parameters', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sortby'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '68', 'type': 'for_statement', 'children': ['69', '72', '73']}; {'id': '69', 'type': 'pattern_list', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'hdrgo_id'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'hdrgo_nt'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'hdr_go2nt'}; {'id': '73', 'type': 'block', 'children': ['74', '97', '104']}; {'id': '74', 'type': 'if_statement', 'children': ['75', '78']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'is'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'flat_list'}; {'id': '77', 'type': 'None', 'children': []}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'if_statement', 'children': ['80', '89']}; {'id': '80', 'type': 'boolean_operator', 'children': ['81', '82'], 'value': 'or'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '82', 'type': 'comparison_operator', 'children': ['83', '84'], 'value': 'in'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'hdrgo_id'}; {'id': '84', 'type': 'attribute', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'usrgos'}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'flat_list'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'hdrgo_nt'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'usrgos_unsorted'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'h2u_get'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'hdrgo_id'}; {'id': '104', 'type': 'if_statement', 'children': ['105', '106', '171']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'usrgos_unsorted'}; {'id': '106', 'type': 'block', 'children': ['107', '116', '140', '150', '162']}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'assignment', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'usrgo2nt'}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': '_get_go2nt'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'usrgos_unsorted'}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'usrgont_sorted'}; {'id': '119', 'type': 'call', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '121', 'type': 'argument_list', 'children': ['122', '127']}; {'id': '122', 'type': 'call', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'usrgo2nt'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '126', 'type': 'argument_list', 'children': []}; {'id': '127', 'type': 'keyword_argument', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '129', 'type': 'lambda', 'children': ['130', '132']}; {'id': '130', 'type': 'lambda_parameters', 'children': ['131']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '132', 'type': 'call', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'usrgo_sortby'}; {'id': '136', 'type': 'argument_list', 'children': ['137']}; {'id': '137', 'type': 'subscript', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '139', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '140', 'type': 'expression_statement', 'children': ['141']}; {'id': '141', 'type': 'assignment', 'children': ['142', '145']}; {'id': '142', 'type': 'pattern_list', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'usrgos_sorted'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'usrnts_sorted'}; {'id': '145', 'type': 'call', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '147', 'type': 'argument_list', 'children': ['148']}; {'id': '148', 'type': 'list_splat', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'usrgont_sorted'}; {'id': '150', 'type': 'if_statement', 'children': ['151', '154']}; {'id': '151', 'type': 'comparison_operator', 'children': ['152', '153'], 'value': 'is'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'flat_list'}; {'id': '153', 'type': 'None', 'children': []}; {'id': '154', 'type': 'block', 'children': ['155']}; {'id': '155', 'type': 'expression_statement', 'children': ['156']}; {'id': '156', 'type': 'call', 'children': ['157', '160']}; {'id': '157', 'type': 'attribute', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'flat_list'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'usrnts_sorted'}; {'id': '162', 'type': 'expression_statement', 'children': ['163']}; {'id': '163', 'type': 'call', 'children': ['164', '167']}; {'id': '164', 'type': 'attribute', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'sorted_hdrgos_usrgos'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '167', 'type': 'argument_list', 'children': ['168']}; {'id': '168', 'type': 'tuple', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'hdrgo_id'}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'usrgos_sorted'}; {'id': '171', 'type': 'else_clause', 'children': ['172']}; {'id': '172', 'type': 'block', 'children': ['173']}; {'id': '173', 'type': 'expression_statement', 'children': ['174']}; {'id': '174', 'type': 'call', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'sorted_hdrgos_usrgos'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '178', 'type': 'argument_list', 'children': ['179']}; {'id': '179', 'type': 'tuple', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'hdrgo_id'}; {'id': '181', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '182', 'type': 'return_statement', 'children': ['183']}; {'id': '183', 'type': 'call', 'children': ['184', '187']}; {'id': '184', 'type': 'attribute', 'children': ['185', '186']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'cx'}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '187', 'type': 'argument_list', 'children': ['188']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'sorted_hdrgos_usrgos'}
Return GO IDs sorting using go2nt's namedtuple.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_init_hdrgo_sortby'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sortby'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'sortby'}; {'id': '7', 'type': 'block', 'children': ['8', '15', '22']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sortby'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sortby'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '19']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'is'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sortby'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sortby'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sortby'}
Initialize header sort function.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sortgo'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '14']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '9'], 'value': 'in'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'sortgo'"}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'datobj'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'subscript', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'datobj'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'sortgo'"}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '36'], 'value': '+'}; {'id': '25', 'type': 'subscript', 'children': ['26', '35']}; {'id': '26', 'type': 'attribute', 'children': ['27', '34']}; {'id': '27', 'type': 'attribute', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'datobj'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'grprdflt'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'gosubdag'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'prt_attr'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'sort'"}; {'id': '36', 'type': 'string', 'children': [], 'value': '"\\n"'}
Get function for sorting GO terms in a list of namedtuples.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sorted_section'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'nts_section'}; {'id': '6', 'type': 'block', 'children': ['7', '32', '47']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': 'is'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'section_sortby'}; {'id': '12', 'type': 'True', 'children': []}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'nts_section'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'lambda', 'children': ['22', '24']}; {'id': '22', 'type': 'lambda_parameters', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '24', 'type': 'call', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sortgos'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'usrgo_sortby'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '32', 'type': 'if_statement', 'children': ['33', '44']}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '39'], 'value': 'or'}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '38'], 'value': 'is'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'section_sortby'}; {'id': '38', 'type': 'False', 'children': []}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '43'], 'value': 'is'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'section_sortby'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'nts_section'}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'nts_section'}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '54', 'type': 'lambda', 'children': ['55', '57']}; {'id': '55', 'type': 'lambda_parameters', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'section_sortby'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'nt'}
Sort GO IDs in each section, if requested by user.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sections_2dnt'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sec2d_go'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'list_comprehension', 'children': ['9', '17']}; {'id': '9', 'type': 'tuple', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'nm'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_ntgos_sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'gos'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '21']}; {'id': '18', 'type': 'pattern_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nm'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'gos'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sec2d_go'}
Return a sections list containing sorted lists of namedtuples.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_ntgos_sorted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '6', 'type': 'block', 'children': ['7', '15']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '15', 'type': 'return_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '30']}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '23', '26']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'go'}; {'id': '23', 'type': 'for_in_clause', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'go'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '26', 'type': 'if_clause', 'children': ['27']}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'go'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'fncsortnt'}
Return sorted Grouper namedtuples if there are user GO IDs underneath.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sortobj'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'goea_results'}; {'id': '6', 'type': 'dictionary_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '8', 'type': 'block', 'children': ['9', '22', '34', '46', '65', '74', '93']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'nts_goea'}; {'id': '12', 'type': 'call', 'children': ['13', '19']}; {'id': '13', 'type': 'attribute', 'children': ['14', '18']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'MgrNtGOEAs'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'goea_results'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'get_goea_nts_prt'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'dictionary_splat', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'goids'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '27', 'type': 'generator_expression', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'GO'}; {'id': '31', 'type': 'for_in_clause', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'nts_goea'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '37', 'type': 'dictionary_comprehension', 'children': ['38', '43']}; {'id': '38', 'type': 'pair', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'GO'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '43', 'type': 'for_in_clause', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'nts_goea'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'Grouper'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53', '54', '57', '62']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"GOEA"'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'goids'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'hdrobj'}; {'id': '57', 'type': 'attribute', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'grprdflt'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'gosubdag'}; {'id': '62', 'type': 'keyword_argument', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'go2nt'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'prt_summary'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'sortobj'}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'Sorter'}; {'id': '79', 'type': 'argument_list', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'section_sortby'}; {'id': '83', 'type': 'lambda', 'children': ['84', '86']}; {'id': '84', 'type': 'lambda_parameters', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '90', 'type': 'attribute', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'pval_fld'}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'sortobj'}
Return a Grouper object, given a list of GOEnrichmentRecord.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sorted_relationships'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'goterm'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '28', '43']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': 'in'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'goterm'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'goids_seen'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': []}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'goids_seen'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'goterm'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '28', 'type': 'for_statement', 'children': ['29', '30', '35']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'goterm_upper'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'goterm'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_goterms_upper'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_get_sorted_relationships'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'goterm_upper'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'goterms_sorted'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'goterm'}
Traverse GO Terms above the current GO Term. Then add current GO Term to sorted.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'write_dag'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '21']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'out'}
Write info for all GO Terms in obo file, sorted numerically.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_nts'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'nt_list'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'codekey'}; {'id': '7', 'type': 'block', 'children': ['8', '28']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sortby'}; {'id': '11', 'type': 'lambda', 'children': ['12', '14']}; {'id': '12', 'type': 'lambda_parameters', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '14', 'type': 'call', 'children': ['15', '20']}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'ev2idx'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '26']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'nt'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'codekey'}; {'id': '26', 'type': 'unary_operator', 'children': ['27'], 'value': '-'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'nt_list'}; {'id': '33', 'type': 'keyword_argument', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sortby'}
Sort list of namedtuples such so evidence codes in same order as code2nt.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'prt_gos'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '10']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'prt'}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '10', 'type': 'dictionary_splat_pattern', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'kws_usr'}; {'id': '12', 'type': 'block', 'children': ['13', '23', '37']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'desc2nts'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'get_desc2nts'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'dictionary_splat', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'kws_usr'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'prt_nts'}; {'id': '28', 'type': 'argument_list', 'children': ['29', '30', '31']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'desc2nts'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'prt'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'kws_usr'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'string', 'children': [], 'value': "'prtfmt'"}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'desc2nts'}
Sort user GO ids, grouped under broader GO terms or sections. Print to screen.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_nts_flat'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'use_sections'}; {'id': '10', 'type': 'True', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '43', '59']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '21']}; {'id': '13', 'type': 'boolean_operator', 'children': ['14', '19'], 'value': 'or'}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '18'], 'value': 'is'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sectobj'}; {'id': '18', 'type': 'None', 'children': []}; {'id': '19', 'type': 'not_operator', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'use_sections'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '29']}; {'id': '24', 'type': 'attribute', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sortgos'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get_nts_sorted'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31', '40']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'hdrgos'}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'grprobj'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'get_hdrgos'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '42', 'type': 'True', 'children': []}; {'id': '43', 'type': 'if_statement', 'children': ['44', '46']}; {'id': '44', 'type': 'not_operator', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'use_sections'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '54']}; {'id': '49', 'type': 'attribute', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'sectobj'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'get_sorted_nts_omit_section'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'hdrgo_prt'}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'hdrgo_sort'}; {'id': '58', 'type': 'True', 'children': []}; {'id': '59', 'type': 'return_statement', 'children': ['60']}; {'id': '60', 'type': 'None', 'children': []}
Return a flat list of sorted nts.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_adjust_prt_flds'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'kws_xlsx'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'desc2nts'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'shade_hdrgos'}; {'id': '8', 'type': 'block', 'children': ['9', '18', '28', '32', '43', '78']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '13']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '12'], 'value': 'in'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"prt_flds"'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'kws_xlsx'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'subscript', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'kws_xlsx'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"prt_flds"'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dont_print'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'list', 'children': ['25', '26', '27'], 'value': "['hdr_idx', 'is_hdrgo', 'is_usrgo']"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'hdr_idx'"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'is_hdrgo'"}; {'id': '27', 'type': 'string', 'children': [], 'value': "'is_usrgo'"}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'prt_flds_adjusted'}; {'id': '31', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'nt_flds'}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sortobj'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'get_fields'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'desc2nts'}; {'id': '43', 'type': 'for_statement', 'children': ['44', '45', '46']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'nt_fld'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'nt_flds'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'if_statement', 'children': ['48', '51']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': 'not'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'nt_fld'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'dont_print'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56', '69']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': '=='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'nt_fld'}; {'id': '55', 'type': 'string', 'children': [], 'value': '"format_txt"'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'if_statement', 'children': ['58', '61']}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '60'], 'value': 'is'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'shade_hdrgos'}; {'id': '60', 'type': 'True', 'children': []}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'prt_flds_adjusted'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'nt_fld'}; {'id': '69', 'type': 'else_clause', 'children': ['70']}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'prt_flds_adjusted'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'nt_fld'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '83']}; {'id': '80', 'type': 'subscript', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'kws_xlsx'}; {'id': '82', 'type': 'string', 'children': [], 'value': "'prt_flds'"}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'prt_flds_adjusted'}
Print user-requested fields or provided fields minus info fields.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_shade_hdrgos'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'dictionary_splat_pattern', 'children': ['5']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '25', '36', '51']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': 'in'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'shade_hdrgos'"}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'shade_hdrgos'"}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'in'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'hdrgo_prt'"}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '24', 'type': 'string', 'children': [], 'value': "'hdrgo_prt'"}; {'id': '25', 'type': 'if_statement', 'children': ['26', '33']}; {'id': '26', 'type': 'boolean_operator', 'children': ['27', '30'], 'value': 'and'}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'section_sortby'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'section_sortby'"}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'False', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '48']}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '41'], 'value': 'and'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': 'in'}; {'id': '39', 'type': 'string', 'children': [], 'value': "'top_n'"}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'kws'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'top_n'"}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'False', 'children': []}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'True', 'children': []}
If no hdrgo_prt specified, and these conditions are present -> hdrgo_prt=F.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dflt_sortby_objgoea'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'list', 'children': ['8', '13', '18', '23', '28'], 'value': "[getattr(goea_res, 'enrichment'),\n getattr(goea_res, 'namespace'),\n getattr(goea_res, 'p_uncorrected'),\n getattr(goea_res, 'depth'),\n getattr(goea_res, 'GO')]"}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'enrichment'"}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'namespace'"}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'p_uncorrected'"}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'depth'"}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'goea_res'}; {'id': '32', 'type': 'string', 'children': [], 'value': "'GO'"}
Default sorting of GOEA results.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'dflt_sortby_ntgoea'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'list', 'children': ['8', '11', '14', '17', '20'], 'value': '[ntgoea.enrichment,\n ntgoea.namespace,\n ntgoea.p_uncorrected,\n ntgoea.depth,\n ntgoea.GO]'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'enrichment'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'p_uncorrected'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'depth'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'ntgoea'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'GO'}
Default sorting of GOEA results stored in namedtuples.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'optimize'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '27']}; {'id': '6', 'type': 'with_statement', 'children': ['7', '17']}; {'id': '7', 'type': 'with_clause', 'children': ['8']}; {'id': '8', 'type': 'with_item', 'children': ['9']}; {'id': '9', 'type': 'as_pattern', 'children': ['10', '15']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'LIBRARIES_FILE'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '15', 'type': 'as_pattern_target', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'libs_data'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '27', 'type': 'for_statement', 'children': ['28', '31', '36']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'alg'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'libs_names'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'libs_data'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'block', 'children': ['37', '46', '51', '73']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'libs'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'get_libs'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'alg'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '49']}; {'id': '47', 'type': 'not_operator', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'libs'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'continue_statement', 'children': []}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '58']}; {'id': '53', 'type': 'subscript', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'libs'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'alg'}; {'id': '58', 'type': 'list_comprehension', 'children': ['59', '60', '63']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '60', 'type': 'for_in_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'libs'}; {'id': '63', 'type': 'if_clause', 'children': ['64']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '72'], 'value': 'in'}; {'id': '65', 'type': 'list', 'children': ['66', '69'], 'value': '[lib.module_name, lib.func_name]'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'module_name'}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'func_name'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'libs_names'}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '82']}; {'id': '75', 'type': 'attribute', 'children': ['76', '81']}; {'id': '76', 'type': 'subscript', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'libs'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'alg'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'keyword_argument', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '85', 'type': 'lambda', 'children': ['86', '88']}; {'id': '86', 'type': 'lambda_parameters', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'libs_names'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'list', 'children': ['94', '97'], 'value': '[lib.module_name, lib.func_name]'}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'module_name'}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'lib'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'func_name'}
Sort algorithm implementations by speed.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_common_members'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '11', '15', '22', '26', '43', '50', '75', '89']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '8', 'type': 'binary_operator', 'children': ['9', '10'], 'value': '+'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'PREFIX'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'/common_members.json'"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sorted_json_data'}; {'id': '14', 'type': 'dictionary', 'children': []}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'read_json'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'all_keys'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '30', '35']}; {'id': '27', 'type': 'pattern_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'all_keys'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'all_keys'}; {'id': '50', 'type': 'for_statement', 'children': ['51', '52', '53']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'if_statement', 'children': ['55', '63']}; {'id': '55', 'type': 'comparison_operator', 'children': ['56', '62'], 'value': '>'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '69']}; {'id': '66', 'type': 'subscript', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sorted_json_data'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'json_data'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'binary_operator', 'children': ['80', '81'], 'value': '+'}; {'id': '80', 'type': 'string', 'children': [], 'value': "'--> Sorted/cleaned '"}; {'id': '81', 'type': 'call', 'children': ['82', '87']}; {'id': '82', 'type': 'attribute', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'write_json'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'sorted_json_data'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'filename'}
Sorts the keys and members
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'parse_header'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '7', 'type': 'string', 'children': [], 'value': "'*/*'"}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'yield', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '39']}; {'id': '14', 'type': 'generator_expression', 'children': ['15', '25', '33']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'from_string'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'for_in_clause', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': "','"}; {'id': '33', 'type': 'if_clause', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '41', 'type': 'True', 'children': []}
Parse HTTP accept header and return instances sorted by weight.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'load_ui_file'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '31']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'ui'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'gtk'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Builder'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ui'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'add_from_file'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '26']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'runtime'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'data_dir'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'ui'}
loads interface from the glade file; sorts out the path business
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '__remove_category'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '6', 'type': 'block', 'children': ['7', '26', '30', '39', '48']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'affected_query'}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'affected_ids'}; {'id': '12', 'type': 'list_comprehension', 'children': ['13', '16']}; {'id': '13', 'type': 'subscript', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '15', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '16', 'type': 'for_in_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fetchall'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'affected_query'}; {'id': '24', 'type': 'tuple', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"update activities set category_id = -1 where category_id = ?"'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '37', 'type': 'tuple', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"delete from categories where id = ?"'}; {'id': '46', 'type': 'tuple', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '__remove_index'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'affected_ids'}
move all activities to unsorted and remove category
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '13']}; {'id': '8', 'type': 'subscript', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '__dict__'}; {'id': '12', 'type': 'string', 'children': [], 'value': "'_z_ordered_sprites'"}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sprites'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'lambda', 'children': ['22', '24']}; {'id': '22', 'type': 'lambda_parameters', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sprite'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sprite'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'z_order'}
sort sprites by z_order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_fromset'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '8', 'type': 'None', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '19', '25', '34']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sorted_set'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'object'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '__new__'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted_set'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_set'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sorted_set'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '__init__'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sorted_set'}
Initialize sorted set from existing set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_argsort_and_resolve_ties'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '6', 'type': 'block', 'children': ['7', '14', '26', '30', '87']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'n_samples'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'kind'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"mergesort"'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '30', 'type': 'while_statement', 'children': ['31', '36']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': '<'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '35'], 'value': '-'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'n_samples'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '36', 'type': 'block', 'children': ['37', '43', '64', '83']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '+'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '43', 'type': 'while_statement', 'children': ['44', '59']}; {'id': '44', 'type': 'boolean_operator', 'children': ['45', '48'], 'value': 'and'}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '47'], 'value': '<'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'n_samples'}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '54'], 'value': '=='}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'time'}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'augmented_assignment', 'children': ['62', '63'], 'value': '+='}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '64', 'type': 'if_statement', 'children': ['65', '70']}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '69'], 'value': '!='}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '+'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '70', 'type': 'block', 'children': ['71']}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'random_state'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'shuffle'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'subscript', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '79', 'type': 'slice', 'children': ['80', '81', '82']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '81', 'type': 'colon', 'children': []}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'inext'}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'order'}
Like numpy.argsort, but resolves ties uniformly at random
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'toposort_classes'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '5', 'type': 'block', 'children': ['6', '131', '143', '149', '153', '176']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '13']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'get_class_topolist'}; {'id': '8', 'type': 'parameters', 'children': ['9', '10', '11', '12']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'name_to_class'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'processed_classes'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'current_trace'}; {'id': '13', 'type': 'block', 'children': ['14', '21', '36', '42', '49', '60', '78', '82', '89', '106', '113', '122', '129']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '18']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'in'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'processed_classes'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25']}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': 'in'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'current_trace'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'raise_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'AssertionError'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'Encountered self-reference in dependency chain of {}'"}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'name_to_class'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'dependencies'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': '_list_superclasses'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'properties'}; {'id': '52', 'type': 'conditional_expression', 'children': ['53', '56', '59'], 'value': 'if'}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'properties'"}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '58'], 'value': 'in'}; {'id': '57', 'type': 'string', 'children': [], 'value': "'properties'"}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '59', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '60', 'type': 'for_statement', 'children': ['61', '62', '63']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'properties'}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'if_statement', 'children': ['65', '68']}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '67'], 'value': 'in'}; {'id': '66', 'type': 'string', 'children': [], 'value': "'linkedClass'"}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'dependencies'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'prop'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'linkedClass'"}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'class_list'}; {'id': '81', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'current_trace'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '89', 'type': 'for_statement', 'children': ['90', '91', '92']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'dependency'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'dependencies'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'class_list'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'get_class_topolist'}; {'id': '101', 'type': 'argument_list', 'children': ['102', '103', '104', '105']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'dependency'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'name_to_class'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'processed_classes'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'current_trace'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '111']}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'current_trace'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'call', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'class_list'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'name_to_class'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '122', 'type': 'expression_statement', 'children': ['123']}; {'id': '123', 'type': 'call', 'children': ['124', '127']}; {'id': '124', 'type': 'attribute', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'processed_classes'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '127', 'type': 'argument_list', 'children': ['128']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'class_name'}; {'id': '129', 'type': 'return_statement', 'children': ['130']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'class_list'}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'class_map'}; {'id': '134', 'type': 'dictionary_comprehension', 'children': ['135', '140']}; {'id': '135', 'type': 'pair', 'children': ['136', '139']}; {'id': '136', 'type': 'subscript', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '138', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '140', 'type': 'for_in_clause', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '143', 'type': 'expression_statement', 'children': ['144']}; {'id': '144', 'type': 'assignment', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'seen_classes'}; {'id': '146', 'type': 'call', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '148', 'type': 'argument_list', 'children': []}; {'id': '149', 'type': 'expression_statement', 'children': ['150']}; {'id': '150', 'type': 'assignment', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'toposorted'}; {'id': '152', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '153', 'type': 'for_statement', 'children': ['154', '155', '160']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '155', 'type': 'call', 'children': ['156', '159']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'class_map'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '159', 'type': 'argument_list', 'children': []}; {'id': '160', 'type': 'block', 'children': ['161']}; {'id': '161', 'type': 'expression_statement', 'children': ['162']}; {'id': '162', 'type': 'call', 'children': ['163', '166']}; {'id': '163', 'type': 'attribute', 'children': ['164', '165']}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'toposorted'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '166', 'type': 'argument_list', 'children': ['167']}; {'id': '167', 'type': 'call', 'children': ['168', '169']}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'get_class_topolist'}; {'id': '169', 'type': 'argument_list', 'children': ['170', '171', '172', '173']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'class_map'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'seen_classes'}; {'id': '173', 'type': 'call', 'children': ['174', '175']}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '175', 'type': 'argument_list', 'children': []}; {'id': '176', 'type': 'return_statement', 'children': ['177']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'toposorted'}
Sort class metadatas so that a superclass is always before the subclass
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ranker'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'meta'}; {'id': '7', 'type': 'block', 'children': ['8', '23', '37', '45', '55', '65', '71']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'total_score'}; {'id': '11', 'type': 'call', 'children': ['12', '22']}; {'id': '12', 'type': 'attribute', 'children': ['13', '21']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'transpose'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'total_score'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'squeeze'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'asarray'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'total_score'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'ranks'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'total_score'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'ranks'}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'ranks'}; {'id': '50', 'type': 'slice', 'children': ['51', '52', '53']}; {'id': '51', 'type': 'colon', 'children': []}; {'id': '52', 'type': 'colon', 'children': []}; {'id': '53', 'type': 'unary_operator', 'children': ['54'], 'value': '-'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sorted_meta'}; {'id': '58', 'type': 'list_comprehension', 'children': ['59', '62']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'meta'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '62', 'type': 'for_in_clause', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'ranks'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sorted_X'}; {'id': '68', 'type': 'subscript', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'X'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'ranks'}; {'id': '71', 'type': 'return_statement', 'children': ['72']}; {'id': '72', 'type': 'tuple', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'sorted_X'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sorted_meta'}
Sort the place features list by the score of its relevance.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_all_tags_names_as_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'admin'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"en"'}; {'id': '11', 'type': 'block', 'children': ['12', '55', '61', '67', '78', '126', '147', '168', '177']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '14', '34']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'admin'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '27']}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '22'], 'value': 'and'}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '21'], 'value': '!='}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list_admin'}; {'id': '21', 'type': 'dictionary', 'children': []}; {'id': '22', 'type': 'comparison_operator', 'children': ['23', '24'], 'value': 'in'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list_admin'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'subscript', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list_admin'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '34', 'type': 'else_clause', 'children': ['35']}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'if_statement', 'children': ['37', '48']}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '43'], 'value': 'and'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '42'], 'value': '!='}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list'}; {'id': '42', 'type': 'dictionary', 'children': []}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'in'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'subscript', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 's_stud'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 's_admin'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '66', 'type': 'argument_list', 'children': []}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '73']}; {'id': '69', 'type': 'tuple_pattern', 'children': ['70', '71', '72']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'common'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'org'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'get_all_tags'}; {'id': '77', 'type': 'argument_list', 'children': []}; {'id': '78', 'type': 'for_statement', 'children': ['79', '80', '83']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '80', 'type': 'binary_operator', 'children': ['81', '82'], 'value': '+'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'common'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'org'}; {'id': '83', 'type': 'block', 'children': ['84', '105', '112']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'tag_name_with_translation'}; {'id': '87', 'type': 'conditional_expression', 'children': ['88', '99', '104'], 'value': 'if'}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'gettext'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'get_name'}; {'id': '98', 'type': 'argument_list', 'children': []}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'get_name'}; {'id': '103', 'type': 'argument_list', 'children': []}; {'id': '104', 'type': 'string', 'children': [], 'value': '""'}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 's_admin'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'tag_name_with_translation'}; {'id': '112', 'type': 'if_statement', 'children': ['113', '118']}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'is_visible_for_student'}; {'id': '117', 'type': 'argument_list', 'children': []}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 's_stud'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '124', 'type': 'argument_list', 'children': ['125']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'tag_name_with_translation'}; {'id': '126', 'type': 'expression_statement', 'children': ['127']}; {'id': '127', 'type': 'assignment', 'children': ['128', '133']}; {'id': '128', 'type': 'subscript', 'children': ['129', '132']}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list_admin'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'natsorted'}; {'id': '135', 'type': 'argument_list', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 's_admin'}; {'id': '137', 'type': 'keyword_argument', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '139', 'type': 'lambda', 'children': ['140', '142']}; {'id': '140', 'type': 'lambda_parameters', 'children': ['141']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '142', 'type': 'call', 'children': ['143', '146']}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '146', 'type': 'argument_list', 'children': []}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'assignment', 'children': ['149', '154']}; {'id': '149', 'type': 'subscript', 'children': ['150', '153']}; {'id': '150', 'type': 'attribute', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '154', 'type': 'call', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'natsorted'}; {'id': '156', 'type': 'argument_list', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 's_stud'}; {'id': '158', 'type': 'keyword_argument', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '160', 'type': 'lambda', 'children': ['161', '163']}; {'id': '161', 'type': 'lambda_parameters', 'children': ['162']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '163', 'type': 'call', 'children': ['164', '167']}; {'id': '164', 'type': 'attribute', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '167', 'type': 'argument_list', 'children': []}; {'id': '168', 'type': 'if_statement', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'admin'}; {'id': '170', 'type': 'block', 'children': ['171']}; {'id': '171', 'type': 'return_statement', 'children': ['172']}; {'id': '172', 'type': 'subscript', 'children': ['173', '176']}; {'id': '173', 'type': 'attribute', 'children': ['174', '175']}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '175', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list_admin'}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'language'}; {'id': '177', 'type': 'return_statement', 'children': ['178']}; {'id': '178', 'type': 'subscript', 'children': ['179', '182']}; {'id': '179', 'type': 'attribute', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '181', 'type': 'identifier', 'children': [], 'value': '_all_tags_cache_list'}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'language'}
Computes and cache two list containing all tags name sorted by natural order on name
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_users'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '6', 'type': 'block', 'children': ['7', '55']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'users'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '38']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '37']}; {'id': '20', 'type': 'attribute', 'children': ['21', '36']}; {'id': '21', 'type': 'call', 'children': ['22', '27']}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'user_manager'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get_users_info'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '34']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'user_manager'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_course_registered_users'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'course'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'keyword_argument', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '40', 'type': 'lambda', 'children': ['41', '43']}; {'id': '41', 'type': 'lambda_parameters', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '43', 'type': 'conditional_expression', 'children': ['44', '49', '54'], 'value': 'if'}; {'id': '44', 'type': 'subscript', 'children': ['45', '48']}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '53'], 'value': 'is'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '53', 'type': 'None', 'children': []}; {'id': '54', 'type': 'string', 'children': [], 'value': '""'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'users'}
Returns a sorted list of users
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'radius_cmp'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'offsets'}; {'id': '7', 'type': 'block', 'children': ['8', '10', '24', '31', '39']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'string', 'children': [], 'value': "'''return +1 or -1 for for sorting'''"}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'diff'}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '19'], 'value': '-'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'offsets'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'offsets'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '28']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': '>'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'diff'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': '<'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'diff'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'unary_operator', 'children': ['38'], 'value': '-'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '39', 'type': 'return_statement', 'children': ['40']}; {'id': '40', 'type': 'integer', 'children': [], 'value': '0'}
return +1 or -1 for for sorting
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_enums_info'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'enums'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'msgs'}; {'id': '6', 'type': 'block', 'children': ['7', '230']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '10']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'enums'}; {'id': '10', 'type': 'block', 'children': ['11', '22', '32', '38', '70', '74', '78', '194', '205', '216']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'swift_name'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'camel_case_from_underscores'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'raw_value_type'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get_enum_raw_type'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'msgs'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'formatted_description'}; {'id': '37', 'type': 'string', 'children': [], 'value': '""'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '42', 'type': 'block', 'children': ['43', '60']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '59']}; {'id': '54', 'type': 'attribute', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '59', 'type': 'argument_list', 'children': []}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'formatted_description'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '67'], 'value': '%'}; {'id': '66', 'type': 'string', 'children': [], 'value': '"\\n/**\\n %s\\n*/\\n"'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'all_entities'}; {'id': '73', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'entities_info'}; {'id': '77', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '78', 'type': 'for_statement', 'children': ['79', '80', '83']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '83', 'type': 'block', 'children': ['84', '100', '115', '124', '130', '164', '173']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '87', 'type': 'call', 'children': ['88', '93']}; {'id': '88', 'type': 'attribute', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '93', 'type': 'argument_list', 'children': ['94', '99']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '98'], 'value': '+'}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '98', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '99', 'type': 'string', 'children': [], 'value': "''"}; {'id': '100', 'type': 'if_statement', 'children': ['101', '108']}; {'id': '101', 'type': 'call', 'children': ['102', '107']}; {'id': '102', 'type': 'attribute', 'children': ['103', '106']}; {'id': '103', 'type': 'subscript', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '105', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'isdigit'}; {'id': '107', 'type': 'argument_list', 'children': []}; {'id': '108', 'type': 'block', 'children': ['109']}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '112', 'type': 'binary_operator', 'children': ['113', '114'], 'value': '+'}; {'id': '113', 'type': 'string', 'children': [], 'value': '"MAV_"'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'assignment', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'swift_name'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'camel_case_from_underscores'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'assignment', 'children': ['126', '129']}; {'id': '126', 'type': 'attribute', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'formatted_description'}; {'id': '129', 'type': 'string', 'children': [], 'value': '""'}; {'id': '130', 'type': 'if_statement', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '134', 'type': 'block', 'children': ['135', '152']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'assignment', 'children': ['137', '140']}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '140', 'type': 'call', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'call', 'children': ['146', '151']}; {'id': '146', 'type': 'attribute', 'children': ['147', '150']}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '151', 'type': 'argument_list', 'children': []}; {'id': '152', 'type': 'expression_statement', 'children': ['153']}; {'id': '153', 'type': 'assignment', 'children': ['154', '157']}; {'id': '154', 'type': 'attribute', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'formatted_description'}; {'id': '157', 'type': 'binary_operator', 'children': ['158', '163'], 'value': '+'}; {'id': '158', 'type': 'binary_operator', 'children': ['159', '160'], 'value': '+'}; {'id': '159', 'type': 'string', 'children': [], 'value': '"\\n\\t/// "'}; {'id': '160', 'type': 'attribute', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '163', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '164', 'type': 'expression_statement', 'children': ['165']}; {'id': '165', 'type': 'call', 'children': ['166', '169']}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'all_entities'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '169', 'type': 'argument_list', 'children': ['170']}; {'id': '170', 'type': 'attribute', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'swift_name'}; {'id': '173', 'type': 'expression_statement', 'children': ['174']}; {'id': '174', 'type': 'call', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'entities_info'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '178', 'type': 'argument_list', 'children': ['179']}; {'id': '179', 'type': 'binary_operator', 'children': ['180', '181'], 'value': '%'}; {'id': '180', 'type': 'string', 'children': [], 'value': '\'("%s", "%s")\''}; {'id': '181', 'type': 'tuple', 'children': ['182', '185']}; {'id': '182', 'type': 'attribute', 'children': ['183', '184']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '185', 'type': 'call', 'children': ['186', '191']}; {'id': '186', 'type': 'attribute', 'children': ['187', '190']}; {'id': '187', 'type': 'attribute', 'children': ['188', '189']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '189', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '191', 'type': 'argument_list', 'children': ['192', '193']}; {'id': '192', 'type': 'string', 'children': [], 'value': '\'"\''}; {'id': '193', 'type': 'string', 'children': [], 'value': '\'\\\\"\''}; {'id': '194', 'type': 'expression_statement', 'children': ['195']}; {'id': '195', 'type': 'assignment', 'children': ['196', '199']}; {'id': '196', 'type': 'attribute', 'children': ['197', '198']}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'all_entities'}; {'id': '199', 'type': 'call', 'children': ['200', '203']}; {'id': '200', 'type': 'attribute', 'children': ['201', '202']}; {'id': '201', 'type': 'string', 'children': [], 'value': '", "'}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '203', 'type': 'argument_list', 'children': ['204']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'all_entities'}; {'id': '205', 'type': 'expression_statement', 'children': ['206']}; {'id': '206', 'type': 'assignment', 'children': ['207', '210']}; {'id': '207', 'type': 'attribute', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'entities_info'}; {'id': '210', 'type': 'call', 'children': ['211', '214']}; {'id': '211', 'type': 'attribute', 'children': ['212', '213']}; {'id': '212', 'type': 'string', 'children': [], 'value': '", "'}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '214', 'type': 'argument_list', 'children': ['215']}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'entities_info'}; {'id': '216', 'type': 'expression_statement', 'children': ['217']}; {'id': '217', 'type': 'assignment', 'children': ['218', '221']}; {'id': '218', 'type': 'attribute', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'entity_description'}; {'id': '221', 'type': 'call', 'children': ['222', '227']}; {'id': '222', 'type': 'attribute', 'children': ['223', '226']}; {'id': '223', 'type': 'attribute', 'children': ['224', '225']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '225', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '227', 'type': 'argument_list', 'children': ['228', '229']}; {'id': '228', 'type': 'string', 'children': [], 'value': '\'"\''}; {'id': '229', 'type': 'string', 'children': [], 'value': '\'\\\\"\''}; {'id': '230', 'type': 'expression_statement', 'children': ['231']}; {'id': '231', 'type': 'call', 'children': ['232', '235']}; {'id': '232', 'type': 'attribute', 'children': ['233', '234']}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'enums'}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '235', 'type': 'argument_list', 'children': ['236']}; {'id': '236', 'type': 'keyword_argument', 'children': ['237', '238']}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '238', 'type': 'lambda', 'children': ['239', '241']}; {'id': '239', 'type': 'lambda_parameters', 'children': ['240']}; {'id': '240', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '241', 'type': 'attribute', 'children': ['242', '243']}; {'id': '242', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '243', 'type': 'identifier', 'children': [], 'value': 'swift_name'}
Add camel case swift names for enums an entries, descriptions and sort enums alphabetically
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'replace_cells'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'sorted_row_idxs'}; {'id': '7', 'type': 'block', 'children': ['8', '15', '19', '23', '35', '106', '121']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '14']}; {'id': '10', 'type': 'pattern_list', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'new_keys'}; {'id': '18', 'type': 'dictionary', 'children': []}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'del_keys'}; {'id': '22', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'selection'}; {'id': '26', 'type': 'call', 'children': ['27', '34']}; {'id': '27', 'type': 'attribute', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_selection'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'for_statement', 'children': ['36', '40', '45']}; {'id': '36', 'type': 'pattern_list', 'children': ['37', '38', '39']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '__col'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '__tab'}; {'id': '40', 'type': 'attribute', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'code_array'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'if_statement', 'children': ['47', '61']}; {'id': '47', 'type': 'boolean_operator', 'children': ['48', '51', '52'], 'value': 'and'}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': '=='}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '__tab'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'tab'}; {'id': '51', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '52', 'type': '()', 'children': ['53']}; {'id': '53', 'type': 'boolean_operator', 'children': ['54', '56'], 'value': 'or'}; {'id': '54', 'type': 'not_operator', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'selection'}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '60'], 'value': 'in'}; {'id': '57', 'type': 'tuple', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '__col'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'selection'}; {'id': '61', 'type': 'block', 'children': ['62', '71']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'new_row'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sorted_row_idxs'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '71', 'type': 'if_statement', 'children': ['72', '75']}; {'id': '72', 'type': 'comparison_operator', 'children': ['73', '74'], 'value': '!='}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'new_row'}; {'id': '75', 'type': 'block', 'children': ['76', '96']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'assignment', 'children': ['78', '84', '85']}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'new_keys'}; {'id': '80', 'type': 'tuple', 'children': ['81', '82', '83']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'new_row'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': '__col'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': '__tab'}; {'id': '84', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '85', 'type': 'call', 'children': ['86', '91']}; {'id': '86', 'type': 'attribute', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'code_array'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'tuple', 'children': ['93', '94', '95']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': '__col'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': '__tab'}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'del_keys'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'tuple', 'children': ['103', '104', '105']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': '__row'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': '__col'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': '__tab'}; {'id': '106', 'type': 'for_statement', 'children': ['107', '108', '109']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'del_keys'}; {'id': '109', 'type': 'block', 'children': ['110']}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '119']}; {'id': '112', 'type': 'attribute', 'children': ['113', '118']}; {'id': '113', 'type': 'attribute', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'code_array'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '119', 'type': 'argument_list', 'children': ['120']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '121', 'type': 'for_statement', 'children': ['122', '123', '124']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'new_keys'}; {'id': '124', 'type': 'block', 'children': ['125']}; {'id': '125', 'type': 'expression_statement', 'children': ['126']}; {'id': '126', 'type': 'call', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'CellActions'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'set_code'}; {'id': '130', 'type': 'argument_list', 'children': ['131', '132', '133']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '133', 'type': 'subscript', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'new_keys'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'key'}
Replaces cells in current selection so that they are sorted
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'OnSortAscending'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event'}; {'id': '6', 'type': 'block', 'children': ['7', '62']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '46']}; {'id': '8', 'type': 'block', 'children': ['9', '39']}; {'id': '9', 'type': 'with_statement', 'children': ['10', '21']}; {'id': '10', 'type': 'with_clause', 'children': ['11']}; {'id': '11', 'type': 'with_item', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'undo'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'string', 'children': [], 'value': '"Sort ascending"'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '31']}; {'id': '24', 'type': 'attribute', 'children': ['25', '30']}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sort_ascending'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'attribute', 'children': ['33', '38']}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'statustext'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'string', 'children': [], 'value': 'u"Sorting complete."'}; {'id': '46', 'type': 'except_clause', 'children': ['47', '48', '49']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'statustext'}; {'id': '53', 'type': 'call', 'children': ['54', '60']}; {'id': '54', 'type': 'attribute', 'children': ['55', '59']}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'string', 'children': [], 'value': 'u"Sorting failed: {}"'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'err'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'post_command_event'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '71', '76']}; {'id': '66', 'type': 'attribute', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'main_window'}; {'id': '71', 'type': 'attribute', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'grid'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'StatusBarMsg'}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'statustext'}
Sort ascending event handler
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_font_list'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '13', '29', '35']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'font_map'}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'pangocairo'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'cairo_font_map_get_default'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'font_list'}; {'id': '16', 'type': 'list_comprehension', 'children': ['17', '22']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'get_name'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'for_in_clause', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'font_map'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'list_families'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'font_list'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'font_list'}
Returns a sorted list of all system font names
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'qzordered'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'B'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'crit'}; {'id': '8', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '9', 'type': 'block', 'children': ['10', '12', '16', '32', '52', '71']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'string', 'children': [], 'value': '"Eigenvalues bigger than crit are sorted in the top-left."'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TOL'}; {'id': '15', 'type': 'float', 'children': [], 'value': '1e-10'}; {'id': '16', 'type': 'function_definition', 'children': ['17', '18', '21']}; {'id': '17', 'type': 'function_name', 'children': [], 'value': 'select'}; {'id': '18', 'type': 'parameters', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'beta'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'comparison_operator', 'children': ['24', '27'], 'value': '>'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '26'], 'value': '**'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '29'], 'value': '*'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'crit'}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '31'], 'value': '**'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'beta'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '41']}; {'id': '34', 'type': 'list_pattern', 'children': ['35', '36', '37', '38', '39', '40']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'beta'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'U'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'V'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'ordqz'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45', '46', '49']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'A'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'B'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '48', 'type': 'string', 'children': [], 'value': "'real'"}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'select'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'eigval'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '65'], 'value': '/'}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'diag'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'diag'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '71', 'type': 'return_statement', 'children': ['72']}; {'id': '72', 'type': 'list', 'children': ['73', '74', '75', '76', '77'], 'value': '[S,T,U,V,eigval]'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'T'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'U'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'V'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'eigval'}
Eigenvalues bigger than crit are sorted in the top-left.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '23', '38', '53', '68', '83', '98', '113', '128', '143', '158', '173', '188', '203', '218']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Sorts components of the object.\n '''"}; {'id': '8', 'type': 'if_statement', 'children': ['9', '14']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'variables'"}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'variables'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '29']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'modules'"}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'modules'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '44']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'submodules'"}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '48', 'type': 'argument_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'submodules'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '59']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'string', 'children': [], 'value': "'common'"}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'common'}; {'id': '68', 'type': 'if_statement', 'children': ['69', '74']}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'string', 'children': [], 'value': "'subroutines'"}; {'id': '74', 'type': 'block', 'children': ['75']}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'subroutines'}; {'id': '83', 'type': 'if_statement', 'children': ['84', '89']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'string', 'children': [], 'value': "'modprocedures'"}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '93', 'type': 'argument_list', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'modprocedures'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '104']}; {'id': '99', 'type': 'call', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '101', 'type': 'argument_list', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '103', 'type': 'string', 'children': [], 'value': "'functions'"}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'expression_statement', 'children': ['106']}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '108', 'type': 'argument_list', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'functions'}; {'id': '113', 'type': 'if_statement', 'children': ['114', '119']}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '118', 'type': 'string', 'children': [], 'value': "'interfaces'"}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '123', 'type': 'argument_list', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'interfaces'}; {'id': '128', 'type': 'if_statement', 'children': ['129', '134']}; {'id': '129', 'type': 'call', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '131', 'type': 'argument_list', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '133', 'type': 'string', 'children': [], 'value': "'absinterfaces'"}; {'id': '134', 'type': 'block', 'children': ['135']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'call', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '138', 'type': 'argument_list', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '140', 'type': 'attribute', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'absinterfaces'}; {'id': '143', 'type': 'if_statement', 'children': ['144', '149']}; {'id': '144', 'type': 'call', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '146', 'type': 'argument_list', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '148', 'type': 'string', 'children': [], 'value': "'types'"}; {'id': '149', 'type': 'block', 'children': ['150']}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '153']}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '153', 'type': 'argument_list', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '155', 'type': 'attribute', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'types'}; {'id': '158', 'type': 'if_statement', 'children': ['159', '164']}; {'id': '159', 'type': 'call', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '161', 'type': 'argument_list', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '163', 'type': 'string', 'children': [], 'value': "'programs'"}; {'id': '164', 'type': 'block', 'children': ['165']}; {'id': '165', 'type': 'expression_statement', 'children': ['166']}; {'id': '166', 'type': 'call', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '168', 'type': 'argument_list', 'children': ['169', '170']}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '170', 'type': 'attribute', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'programs'}; {'id': '173', 'type': 'if_statement', 'children': ['174', '179']}; {'id': '174', 'type': 'call', 'children': ['175', '176']}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '176', 'type': 'argument_list', 'children': ['177', '178']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '178', 'type': 'string', 'children': [], 'value': "'blockdata'"}; {'id': '179', 'type': 'block', 'children': ['180']}; {'id': '180', 'type': 'expression_statement', 'children': ['181']}; {'id': '181', 'type': 'call', 'children': ['182', '183']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '183', 'type': 'argument_list', 'children': ['184', '185']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '185', 'type': 'attribute', 'children': ['186', '187']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'blockdata'}; {'id': '188', 'type': 'if_statement', 'children': ['189', '194']}; {'id': '189', 'type': 'call', 'children': ['190', '191']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '191', 'type': 'argument_list', 'children': ['192', '193']}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '193', 'type': 'string', 'children': [], 'value': "'boundprocs'"}; {'id': '194', 'type': 'block', 'children': ['195']}; {'id': '195', 'type': 'expression_statement', 'children': ['196']}; {'id': '196', 'type': 'call', 'children': ['197', '198']}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '198', 'type': 'argument_list', 'children': ['199', '200']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '200', 'type': 'attribute', 'children': ['201', '202']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'boundprocs'}; {'id': '203', 'type': 'if_statement', 'children': ['204', '209']}; {'id': '204', 'type': 'call', 'children': ['205', '206']}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '206', 'type': 'argument_list', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '208', 'type': 'string', 'children': [], 'value': "'finalprocs'"}; {'id': '209', 'type': 'block', 'children': ['210']}; {'id': '210', 'type': 'expression_statement', 'children': ['211']}; {'id': '211', 'type': 'call', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'sort_items'}; {'id': '213', 'type': 'argument_list', 'children': ['214', '215']}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '215', 'type': 'attribute', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'finalprocs'}; {'id': '218', 'type': 'if_statement', 'children': ['219', '224']}; {'id': '219', 'type': 'call', 'children': ['220', '221']}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'hasattr'}; {'id': '221', 'type': 'argument_list', 'children': ['222', '223']}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '223', 'type': 'string', 'children': [], 'value': "'args'"}; {'id': '224', 'type': 'block', 'children': ['225']}; {'id': '225', 'type': 'pass_statement', 'children': []}
Sorts components of the object.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_catalogue_chronologically'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '16', '25', '48']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Sorts the catalogue into chronological order\n '''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dec_time'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_decimal_time'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'dec_time'}; {'id': '25', 'type': 'if_statement', 'children': ['26', '46']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '45'], 'value': '>'}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '39'], 'value': '-'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '36', 'type': 'slice', 'children': ['37', '38']}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '38', 'type': 'colon', 'children': []}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'idx'}; {'id': '41', 'type': 'slice', 'children': ['42', '43']}; {'id': '42', 'type': 'colon', 'children': []}; {'id': '43', 'type': 'unary_operator', 'children': ['44'], 'value': '-'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '45', 'type': 'float', 'children': [], 'value': '0.'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'return_statement', 'children': []}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'select_catalogue_events'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'idx'}
Sorts the catalogue into chronological order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'cmp_mat'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '46']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '11', 'type': 'for_statement', 'children': ['12', '15', '24']}; {'id': '12', 'type': 'pattern_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'flat'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'flat'}; {'id': '24', 'type': 'block', 'children': ['25', '39']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '35']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'y'}; {'id': '39', 'type': 'if_statement', 'children': ['40', '43']}; {'id': '40', 'type': 'comparison_operator', 'children': ['41', '42'], 'value': '!='}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'c'}
Sorts two matrices returning a positive or zero value
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sorted_mosaics'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dicom_input'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '54']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sorted_mosaics'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dicom_input'}; {'id': '13', 'type': 'keyword_argument', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '15', 'type': 'lambda', 'children': ['16', '18']}; {'id': '16', 'type': 'lambda_parameters', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'AcquisitionNumber'}; {'id': '21', 'type': 'for_statement', 'children': ['22', '23', '33']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '27']}; {'id': '26', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '32'], 'value': '-'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sorted_mosaics'}; {'id': '32', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'if_statement', 'children': ['35', '48']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '41'], 'value': '>='}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'sorted_mosaics'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'AcquisitionNumber'}; {'id': '41', 'type': 'attribute', 'children': ['42', '47']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sorted_mosaics'}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '+'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'AcquisitionNumber'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'raise_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ConversionValidationError'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"INCONSISTENT_ACQUISITION_NUMBERS"'}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sorted_mosaics'}
Search all mosaics in the dicom directory, sort and validate them
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sequence'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '110']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n sort the points in the line with given option\n '''"}; {'id': '8', 'type': 'if_statement', 'children': ['9', '20']}; {'id': '9', 'type': '()', 'children': ['10']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '19'], 'value': '=='}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'subscript', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'if_statement', 'children': ['22', '34', '60', '99']}; {'id': '22', 'type': '()', 'children': ['23']}; {'id': '23', 'type': 'boolean_operator', 'children': ['24', '29'], 'value': 'or'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '28'], 'value': '=='}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'X'"}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '33'], 'value': '=='}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '33', 'type': 'string', 'children': [], 'value': "'x'"}; {'id': '34', 'type': 'block', 'children': ['35', '51']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '42']}; {'id': '37', 'type': 'attribute', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'lambda', 'children': ['46', '48']}; {'id': '46', 'type': 'lambda_parameters', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '50', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '60', 'type': 'elif_clause', 'children': ['61', '73']}; {'id': '61', 'type': '()', 'children': ['62']}; {'id': '62', 'type': 'boolean_operator', 'children': ['63', '68'], 'value': 'or'}; {'id': '63', 'type': 'comparison_operator', 'children': ['64', '67'], 'value': '=='}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '67', 'type': 'string', 'children': [], 'value': "'Y'"}; {'id': '68', 'type': 'comparison_operator', 'children': ['69', '72'], 'value': '=='}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '72', 'type': 'string', 'children': [], 'value': "'y'"}; {'id': '73', 'type': 'block', 'children': ['74', '90']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '81']}; {'id': '76', 'type': 'attribute', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'keyword_argument', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '84', 'type': 'lambda', 'children': ['85', '87']}; {'id': '85', 'type': 'lambda_parameters', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '89', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '99', 'type': 'else_clause', 'children': ['100']}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '110', 'type': 'if_statement', 'children': ['111', '122']}; {'id': '111', 'type': '()', 'children': ['112']}; {'id': '112', 'type': 'comparison_operator', 'children': ['113', '121'], 'value': '=='}; {'id': '113', 'type': 'call', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '115', 'type': 'argument_list', 'children': ['116']}; {'id': '116', 'type': 'subscript', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '120', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '121', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '122', 'type': 'block', 'children': ['123']}; {'id': '123', 'type': 'if_statement', 'children': ['124', '136', '162', '201', '240']}; {'id': '124', 'type': '()', 'children': ['125']}; {'id': '125', 'type': 'boolean_operator', 'children': ['126', '131'], 'value': 'or'}; {'id': '126', 'type': 'comparison_operator', 'children': ['127', '130'], 'value': '=='}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '130', 'type': 'string', 'children': [], 'value': "'X'"}; {'id': '131', 'type': 'comparison_operator', 'children': ['132', '135'], 'value': '=='}; {'id': '132', 'type': 'attribute', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '135', 'type': 'string', 'children': [], 'value': "'x'"}; {'id': '136', 'type': 'block', 'children': ['137', '153']}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '144']}; {'id': '139', 'type': 'attribute', 'children': ['140', '143']}; {'id': '140', 'type': 'attribute', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'keyword_argument', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '147', 'type': 'lambda', 'children': ['148', '150']}; {'id': '148', 'type': 'lambda_parameters', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '150', 'type': 'subscript', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '152', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '153', 'type': 'expression_statement', 'children': ['154']}; {'id': '154', 'type': 'call', 'children': ['155', '158']}; {'id': '155', 'type': 'attribute', 'children': ['156', '157']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '158', 'type': 'argument_list', 'children': ['159']}; {'id': '159', 'type': 'attribute', 'children': ['160', '161']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '162', 'type': 'elif_clause', 'children': ['163', '175']}; {'id': '163', 'type': '()', 'children': ['164']}; {'id': '164', 'type': 'boolean_operator', 'children': ['165', '170'], 'value': 'or'}; {'id': '165', 'type': 'comparison_operator', 'children': ['166', '169'], 'value': '=='}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '169', 'type': 'string', 'children': [], 'value': "'Y'"}; {'id': '170', 'type': 'comparison_operator', 'children': ['171', '174'], 'value': '=='}; {'id': '171', 'type': 'attribute', 'children': ['172', '173']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '173', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '174', 'type': 'string', 'children': [], 'value': "'y'"}; {'id': '175', 'type': 'block', 'children': ['176', '192']}; {'id': '176', 'type': 'expression_statement', 'children': ['177']}; {'id': '177', 'type': 'call', 'children': ['178', '183']}; {'id': '178', 'type': 'attribute', 'children': ['179', '182']}; {'id': '179', 'type': 'attribute', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '183', 'type': 'argument_list', 'children': ['184']}; {'id': '184', 'type': 'keyword_argument', 'children': ['185', '186']}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '186', 'type': 'lambda', 'children': ['187', '189']}; {'id': '187', 'type': 'lambda_parameters', 'children': ['188']}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '189', 'type': 'subscript', 'children': ['190', '191']}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '191', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '192', 'type': 'expression_statement', 'children': ['193']}; {'id': '193', 'type': 'call', 'children': ['194', '197']}; {'id': '194', 'type': 'attribute', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '197', 'type': 'argument_list', 'children': ['198']}; {'id': '198', 'type': 'attribute', 'children': ['199', '200']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '201', 'type': 'elif_clause', 'children': ['202', '214']}; {'id': '202', 'type': '()', 'children': ['203']}; {'id': '203', 'type': 'boolean_operator', 'children': ['204', '209'], 'value': 'or'}; {'id': '204', 'type': 'comparison_operator', 'children': ['205', '208'], 'value': '=='}; {'id': '205', 'type': 'attribute', 'children': ['206', '207']}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '208', 'type': 'string', 'children': [], 'value': "'Z'"}; {'id': '209', 'type': 'comparison_operator', 'children': ['210', '213'], 'value': '=='}; {'id': '210', 'type': 'attribute', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'Sort'}; {'id': '213', 'type': 'string', 'children': [], 'value': "'Z'"}; {'id': '214', 'type': 'block', 'children': ['215', '231']}; {'id': '215', 'type': 'expression_statement', 'children': ['216']}; {'id': '216', 'type': 'call', 'children': ['217', '222']}; {'id': '217', 'type': 'attribute', 'children': ['218', '221']}; {'id': '218', 'type': 'attribute', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '221', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '222', 'type': 'argument_list', 'children': ['223']}; {'id': '223', 'type': 'keyword_argument', 'children': ['224', '225']}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '225', 'type': 'lambda', 'children': ['226', '228']}; {'id': '226', 'type': 'lambda_parameters', 'children': ['227']}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '228', 'type': 'subscript', 'children': ['229', '230']}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '230', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '231', 'type': 'expression_statement', 'children': ['232']}; {'id': '232', 'type': 'call', 'children': ['233', '236']}; {'id': '233', 'type': 'attribute', 'children': ['234', '235']}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '236', 'type': 'argument_list', 'children': ['237']}; {'id': '237', 'type': 'attribute', 'children': ['238', '239']}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'Points'}; {'id': '240', 'type': 'else_clause', 'children': ['241']}; {'id': '241', 'type': 'block', 'children': ['242']}; {'id': '242', 'type': 'expression_statement', 'children': ['243']}; {'id': '243', 'type': 'call', 'children': ['244', '247']}; {'id': '244', 'type': 'attribute', 'children': ['245', '246']}; {'id': '245', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '246', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '247', 'type': 'argument_list', 'children': ['248']}; {'id': '248', 'type': 'attribute', 'children': ['249', '250']}; {'id': '249', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '250', 'type': 'identifier', 'children': [], 'value': 'Points'}
sort the points in the line with given option
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_items'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '48']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '13', 'type': 'block', 'children': ['14', '23', '39']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'lookup'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21', '22']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'itemCategory'"}; {'id': '22', 'type': 'string', 'children': [], 'value': "'categoryCode'"}; {'id': '23', 'type': 'if_statement', 'children': ['24', '32']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '31'], 'value': 'is'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '38']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '38', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '46']}; {'id': '41', 'type': 'attribute', 'children': ['42', '45']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'category'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}
sorts the items into a dictionary of categories, with a list of items
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_user_permissions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '6', 'type': 'block', 'children': ['7', '20']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'permissions'}; {'id': '10', 'type': 'call', 'children': ['11', '16']}; {'id': '11', 'type': 'attribute', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'user_service'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'getPermissions'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'user_id'}; {'id': '20', 'type': 'return_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'permissions'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'keyName'"}
Returns a sorted list of a users permissions
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_candidate_pairs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'pairs'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ice_controlling'}; {'id': '6', 'type': 'block', 'children': ['7', '24']}; {'id': '7', 'type': 'function_definition', 'children': ['8', '9', '11']}; {'id': '8', 'type': 'function_name', 'children': [], 'value': 'pair_priority'}; {'id': '9', 'type': 'parameters', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'unary_operator', 'children': ['14'], 'value': '-'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'candidate_pair_priority'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '20', '23']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'local_candidate'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'remote_candidate'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ice_controlling'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'pairs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'pair_priority'}
Sort a list of candidate pairs.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12', '18']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_row_col'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'qubits'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'generic_type', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'Iterator'}; {'id': '9', 'type': 'type_parameter', 'children': ['10']}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'GridQubit'}; {'id': '12', 'type': 'type', 'children': ['13']}; {'id': '13', 'type': 'generic_type', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '15', 'type': 'type_parameter', 'children': ['16']}; {'id': '16', 'type': 'type', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'GridQubit'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'qubits'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '26', 'type': 'lambda', 'children': ['27', '29']}; {'id': '27', 'type': 'lambda_parameters', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '29', 'type': 'tuple', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'col'}
Sort grid qubits first by row then by column
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_least_constraining_values_sorter'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'problem'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'assignment'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'domains'}; {'id': '8', 'type': 'block', 'children': ['9', '11', '31', '55']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': "'''\n Sort values based on how many conflicts they generate if assigned.\n '''"}; {'id': '11', 'type': 'function_definition', 'children': ['12', '13', '15']}; {'id': '12', 'type': 'function_name', 'children': [], 'value': 'update_assignment'}; {'id': '13', 'type': 'parameters', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '15', 'type': 'block', 'children': ['16', '23', '29']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'new_assignment'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'deepcopy'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'assignment'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '28']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'new_assignment'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'new_assignment'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '43']}; {'id': '37', 'type': 'subscript', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'domains'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '41', 'type': 'slice', 'children': ['42']}; {'id': '42', 'type': 'colon', 'children': []}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'lambda', 'children': ['46', '48']}; {'id': '46', 'type': 'lambda_parameters', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_count_conflicts'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52', '53', '54']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'problem'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'assignment'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'variable'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'values'}
Sort values based on how many conflicts they generate if assigned.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reading_order'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'e1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'e2'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '19', '58']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'e1'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bbox'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'e2'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'bbox'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '47']}; {'id': '20', 'type': 'boolean_operator', 'children': ['21', '34'], 'value': 'or'}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '28'], 'value': '=='}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '41'], 'value': '=='}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'float_cmp'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '55']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '55', 'type': 'subscript', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '58', 'type': 'return_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'float_cmp'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'y0'}
A comparator to sort bboxes from top to bottom, left to right
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'xy_reading_order'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'e1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'e2'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '19', '44']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'e1'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'bbox'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'e2'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'bbox'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '33']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '27'], 'value': '=='}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'round'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'float_cmp'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'float_cmp'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '51']}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'b1'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'b2'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'x0'}
A comparator to sort bboxes from left to right, top to bottom
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_param_dict'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '56']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'param_dict'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '14', '20']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'for_statement', 'children': ['22', '25', '30']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'dictionary'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'block', 'children': ['31', '50']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'param_name'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'string', 'children': [], 'value': "'{param_name}[{index}][{key}]'"}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '44', '47']}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'param_name'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'param_name'}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '55']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'param_dict'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'param_name'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'param_dict'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '67', 'type': 'argument_list', 'children': []}
Sorts to ensure Order is consistent for Testing
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'datetimes'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_calculate_timestamps'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '22', 'type': 'generator_expression', 'children': ['23', '32']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'DateTime'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'from_moy'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'is_leap_year'}; {'id': '32', 'type': 'for_in_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}
A sorted list of datetimes in this analysis period.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hoys'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_calculate_timestamps'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '22', 'type': 'generator_expression', 'children': ['23', '26']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '/'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '25', 'type': 'float', 'children': [], 'value': '60.0'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}
A sorted list of hours of year in this analysis period.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hoys_int'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': 'is'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_calculate_timestamps'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '22', 'type': 'generator_expression', 'children': ['23', '29']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '28'], 'value': '/'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '28', 'type': 'float', 'children': [], 'value': '60.0'}; {'id': '29', 'type': 'for_in_clause', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'moy'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_timestamps_data'}
A sorted list of hours of year in this analysis period as integers.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'doys_int'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11', '24']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_is_reversed'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_calc_daystamps'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'st_time'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '24', 'type': 'else_clause', 'children': ['25']}; {'id': '25', 'type': 'block', 'children': ['26', '43', '60']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'doys_st'}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_calc_daystamps'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'st_time'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'DateTime'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'from_hoy'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'integer', 'children': [], 'value': '8759'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'doys_end'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_calc_daystamps'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '57']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'DateTime'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'from_hoy'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '63'], 'value': '+'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'doys_st'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'doys_end'}
A sorted list of days of the year in this analysis period as integers.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'months_int'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11', '31']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_is_reversed'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'st_time'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'month'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '30'], 'value': '+'}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'month'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33', '48', '65']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'months_st'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '47']}; {'id': '42', 'type': 'attribute', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'st_time'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'month'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '13'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'months_end'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58']}; {'id': '57', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '64'], 'value': '+'}; {'id': '59', 'type': 'attribute', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'end_time'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'month'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '65', 'type': 'return_statement', 'children': ['66']}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '+'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'months_st'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'months_end'}
A sorted list of months of the year in this analysis period as integers.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_snps'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '5', 'type': 'block', 'children': ['6', '22', '41', '60', '81', '92', '105']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '19']}; {'id': '12', 'type': 'call', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'subscript', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'unique'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_natural_sort_key'}; {'id': '22', 'type': 'if_statement', 'children': ['23', '26']}; {'id': '23', 'type': 'comparison_operator', 'children': ['24', '25'], 'value': 'in'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"PAR"'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '26', 'type': 'block', 'children': ['27', '34']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'string', 'children': [], 'value': '"PAR"'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'string', 'children': [], 'value': '"PAR"'}; {'id': '41', 'type': 'if_statement', 'children': ['42', '45']}; {'id': '42', 'type': 'comparison_operator', 'children': ['43', '44'], 'value': 'in'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"MT"'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '45', 'type': 'block', 'children': ['46', '53']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"MT"'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'string', 'children': [], 'value': '"MT"'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '65']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '64', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '65', 'type': 'call', 'children': ['66', '71']}; {'id': '66', 'type': 'attribute', 'children': ['67', '70']}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '69', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '71', 'type': 'argument_list', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'CategoricalDtype'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '78']}; {'id': '75', 'type': 'keyword_argument', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'sorted_list'}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '80', 'type': 'True', 'children': []}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'sort_values'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'list', 'children': ['90', '91'], 'value': '["chrom", "pos"]'}; {'id': '90', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '91', 'type': 'string', 'children': [], 'value': '"pos"'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '97']}; {'id': '94', 'type': 'subscript', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '96', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '97', 'type': 'call', 'children': ['98', '103']}; {'id': '98', 'type': 'attribute', 'children': ['99', '102']}; {'id': '99', 'type': 'subscript', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'snps'}; {'id': '101', 'type': 'string', 'children': [], 'value': '"chrom"'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'astype'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'object'}; {'id': '105', 'type': 'return_statement', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'snps'}
Sort SNPs based on ordered chromosome list and position.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_python'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '6', 'type': 'block', 'children': ['7', '28', '34', '40', '59', '68', '86']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '12']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'multiselect'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'if_statement', 'children': ['14', '22']}; {'id': '14', 'type': 'boolean_operator', 'children': ['15', '16'], 'value': 'and'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '26', 'type': 'list', 'children': ['27'], 'value': '[value]'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '31', 'type': 'boolean_operator', 'children': ['32', '33'], 'value': 'or'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '33', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'records'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'SortedDict'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'for_statement', 'children': ['41', '42', '43']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '43', 'type': 'block', 'children': ['44', '51']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'validate_value'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '58']}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'records'}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'return_value'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '_set'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'records'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '81']}; {'id': '70', 'type': 'subscript', 'children': ['71', '78']}; {'id': '71', 'type': 'subscript', 'children': ['72', '77']}; {'id': '72', 'type': 'attribute', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'record'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': '_raw'}; {'id': '77', 'type': 'string', 'children': [], 'value': "'values'"}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'get_swimlane'}; {'id': '85', 'type': 'argument_list', 'children': []}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'return_value'}
Expect list of record instances, convert to a SortedDict for internal representation
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'validate_sort_fields'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': "','"}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}; {'id': '19', 'type': 'if_statement', 'children': ['20', '23']}; {'id': '20', 'type': 'comparison_operator', 'children': ['21', '22'], 'value': '=='}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'get_output_fields'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'formatting'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'validate_sort_fields'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'boolean_operator', 'children': ['39', '40'], 'value': 'or'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sort_fields'}
Take care of sorting.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'sort_dir'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'asc'"}; {'id': '9', 'type': 'block', 'children': ['10', '20']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'log'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '18', '19']}; {'id': '16', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Sort by `%s` %s."'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sort_dir'}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'eval_js'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': '\'table.sortBy("{}", "{}");\''}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sort_dir'}
Sort by a given variable.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'regex_opt_inner'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '21', '27', '44', '65', '147', '154', '189', '203', '210', '254']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '10', 'type': 'boolean_operator', 'children': ['11', '14'], 'value': 'or'}; {'id': '11', 'type': 'boolean_operator', 'children': ['12', '13'], 'value': 'and'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '13', 'type': 'string', 'children': [], 'value': "')'"}; {'id': '14', 'type': 'string', 'children': [], 'value': "''"}; {'id': '15', 'type': 'if_statement', 'children': ['16', '18']}; {'id': '16', 'type': 'not_operator', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'string', 'children': [], 'value': "''"}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '34']}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '33'], 'value': '=='}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '43'], 'value': '+'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '39'], 'value': '+'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'escape'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '44', 'type': 'if_statement', 'children': ['45', '47']}; {'id': '45', 'type': 'not_operator', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '64'], 'value': '+'}; {'id': '50', 'type': 'binary_operator', 'children': ['51', '62', '63'], 'value': '+'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '53'], 'value': '+'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'regex_opt_inner'}; {'id': '55', 'type': 'argument_list', 'children': ['56', '61']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '58', 'type': 'slice', 'children': ['59', '60']}; {'id': '59', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '60', 'type': 'colon', 'children': []}; {'id': '61', 'type': 'string', 'children': [], 'value': "'(?:'"}; {'id': '62', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '63', 'type': 'string', 'children': [], 'value': "'?'"}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '65', 'type': 'if_statement', 'children': ['66', '72']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '71'], 'value': '=='}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '72', 'type': 'block', 'children': ['73', '77', '81', '109']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'oneletter'}; {'id': '76', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'rest'}; {'id': '80', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '81', 'type': 'for_statement', 'children': ['82', '83', '84']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'id': '85', 'type': 'if_statement', 'children': ['86', '92', '100']}; {'id': '86', 'type': 'comparison_operator', 'children': ['87', '91'], 'value': '=='}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '91', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'oneletter'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '100', 'type': 'else_clause', 'children': ['101']}; {'id': '101', 'type': 'block', 'children': ['102']}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'rest'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '109', 'type': 'if_statement', 'children': ['110', '116']}; {'id': '110', 'type': 'comparison_operator', 'children': ['111', '115'], 'value': '>'}; {'id': '111', 'type': 'call', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '113', 'type': 'argument_list', 'children': ['114']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'oneletter'}; {'id': '115', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '116', 'type': 'block', 'children': ['117', '138']}; {'id': '117', 'type': 'if_statement', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'rest'}; {'id': '119', 'type': 'block', 'children': ['120']}; {'id': '120', 'type': 'return_statement', 'children': ['121']}; {'id': '121', 'type': 'binary_operator', 'children': ['122', '137'], 'value': '+'}; {'id': '122', 'type': 'binary_operator', 'children': ['123', '132', '133'], 'value': '+'}; {'id': '123', 'type': 'binary_operator', 'children': ['124', '131'], 'value': '+'}; {'id': '124', 'type': 'binary_operator', 'children': ['125', '126'], 'value': '+'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '126', 'type': 'call', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'regex_opt_inner'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'rest'}; {'id': '130', 'type': 'string', 'children': [], 'value': "''"}; {'id': '131', 'type': 'string', 'children': [], 'value': "'|'"}; {'id': '132', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '133', 'type': 'call', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'make_charset'}; {'id': '135', 'type': 'argument_list', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'oneletter'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '138', 'type': 'return_statement', 'children': ['139']}; {'id': '139', 'type': 'binary_operator', 'children': ['140', '146'], 'value': '+'}; {'id': '140', 'type': 'binary_operator', 'children': ['141', '142'], 'value': '+'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '142', 'type': 'call', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'make_charset'}; {'id': '144', 'type': 'argument_list', 'children': ['145']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'oneletter'}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'assignment', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '150', 'type': 'call', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'commonprefix'}; {'id': '152', 'type': 'argument_list', 'children': ['153']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '154', 'type': 'if_statement', 'children': ['155', '156']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '156', 'type': 'block', 'children': ['157', '164']}; {'id': '157', 'type': 'expression_statement', 'children': ['158']}; {'id': '158', 'type': 'assignment', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'plen'}; {'id': '160', 'type': 'call', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '162', 'type': 'argument_list', 'children': ['163']}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '164', 'type': 'return_statement', 'children': ['165']}; {'id': '165', 'type': 'binary_operator', 'children': ['166', '187', '188'], 'value': '+'}; {'id': '166', 'type': 'binary_operator', 'children': ['167', '173', '174'], 'value': '+'}; {'id': '167', 'type': 'binary_operator', 'children': ['168', '169'], 'value': '+'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '169', 'type': 'call', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'escape'}; {'id': '171', 'type': 'argument_list', 'children': ['172']}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '173', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '174', 'type': 'call', 'children': ['175', '176']}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'regex_opt_inner'}; {'id': '176', 'type': 'argument_list', 'children': ['177', '186']}; {'id': '177', 'type': 'list_comprehension', 'children': ['178', '183']}; {'id': '178', 'type': 'subscript', 'children': ['179', '180']}; {'id': '179', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '180', 'type': 'slice', 'children': ['181', '182']}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'plen'}; {'id': '182', 'type': 'colon', 'children': []}; {'id': '183', 'type': 'for_in_clause', 'children': ['184', '185']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '185', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '186', 'type': 'string', 'children': [], 'value': "'(?:'"}; {'id': '187', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '188', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '189', 'type': 'expression_statement', 'children': ['190']}; {'id': '190', 'type': 'assignment', 'children': ['191', '192']}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'strings_rev'}; {'id': '192', 'type': 'list_comprehension', 'children': ['193', '200']}; {'id': '193', 'type': 'subscript', 'children': ['194', '195']}; {'id': '194', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '195', 'type': 'slice', 'children': ['196', '197', '198']}; {'id': '196', 'type': 'colon', 'children': []}; {'id': '197', 'type': 'colon', 'children': []}; {'id': '198', 'type': 'unary_operator', 'children': ['199'], 'value': '-'}; {'id': '199', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '200', 'type': 'for_in_clause', 'children': ['201', '202']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '203', 'type': 'expression_statement', 'children': ['204']}; {'id': '204', 'type': 'assignment', 'children': ['205', '206']}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'suffix'}; {'id': '206', 'type': 'call', 'children': ['207', '208']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'commonprefix'}; {'id': '208', 'type': 'argument_list', 'children': ['209']}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'strings_rev'}; {'id': '210', 'type': 'if_statement', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'suffix'}; {'id': '212', 'type': 'block', 'children': ['213', '220']}; {'id': '213', 'type': 'expression_statement', 'children': ['214']}; {'id': '214', 'type': 'assignment', 'children': ['215', '216']}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'slen'}; {'id': '216', 'type': 'call', 'children': ['217', '218']}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '218', 'type': 'argument_list', 'children': ['219']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'suffix'}; {'id': '220', 'type': 'return_statement', 'children': ['221']}; {'id': '221', 'type': 'binary_operator', 'children': ['222', '253'], 'value': '+'}; {'id': '222', 'type': 'binary_operator', 'children': ['223', '242', '243'], 'value': '+'}; {'id': '223', 'type': 'binary_operator', 'children': ['224', '225', '226'], 'value': '+'}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '225', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '226', 'type': 'call', 'children': ['227', '228']}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'regex_opt_inner'}; {'id': '228', 'type': 'argument_list', 'children': ['229', '241']}; {'id': '229', 'type': 'call', 'children': ['230', '231']}; {'id': '230', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '231', 'type': 'generator_expression', 'children': ['232', '238']}; {'id': '232', 'type': 'subscript', 'children': ['233', '234']}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '234', 'type': 'slice', 'children': ['235', '236']}; {'id': '235', 'type': 'colon', 'children': []}; {'id': '236', 'type': 'unary_operator', 'children': ['237'], 'value': '-'}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'slen'}; {'id': '238', 'type': 'for_in_clause', 'children': ['239', '240']}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '240', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '241', 'type': 'string', 'children': [], 'value': "'(?:'"}; {'id': '242', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '243', 'type': 'call', 'children': ['244', '245']}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'escape'}; {'id': '245', 'type': 'argument_list', 'children': ['246']}; {'id': '246', 'type': 'subscript', 'children': ['247', '248']}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 'suffix'}; {'id': '248', 'type': 'slice', 'children': ['249', '250', '251']}; {'id': '249', 'type': 'colon', 'children': []}; {'id': '250', 'type': 'colon', 'children': []}; {'id': '251', 'type': 'unary_operator', 'children': ['252'], 'value': '-'}; {'id': '252', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '253', 'type': 'identifier', 'children': [], 'value': 'close_paren'}; {'id': '254', 'type': 'return_statement', 'children': ['255']}; {'id': '255', 'type': 'binary_operator', 'children': ['256', '289', '290'], 'value': '+'}; {'id': '256', 'type': 'binary_operator', 'children': ['257', '258'], 'value': '+'}; {'id': '257', 'type': 'identifier', 'children': [], 'value': 'open_paren'}; {'id': '258', 'type': 'call', 'children': ['259', '262']}; {'id': '259', 'type': 'attribute', 'children': ['260', '261']}; {'id': '260', 'type': 'string', 'children': [], 'value': "'|'"}; {'id': '261', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '262', 'type': 'generator_expression', 'children': ['263', '273']}; {'id': '263', 'type': 'call', 'children': ['264', '265']}; {'id': '264', 'type': 'identifier', 'children': [], 'value': 'regex_opt_inner'}; {'id': '265', 'type': 'argument_list', 'children': ['266', '272']}; {'id': '266', 'type': 'call', 'children': ['267', '268']}; {'id': '267', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '268', 'type': 'argument_list', 'children': ['269']}; {'id': '269', 'type': 'subscript', 'children': ['270', '271']}; {'id': '270', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '271', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '272', 'type': 'string', 'children': [], 'value': "''"}; {'id': '273', 'type': 'for_in_clause', 'children': ['274', '275']}; {'id': '274', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '275', 'type': 'call', 'children': ['276', '277']}; {'id': '276', 'type': 'identifier', 'children': [], 'value': 'groupby'}; {'id': '277', 'type': 'argument_list', 'children': ['278', '279']}; {'id': '278', 'type': 'identifier', 'children': [], 'value': 'strings'}; {'id': '279', 'type': 'lambda', 'children': ['280', '282']}; {'id': '280', 'type': 'lambda_parameters', 'children': ['281']}; {'id': '281', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '282', 'type': 'comparison_operator', 'children': ['283', '286'], 'value': '=='}; {'id': '283', 'type': 'subscript', 'children': ['284', '285']}; {'id': '284', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '285', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '286', 'type': 'subscript', 'children': ['287', '288']}; {'id': '287', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '288', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '289', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '290', 'type': 'identifier', 'children': [], 'value': 'close_paren'}
Return a regex that matches any string in the sorted list of strings.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_iterargs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '6', 'type': 'block', 'children': ['7', '17']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_get_aggregate_args'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'mandatoryArgs'"}; {'id': '17', 'type': 'return_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'list_comprehension', 'children': ['25', '26', '29']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '29', 'type': 'if_clause', 'children': ['30']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': 'in'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'arg'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'iterargs'}
Returns a tuple of all iterags for item, sorted by name.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'by_own_time_per_call'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'tuple', 'children': ['8', '20']}; {'id': '8', 'type': 'conditional_expression', 'children': ['9', '13', '16'], 'value': 'if'}; {'id': '9', 'type': 'unary_operator', 'children': ['10'], 'value': '-'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'own_time_per_call'}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'own_hits'}; {'id': '16', 'type': 'unary_operator', 'children': ['17'], 'value': '-'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'stat'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'own_time'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'by_deep_time_per_call'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'stat'}
Sorting by exclusive elapsed time per call in descending order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '10']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'for_statement', 'children': ['12', '15', '16']}; {'id': '12', 'type': 'pattern_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'wire1'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'wire2'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'if_statement', 'children': ['18', '25']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '>'}; {'id': '19', 'type': 'subscript', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'wire1'}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'wire2'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '35']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '32']}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'wire1'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'wire2'}; {'id': '35', 'type': 'expression_list', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'wire2'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'wire1'}
Sort the values in-place based on the connectors in the network.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getWorkersName'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '24', '37']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'fichier'}; {'id': '11', 'type': 'for_in_clause', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fichier'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'try_statement', 'children': ['25', '33']}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'string', 'children': [], 'value': '"broker"'}; {'id': '33', 'type': 'except_clause', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'pass_statement', 'children': []}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'names'}
Returns the list of the names of the workers sorted alphabetically
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'todos'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '9', 'type': 'call', 'children': ['10', '15']}; {'id': '10', 'type': 'attribute', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_sorter'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'todolist'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'todos'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': '_apply_filters'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'result'}
Returns a sorted and filtered list of todos in this view.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'group'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'p_todos'}; {'id': '6', 'type': 'block', 'children': ['7', '17', '27', '131', '152']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'p_todos'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_apply_sort_functions'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'p_todos'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'pregroupfunctions'}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'list', 'children': ['24'], 'value': '[((), p_todos)]'}; {'id': '24', 'type': 'tuple', 'children': ['25', '26']}; {'id': '25', 'type': 'tuple', 'children': []}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'p_todos'}; {'id': '27', 'type': 'for_statement', 'children': ['28', '33', '36']}; {'id': '28', 'type': 'pattern_list', 'children': ['29', '32']}; {'id': '29', 'type': 'tuple_pattern', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'function'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'groupfunctions'}; {'id': '36', 'type': 'block', 'children': ['37', '41', '47']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'oldresult'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '46', 'type': 'argument_list', 'children': []}; {'id': '47', 'type': 'for_statement', 'children': ['48', '51', '56']}; {'id': '48', 'type': 'pattern_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'oldkey'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'oldgroup'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'oldresult'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'for_statement', 'children': ['58', '61', '66']}; {'id': '58', 'type': 'pattern_list', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': '_group'}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'groupby'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'oldgroup'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'function'}; {'id': '66', 'type': 'block', 'children': ['67', '74', '87']}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'newgroup'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': '_group'}; {'id': '74', 'type': 'if_statement', 'children': ['75', '81']}; {'id': '75', 'type': 'not_operator', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '78', 'type': 'argument_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '81', 'type': 'block', 'children': ['82']}; {'id': '82', 'type': 'expression_statement', 'children': ['83']}; {'id': '83', 'type': 'assignment', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '85', 'type': 'list', 'children': ['86'], 'value': '[key]'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '87', 'type': 'for_statement', 'children': ['88', '89', '90']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'subkey'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '90', 'type': 'block', 'children': ['91', '101', '108']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'subkey'}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'string', 'children': [], 'value': '"{}: {}"'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'subkey'}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'assignment', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'newkey'}; {'id': '104', 'type': 'binary_operator', 'children': ['105', '106'], 'value': '+'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'oldkey'}; {'id': '106', 'type': 'tuple', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'subkey'}; {'id': '108', 'type': 'if_statement', 'children': ['109', '112', '123']}; {'id': '109', 'type': 'comparison_operator', 'children': ['110', '111'], 'value': 'in'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'newkey'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '112', 'type': 'block', 'children': ['113']}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'assignment', 'children': ['115', '118']}; {'id': '115', 'type': 'subscript', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'newkey'}; {'id': '118', 'type': 'binary_operator', 'children': ['119', '122'], 'value': '+'}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'newkey'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'newgroup'}; {'id': '123', 'type': 'else_clause', 'children': ['124']}; {'id': '124', 'type': 'block', 'children': ['125']}; {'id': '125', 'type': 'expression_statement', 'children': ['126']}; {'id': '126', 'type': 'assignment', 'children': ['127', '130']}; {'id': '127', 'type': 'subscript', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'newkey'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'newgroup'}; {'id': '131', 'type': 'for_statement', 'children': ['132', '135', '140']}; {'id': '132', 'type': 'pattern_list', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': '_group'}; {'id': '135', 'type': 'call', 'children': ['136', '139']}; {'id': '136', 'type': 'attribute', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '139', 'type': 'argument_list', 'children': []}; {'id': '140', 'type': 'block', 'children': ['141']}; {'id': '141', 'type': 'expression_statement', 'children': ['142']}; {'id': '142', 'type': 'assignment', 'children': ['143', '146']}; {'id': '143', 'type': 'subscript', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '146', 'type': 'call', 'children': ['147', '150']}; {'id': '147', 'type': 'attribute', 'children': ['148', '149']}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '150', 'type': 'argument_list', 'children': ['151']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': '_group'}; {'id': '152', 'type': 'return_statement', 'children': ['153']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'result'}
Groups the todos according to the given group string.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '17']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'recursive'}; {'id': '16', 'type': 'False', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '34', '54', '63']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '21', 'type': 'conditional_expression', 'children': ['22', '27', '29'], 'value': 'if'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'listflat'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '27', 'type': 'not_operator', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'recursive'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'listrecursive'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '41']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '40'], 'value': '<'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '40', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '41', 'type': 'block', 'children': ['42']}; {'id': '42', 'type': 'raise_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'FileNotFoundError'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '%'}; {'id': '47', 'type': 'string', 'children': [], 'value': '\'Cannot find files of type "%s" in %s\''}; {'id': '48', 'type': 'tuple', 'children': ['49', '53']}; {'id': '49', 'type': 'conditional_expression', 'children': ['50', '51', '52'], 'value': 'if'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'ext'}; {'id': '52', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'select'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61', '62']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'files'}
Get sorted list of file paths matching path and extension