sequence
stringlengths
1.37k
35.1k
docstring
stringlengths
17
102
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_query_paths'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'reversed'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '15', 'type': 'generator_expression', 'children': ['16', '19']}; {'id': '16', 'type': 'subscript', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '18', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '21', 'type': 'call', 'children': ['22', '29']}; {'id': '22', 'type': 'attribute', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'alias_to_query_paths'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'name'}
RETURN A LIST OF ALL SCHEMA'S IN DEPTH-FIRST TOPOLOGICAL ORDER
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'add_arguments'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '6', 'type': 'block', 'children': ['7', '22']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '14', 'type': 'keyword_argument', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'option_strings'"}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '31']}; {'id': '24', 'type': 'attribute', 'children': ['25', '30']}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'SortedHelpFormatter'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'add_arguments'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'actions'}
Sort the flags alphabetically
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_iter_indented_subactions'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'try_statement', 'children': ['8', '15', '19']}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'get_subactions'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_get_subactions'}; {'id': '15', 'type': 'except_clause', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'pass_statement', 'children': []}; {'id': '19', 'type': 'else_clause', 'children': ['20']}; {'id': '20', 'type': 'block', 'children': ['21', '27', '67']}; {'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': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_indent'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'if_statement', 'children': ['28', '35', '56']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'action'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'argparse'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_SubParsersAction'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'for_statement', 'children': ['37', '38', '52']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'subaction'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '44']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'get_subactions'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '46', 'type': 'lambda', 'children': ['47', '49']}; {'id': '47', 'type': 'lambda_parameters', 'children': ['48']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'dest'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'yield', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'subaction'}; {'id': '56', 'type': 'else_clause', 'children': ['57']}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'for_statement', 'children': ['59', '60', '63']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'subaction'}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'get_subactions'}; {'id': '62', 'type': 'argument_list', 'children': []}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'yield', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'subaction'}; {'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': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_dedent'}; {'id': '72', 'type': 'argument_list', 'children': []}
Sort the subcommands alphabetically
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort2sql'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '10']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': '""'}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '16'], 'value': '+'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'SQL_ORDERBY'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sql_list'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '37']}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '27'], 'value': '+'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'quote_column'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '27', 'type': '()', 'children': ['28']}; {'id': '28', 'type': 'conditional_expression', 'children': ['29', '30', '36'], 'value': 'if'}; {'id': '29', 'type': 'string', 'children': [], 'value': '" DESC"'}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '34'], 'value': '=='}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '34', 'type': 'unary_operator', 'children': ['35'], 'value': '-'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '36', 'type': 'string', 'children': [], 'value': '""'}; {'id': '37', 'type': 'for_in_clause', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sort'}
RETURN ORDER BY CLAUSE
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zset_example'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '10', '15', '21', '27', '40', '62', '71', '78', '85', '92', '101', '106', '113']}; {'id': '5', 'type': 'import_from_statement', 'children': ['6', '8']}; {'id': '6', 'type': 'dotted_name', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'uuid'}; {'id': '8', 'type': 'dotted_name', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'uuid4'}; {'id': '10', 'type': 'import_from_statement', 'children': ['11', '13']}; {'id': '11', 'type': 'dotted_name', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'redis'}; {'id': '13', 'type': 'dotted_name', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'StrictRedis'}; {'id': '15', 'type': 'import_from_statement', 'children': ['16', '19']}; {'id': '16', 'type': 'dotted_name', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'zato'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'redis_paginator'}; {'id': '19', 'type': 'dotted_name', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ZSetPaginator'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'conn'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'StrictRedis'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'string', 'children': [], 'value': "'paginator:{}'"}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '39']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'uuid4'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'hex'}; {'id': '40', 'type': 'for_statement', 'children': ['41', '42', '47']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '46', 'type': 'integer', 'children': [], 'value': '18'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'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': 'conn'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'zadd'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55', '56']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '+'}; {'id': '60', 'type': 'integer', 'children': [], 'value': '96'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'ZSetPaginator'}; {'id': '67', 'type': 'argument_list', 'children': ['68', '69', '70']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'conn'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'num_pages'}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'page_range'}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '104', 'type': 'argument_list', 'children': ['105']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '106', 'type': 'expression_statement', 'children': ['107']}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'attribute', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'page'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'object_list'}; {'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': 'conn'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'delete'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'key'}
Example sorted set pagination.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_entries'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '57', '63', '69']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '11']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '11', 'type': 'expression_list', 'children': ['12', '13']}; {'id': '12', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '13', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '14', 'type': 'for_statement', 'children': ['15', '16', '22']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'if_statement', 'children': ['24', '40', '48']}; {'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': 'isdir'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '37']}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'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': 'dirs'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '48', 'type': 'else_clause', 'children': ['49']}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'entry'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '62', 'type': 'argument_list', 'children': []}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'return_statement', 'children': ['70']}; {'id': '70', 'type': 'expression_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'files'}
Return sorted lists of directories and files in the given path.
{'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': 'ctx'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '22', '30', '38', '49']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '9', 'type': 'attribute', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'vcf_handle'}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'handle'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '25', 'type': 'attribute', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '33', 'type': 'attribute', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ctx'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'print_headers'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43', '46']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '49', 'type': 'for_statement', 'children': ['50', '51', '55']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'sort_variants'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'vcf_handle'}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'print_variant'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '63', '66']}; {'id': '60', 'type': 'keyword_argument', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'variant_line'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '63', 'type': 'keyword_argument', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'outfile'}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'silent'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'silent'}
Sort the variants of a vcf file
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_header'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'header_text'}; {'id': '5', 'type': 'block', 'children': ['6', '19', '23', '56', '60', '64', '126']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '9', 'type': 'call', 'children': ['10', '17']}; {'id': '10', 'type': 'attribute', 'children': ['11', '16']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'header_text'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'rstrip'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'rlens'}; {'id': '22', 'type': 'dictionary', 'children': []}; {'id': '23', 'type': 'for_statement', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'ln'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '26', 'type': 'block', 'children': ['27', '37']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'string', 'children': [], 'value': "'@SQ\\tSN:(\\S+)\\tLN:(\\S+)'"}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'ln'}; {'id': '37', 'type': 'if_statement', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '50']}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'rlens'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'assignment', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '59', 'type': 'string', 'children': [], 'value': "''"}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'done_lens'}; {'id': '63', 'type': 'False', 'children': []}; {'id': '64', 'type': 'for_statement', 'children': ['65', '66', '67']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'ln'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'if_statement', 'children': ['69', '76', '113']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '73', 'type': 'argument_list', 'children': ['74', '75']}; {'id': '74', 'type': 'string', 'children': [], 'value': "'@SQ\\tSN:'"}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'ln'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'if_statement', 'children': ['78', '80']}; {'id': '78', 'type': 'not_operator', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'done_lens'}; {'id': '80', 'type': 'block', 'children': ['81', '85']}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'done_lens'}; {'id': '84', 'type': 'True', 'children': []}; {'id': '85', 'type': 'for_statement', 'children': ['86', '87', '95']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '87', 'type': 'call', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'rlens'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '94', 'type': 'argument_list', 'children': []}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'augmented_assignment', 'children': ['98', '99'], 'value': '+='}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '99', 'type': 'binary_operator', 'children': ['100', '112'], 'value': '+'}; {'id': '100', 'type': 'binary_operator', 'children': ['101', '106'], 'value': '+'}; {'id': '101', 'type': 'binary_operator', 'children': ['102', '105'], 'value': '+'}; {'id': '102', 'type': 'binary_operator', 'children': ['103', '104'], 'value': '+'}; {'id': '103', 'type': 'string', 'children': [], 'value': '"@SQ\\tSN:"'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '105', 'type': 'string', 'children': [], 'value': '"\\tLN:"'}; {'id': '106', 'type': 'call', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'subscript', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'rlens'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '112', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '113', 'type': 'else_clause', 'children': ['114']}; {'id': '114', 'type': 'block', 'children': ['115']}; {'id': '115', 'type': 'expression_statement', 'children': ['116']}; {'id': '116', 'type': 'augmented_assignment', 'children': ['117', '118'], 'value': '+='}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '118', 'type': 'binary_operator', 'children': ['119', '125'], 'value': '+'}; {'id': '119', 'type': 'call', 'children': ['120', '123']}; {'id': '120', 'type': 'attribute', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'ln'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'rstrip'}; {'id': '123', 'type': 'argument_list', 'children': ['124']}; {'id': '124', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '125', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '126', 'type': 'return_statement', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'output'}
sort the chromosomes in a header text
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'field_name'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '12', 'type': 'list_comprehension', 'children': ['13', '19', '26']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '23']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '26', 'type': 'if_clause', 'children': ['27']}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'is'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'field_name'}
Clears sorting criteria affecting ``field_name``.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_transcripts'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '36']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'txs'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'transcripts'}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '17', 'type': 'lambda', 'children': ['18', '20']}; {'id': '18', 'type': 'lambda_parameters', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '20', 'type': 'tuple', 'children': ['21', '26', '31']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': '_transcripts'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'txs'}
Sort the transcripts stored here
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_priority'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'iterable'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'default_priority'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '10'}; {'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': 'sorted'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '20']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'iterable'}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '22', 'type': 'lambda', 'children': ['23', '25']}; {'id': '23', 'type': 'lambda_parameters', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29', '30']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'o'}; {'id': '29', 'type': 'string', 'children': [], 'value': "'priority'"}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'default_priority'}
Return a list or objects sorted by a priority value.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_kw_matches'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'skw_matches'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'block', 'children': ['9', '20', '31']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorted_keywords'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'skw_matches'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_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': 'sorted_keywords'}; {'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': 'cmp_to_key'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_skw_matches_comparator'}; {'id': '31', 'type': 'return_statement', 'children': ['32']}; {'id': '32', 'type': 'boolean_operator', 'children': ['33', '40'], 'value': 'or'}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '35'], 'value': 'and'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'sorted_keywords'}; {'id': '37', 'type': 'slice', 'children': ['38', '39']}; {'id': '38', 'type': 'colon', 'children': []}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sorted_keywords'}
Return a resized version of keywords to the given length.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list_engines_by_priority'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'engines'}; {'id': '6', 'type': 'None', 'children': []}; {'id': '7', 'type': 'block', 'children': ['8', '17']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '12']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '11'], 'value': 'is'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'engines'}; {'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': 'engines'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'ENGINES'}; {'id': '17', 'type': 'return_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'engines'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'methodcaller'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'string', 'children': [], 'value': '"priority"'}
Return a list of engines supported sorted by each priority.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '19', '31']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_chain'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '7']}; {'id': '5', 'type': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'ranges'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'generic_type', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'Iterable'}; {'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': 'Tuple'}; {'id': '14', 'type': 'type_parameter', 'children': ['15', '17']}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '17', 'type': 'type', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '19', 'type': 'type', 'children': ['20']}; {'id': '20', 'type': 'generic_type', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '22', 'type': 'type_parameter', 'children': ['23']}; {'id': '23', 'type': 'type', 'children': ['24']}; {'id': '24', 'type': 'generic_type', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '26', 'type': 'type_parameter', 'children': ['27', '29']}; {'id': '27', 'type': 'type', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '29', 'type': 'type', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'itertools'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'chain'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'list_splat', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'ranges'}
Chain & sort ranges.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'topological_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dependency_pairs'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '15', '22', '26', '68', '80', '109', '125']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"Sort values subject to dependency constraints"'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'defaultdict'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'tails'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'defaultdict'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'heads'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '30', '31']}; {'id': '27', 'type': 'pattern_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'dependency_pairs'}; {'id': '31', 'type': 'block', 'children': ['32', '38']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'augmented_assignment', 'children': ['34', '37'], 'value': '+='}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '38', 'type': 'if_statement', 'children': ['39', '42', '52']}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '41'], 'value': 'in'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'tails'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'tails'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '52', 'type': 'else_clause', 'children': ['53']}; {'id': '53', 'type': 'block', 'children': ['54', '61']}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '59']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'tails'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '59', 'type': 'list', 'children': ['60'], 'value': '[t]'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'heads'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'assignment', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '71', 'type': 'list_comprehension', 'children': ['72', '73', '76']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '73', 'type': 'for_in_clause', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'heads'}; {'id': '76', 'type': 'if_clause', 'children': ['77']}; {'id': '77', 'type': 'comparison_operator', 'children': ['78', '79'], 'value': 'not'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '80', 'type': 'for_statement', 'children': ['81', '82', '83']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'for_statement', 'children': ['85', '86', '89']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'tails'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '89', 'type': 'block', 'children': ['90', '96']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'augmented_assignment', 'children': ['92', '95'], 'value': '-='}; {'id': '92', 'type': 'subscript', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '96', 'type': 'if_statement', 'children': ['97', '101']}; {'id': '97', 'type': 'not_operator', 'children': ['98']}; {'id': '98', 'type': 'subscript', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 't'}; {'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': 'ordered'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '109', 'type': 'expression_statement', 'children': ['110']}; {'id': '110', 'type': 'assignment', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'cyclic'}; {'id': '112', 'type': 'list_comprehension', 'children': ['113', '114', '123']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '114', 'type': 'for_in_clause', 'children': ['115', '118']}; {'id': '115', 'type': 'pattern_list', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'heads'}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'num_heads'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '122', 'type': 'argument_list', 'children': []}; {'id': '123', 'type': 'if_clause', 'children': ['124']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'heads'}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'call', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'Results'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'cyclic'}
Sort values subject to dependency constraints
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'iteritems'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '28']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sorted_data'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '19', '22', '25']}; {'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': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '28', 'type': 'for_statement', 'children': ['29', '32', '33']}; {'id': '29', 'type': 'pattern_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sorted_data'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'yield', 'children': ['36']}; {'id': '36', 'type': 'expression_list', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'v'}
Sort and then iterate the dictionary
{'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', '15', '39']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '13']}; {'id': '8', 'type': 'attribute', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_log'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'Sorting responses by priority'"}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_responses'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '36']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '35']}; {'id': '30', 'type': 'attribute', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': '_responses'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '38', 'type': 'True', 'children': []}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '44', 'type': 'True', 'children': []}
Sort the response dictionaries priority levels for ordered iteration
{'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', '113', '119', '156']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '17']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'triggers'}; {'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': '_triggers'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'block', 'children': ['18', '34', '46', '59', '81', '103']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '25']}; {'id': '20', 'type': 'attribute', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_log'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'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': "'Sorting priority {priority} triggers'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'atomics'}; {'id': '37', 'type': 'list_comprehension', 'children': ['38', '39', '42']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '39', 'type': 'for_in_clause', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'triggers'}; {'id': '42', 'type': 'if_clause', 'children': ['43']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'pattern_is_atomic'}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'wildcards'}; {'id': '49', 'type': 'list_comprehension', 'children': ['50', '51', '54']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '51', 'type': 'for_in_clause', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'triggers'}; {'id': '54', 'type': 'if_clause', 'children': ['55']}; {'id': '55', 'type': 'not_operator', 'children': ['56']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'pattern_is_atomic'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'atomics'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66', '78']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'atomics'}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '68', 'type': 'lambda', 'children': ['69', '71']}; {'id': '69', 'type': 'lambda_parameters', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '71', 'type': 'tuple', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'pattern_words'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'pattern_len'}; {'id': '78', 'type': 'keyword_argument', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'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': 'wildcards'}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '88', '100']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'wildcards'}; {'id': '88', 'type': 'keyword_argument', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '90', 'type': 'lambda', 'children': ['91', '93']}; {'id': '91', 'type': 'lambda_parameters', 'children': ['92']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '93', 'type': 'tuple', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'pattern_words'}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'pattern_len'}; {'id': '100', 'type': 'keyword_argument', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '102', 'type': 'True', 'children': []}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'assignment', 'children': ['105', '110']}; {'id': '105', 'type': 'subscript', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': '_triggers'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '110', 'type': 'binary_operator', 'children': ['111', '112'], 'value': '+'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'atomics'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'wildcards'}; {'id': '113', 'type': 'expression_statement', 'children': ['114']}; {'id': '114', 'type': 'assignment', 'children': ['115', '118']}; {'id': '115', 'type': 'attribute', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': '_sorted_triggers'}; {'id': '118', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '119', 'type': 'for_statement', 'children': ['120', '121', '142']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'triggers'}; {'id': '121', 'type': 'list_comprehension', 'children': ['122', '127']}; {'id': '122', 'type': 'subscript', 'children': ['123', '126']}; {'id': '123', 'type': 'attribute', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': '_triggers'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '127', 'type': 'for_in_clause', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '129', 'type': 'call', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '131', 'type': 'argument_list', 'children': ['132', '139']}; {'id': '132', 'type': 'call', 'children': ['133', '138']}; {'id': '133', 'type': 'attribute', 'children': ['134', '137']}; {'id': '134', 'type': 'attribute', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': '_triggers'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '138', 'type': 'argument_list', 'children': []}; {'id': '139', 'type': 'keyword_argument', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '141', 'type': 'True', 'children': []}; {'id': '142', 'type': 'block', 'children': ['143']}; {'id': '143', 'type': 'for_statement', 'children': ['144', '145', '146']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'triggers'}; {'id': '146', 'type': 'block', 'children': ['147']}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'call', 'children': ['149', '154']}; {'id': '149', 'type': 'attribute', 'children': ['150', '153']}; {'id': '150', 'type': 'attribute', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': '_sorted_triggers'}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '154', 'type': 'argument_list', 'children': ['155']}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'trigger'}; {'id': '156', 'type': 'expression_statement', 'children': ['157']}; {'id': '157', 'type': 'assignment', 'children': ['158', '161']}; {'id': '158', 'type': 'attribute', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '161', 'type': 'True', 'children': []}
Sort triggers and their associated responses
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_key_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '41', '51']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11']}; {'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_baked'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_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': 'bake'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key_value_tuple'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '31']}; {'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': 'dct'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '30', 'type': 'argument_list', 'children': []}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '33', 'type': 'lambda', 'children': ['34', '36']}; {'id': '34', 'type': 'lambda_parameters', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '36', 'type': 'subscript', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'__abs_time__'"}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'skl'}; {'id': '44', 'type': 'list_comprehension', 'children': ['45', '48']}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'for_in_clause', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'key_value_tuple'}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'skl'}
Returns list of keys sorted according to their absolute time.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'flds_firstsort'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '29', '47']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Perform a lexsort and return the sort indices and shape as a tuple.\n '''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '11', 'type': 'list_comprehension', 'children': ['12', '23']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'unique'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'subscript', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '23', 'type': 'for_in_clause', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '25', 'type': 'list', 'children': ['26', '27', '28'], 'value': "['xs', 'ys', 'zs']"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'xs'"}; {'id': '27', 'type': 'string', 'children': [], 'value': "'ys'"}; {'id': '28', 'type': 'string', 'children': [], 'value': "'zs'"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'lexsort'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'tuple', 'children': ['38', '41', '44']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'z'"}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '43', 'type': 'string', 'children': [], 'value': "'y'"}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'x'"}; {'id': '47', 'type': 'return_statement', 'children': ['48']}; {'id': '48', 'type': 'expression_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'si'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'shape'}
Perform a lexsort and return the sort indices and shape as a tuple.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sanitize_config_loglevel'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '31', '35', '53', '64']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Kinda sorta backport of loglevel sanitization for Python 2.6.\n '''"}; {'id': '8', 'type': 'if_statement', 'children': ['9', '28']}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '21'], 'value': 'or'}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '18'], 'value': '!='}; {'id': '11', 'type': 'subscript', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sys'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'version_info'}; {'id': '15', 'type': 'slice', 'children': ['16', '17']}; {'id': '16', 'type': 'colon', 'children': []}; {'id': '17', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '18', 'type': 'tuple', 'children': ['19', '20']}; {'id': '19', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '6'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '25', 'type': 'tuple', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'long'}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'lvl'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'if_statement', 'children': ['36', '41']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'basestring'}; {'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': 'lvl'}; {'id': '45', 'type': 'call', 'children': ['46', '51']}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_levelNames'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '56']}; {'id': '54', 'type': 'not_operator', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'lvl'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'raise_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '63'], 'value': '%'}; {'id': '62', 'type': 'string', 'children': [], 'value': "'Invalid log level, %s'"}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'level'}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'lvl'}
Kinda sorta backport of loglevel sanitization for Python 2.6.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'all_selectors'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'Class'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '22', '31', '64', '77']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'selectors'}; {'id': '10', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'cssparser'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'cssutils'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'CSSParser'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'validate'}; {'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': 'css'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'cssparser'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'parseFile'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '31', 'type': 'for_statement', 'children': ['32', '33', '51']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '33', 'type': 'list_comprehension', 'children': ['34', '35', '40']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '35', 'type': 'for_in_clause', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'css'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'cssRules'}; {'id': '40', 'type': 'if_clause', 'children': ['41']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '46'], 'value': '=='}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'r'}; {'id': '46', 'type': 'attribute', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'cssutils'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'css'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'CSSStyleRule'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'augmented_assignment', 'children': ['54', '55'], 'value': '+='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'selectors'}; {'id': '55', 'type': 'list_comprehension', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sel'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'selectorText'}; {'id': '59', 'type': 'for_in_clause', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'sel'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'rule'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'selectorList'}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'selectors'}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'selectors'}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'selectors'}
return a sorted list of selectors that occur in the stylesheet
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pretty'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '14', '95']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"sort values and format output for viewing and comparing in test scenarios"'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'pretty_obj'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'for_statement', 'children': ['15', '18', '27']}; {'id': '15', 'type': 'pattern_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '__dict__'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'if_statement', 'children': ['29', '32', '39', '58', '71', '84']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': 'is'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'value'}; {'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': 'pretty_obj'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '38', 'type': 'None', 'children': []}; {'id': '39', 'type': 'elif_clause', 'children': ['40', '44']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'is_str_or_unicode'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'pretty_obj'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '50', 'type': 'call', 'children': ['51', '56']}; {'id': '51', 'type': 'attribute', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '__dict__'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '58', 'type': 'elif_clause', 'children': ['59', '64']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '64', 'type': 'block', 'children': ['65']}; {'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': 'pretty_obj'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '71', 'type': 'elif_clause', 'children': ['72', '77']}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '77', 'type': 'block', 'children': ['78']}; {'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': 'pretty_obj'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '83', 'type': 'dictionary', 'children': []}; {'id': '84', 'type': 'else_clause', 'children': ['85']}; {'id': '85', 'type': 'block', 'children': ['86']}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '91']}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'pretty_obj'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'unicode_value'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '95', 'type': 'return_statement', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'pretty_obj'}
sort values and format output for viewing and comparing in test scenarios
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'prettyprint'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '9', 'type': 'argument_list', 'children': ['10']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '16', '19', '22']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sort_keys'}; {'id': '18', 'type': 'True', 'children': []}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'separators'}; {'id': '24', 'type': 'tuple', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '","'}; {'id': '26', 'type': 'string', 'children': [], 'value': '": "'}
Print dicttree in Json-like format. keys are sorted
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_is_iterable'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'try_statement', 'children': ['7', '13', '20']}; {'id': '7', 'type': 'block', 'children': ['8']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'iter'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '13', 'type': 'except_clause', 'children': ['14', '17']}; {'id': '14', 'type': 'tuple', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'else_clause', 'children': ['21']}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'not_operator', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'basestring'}
Ensure that a value is iterable and not some sort of string
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortframe'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '14', '32', '38', '44']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n sorts particles for a frame\n '''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '11', 'type': 'subscript', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sortedargs'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'lexsort'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'list', 'children': ['23', '26', '29'], 'value': "[d['xi'],d['yi'],d['zi']]"}; {'id': '23', 'type': 'subscript', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '25', 'type': 'string', 'children': [], 'value': "'xi'"}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '28', 'type': 'string', 'children': [], 'value': "'yi'"}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '31', 'type': 'string', 'children': [], 'value': "'zi'"}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sortedargs'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '43']}; {'id': '40', 'type': 'subscript', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'data'"}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'frame'}
sorts particles for a frame
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorts_query'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'sortables'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '49']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'stmts'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '13']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sortables'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'if_statement', 'children': ['15', '18', '33']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'stmts'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'string', 'children': [], 'value': "'{} DESC'"}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '33', 'type': 'else_clause', 'children': ['34']}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'stmts'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'{} ASC'"}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'field'}; {'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': "' ORDER BY {}'"}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'stmts'}
Turn the Sortables into a SQL ORDER BY query
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'topological_sorting'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'relations'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '13', '25', '32', '39', '47', '110', '135']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'''An implementation of Kahn's algorithm.\n '''"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '12', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '16', 'type': 'binary_operator', 'children': ['17', '21'], 'value': '|'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_nodes'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'relations'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'inc'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_incoming'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'relations'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_outgoing'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'relations'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'free'}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_free_nodes'}; {'id': '44', 'type': 'argument_list', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'inc'}; {'id': '47', 'type': 'while_statement', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'free'}; {'id': '49', 'type': 'block', 'children': ['50', '58', '65', '74']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'free'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '57', 'type': 'argument_list', 'children': []}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'out_n'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '74', 'type': 'for_statement', 'children': ['75', '76', '77']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'out_n'}; {'id': '77', 'type': 'block', 'children': ['78', '87', '96']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '85']}; {'id': '80', 'type': 'attribute', 'children': ['81', '84']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '94']}; {'id': '89', 'type': 'attribute', 'children': ['90', '93']}; {'id': '90', 'type': 'subscript', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'inc'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '96', 'type': 'if_statement', 'children': ['97', '102']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': '_is_free'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'inc'}; {'id': '102', 'type': 'block', 'children': ['103']}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'call', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'free'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '110', 'type': 'if_statement', 'children': ['111', '129']}; {'id': '111', 'type': 'not_operator', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '114', 'type': 'generator_expression', 'children': ['115', '126']}; {'id': '115', 'type': 'boolean_operator', 'children': ['116', '121'], 'value': 'and'}; {'id': '116', 'type': 'call', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': '_is_free'}; {'id': '118', 'type': 'argument_list', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'inc'}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': '_is_free'}; {'id': '123', 'type': 'argument_list', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '126', 'type': 'for_in_clause', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '129', 'type': 'block', 'children': ['130']}; {'id': '130', 'type': 'raise_statement', 'children': ['131']}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'string', 'children': [], 'value': '"Cycle detected"'}; {'id': '135', 'type': 'return_statement', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'ret'}
An implementation of Kahn's algorithm.
{'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': 'line'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '18', '51', '60']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '13']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10', '11', '12']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'turn'}; {'id': '17', 'type': 'False', 'children': []}; {'id': '18', 'type': 'if_statement', 'children': ['19', '32', '42']}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '26'], 'value': '>'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '25'], 'value': '-'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '31'], 'value': '-'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'if_statement', 'children': ['34', '37']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '36'], 'value': '<'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'turn'}; {'id': '41', 'type': 'True', 'children': []}; {'id': '42', 'type': 'elif_clause', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': '<'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'turn'}; {'id': '50', 'type': 'True', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'turn'}; {'id': '53', 'type': 'block', 'children': ['54']}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'tuple', 'children': ['56', '57', '58', '59']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'x1'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'y1'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'x0'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'y0'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'line'}
change point position if x1,y0 < x0,y0
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_validate_field'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': 'not'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fields'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'raise_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'InvalidQueryParams'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'dictionary_splat', 'children': ['19']}; {'id': '19', 'type': 'dictionary', 'children': ['20', '30', '33']}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'detail'"}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '27'], 'value': '%'}; {'id': '23', 'type': 'concatenated_string', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'string', 'children': [], 'value': '\'The sort query param value of "%s" is \''}; {'id': '25', 'type': 'string', 'children': [], 'value': "'invalid. That field does not exist on the '"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'resource being requested.'"}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'raw_field'}; {'id': '30', 'type': 'pair', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'links'"}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'LINK'}; {'id': '33', 'type': 'pair', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'parameter'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'PARAM'}
Ensure the sortable field exists on the model
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_validate_no_rels'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'rels'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '13']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': 'in'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'rels'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'raise_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'InvalidQueryParams'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'dictionary_splat', 'children': ['19']}; {'id': '19', 'type': 'dictionary', 'children': ['20', '30', '33']}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': "'detail'"}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '27'], 'value': '%'}; {'id': '23', 'type': 'concatenated_string', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'string', 'children': [], 'value': '\'The sort query param value of "%s" is not \''}; {'id': '25', 'type': 'string', 'children': [], 'value': "'supported. Sorting on relationships is not '"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'currently supported'"}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'param'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'raw_field'}; {'id': '30', 'type': 'pair', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': "'links'"}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'LINK'}; {'id': '33', 'type': 'pair', 'children': ['34', '35']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'parameter'"}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'PARAM'}
Ensure the sortable field is not on a relationship
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_allposts'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '27', '48', '57', '61', '65', '225', '240']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "''' Return all posts in blog sorted by date\n\t\t'''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '11', 'type': 'call', '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': 'client'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'posts'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '21', '24']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'blog'}; {'id': '21', 'type': 'keyword_argument', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'try_statement', 'children': ['28', '35']}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'total_posts'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '34', 'type': 'string', 'children': [], 'value': "'total_posts'"}; {'id': '35', 'type': 'except_clause', 'children': ['36']}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'raise_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'phasetumblr_errors'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'TumblrBlogException'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'subscript', 'children': ['44', '47']}; {'id': '44', 'type': 'subscript', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '46', 'type': 'string', 'children': [], 'value': "'meta'"}; {'id': '47', 'type': 'string', 'children': [], 'value': "'msg'"}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'assignment', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '56'], 'value': '+'}; {'id': '52', 'type': '()', 'children': ['53']}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '/'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'total_posts'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'all_posts'}; {'id': '60', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'posts_ids'}; {'id': '64', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '65', 'type': 'for_statement', 'children': ['66', '67', '71']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '71', 'type': 'block', 'children': ['72', '78', '87', '108', '116']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '75', 'type': 'binary_operator', 'children': ['76', '77'], 'value': '*'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '81', 'type': 'binary_operator', 'children': ['82', '86'], 'value': '*'}; {'id': '82', 'type': '()', 'children': ['83']}; {'id': '83', 'type': 'binary_operator', 'children': ['84', '85'], 'value': '+'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '86', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'posts'}; {'id': '90', 'type': 'subscript', 'children': ['91', '107']}; {'id': '91', 'type': 'call', 'children': ['92', '97']}; {'id': '92', 'type': 'attribute', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'posts'}; {'id': '97', 'type': 'argument_list', 'children': ['98', '101', '104']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'blog'}; {'id': '101', 'type': 'keyword_argument', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '104', 'type': 'keyword_argument', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '107', 'type': 'string', 'children': [], 'value': "'posts'"}; {'id': '108', 'type': 'if_statement', 'children': ['109', '114']}; {'id': '109', 'type': 'not_operator', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '112', 'type': 'argument_list', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'posts'}; {'id': '114', 'type': 'block', 'children': ['115']}; {'id': '115', 'type': 'break_statement', 'children': []}; {'id': '116', 'type': 'for_statement', 'children': ['117', '118', '119']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'posts'}; {'id': '119', 'type': 'block', 'children': ['120', '128', '137', '147', '151', '159', '167', '181', '189', '197', '203', '209', '216']}; {'id': '120', 'type': 'if_statement', 'children': ['121', '126']}; {'id': '121', 'type': 'comparison_operator', 'children': ['122', '125'], 'value': 'in'}; {'id': '122', 'type': 'subscript', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '124', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'posts_ids'}; {'id': '126', 'type': 'block', 'children': ['127']}; {'id': '127', 'type': 'continue_statement', 'children': []}; {'id': '128', 'type': 'expression_statement', 'children': ['129']}; {'id': '129', 'type': 'assignment', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '131', 'type': 'call', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'split_body'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'subscript', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '136', 'type': 'string', 'children': [], 'value': "'body'"}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'assignment', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '140', 'type': 'call', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'split_body'}; {'id': '142', 'type': 'argument_list', 'children': ['143', '146']}; {'id': '143', 'type': 'subscript', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '145', 'type': 'string', 'children': [], 'value': "'body'"}; {'id': '146', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'assignment', 'children': ['149', '150']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '150', 'type': 'dictionary', 'children': []}; {'id': '151', 'type': 'expression_statement', 'children': ['152']}; {'id': '152', 'type': 'assignment', 'children': ['153', '156']}; {'id': '153', 'type': 'subscript', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '155', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '156', 'type': 'subscript', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '158', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'assignment', 'children': ['161', '164']}; {'id': '161', 'type': 'subscript', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '163', 'type': 'string', 'children': [], 'value': "'link'"}; {'id': '164', 'type': 'subscript', 'children': ['165', '166']}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '166', 'type': 'string', 'children': [], 'value': "'post_url'"}; {'id': '167', 'type': 'expression_statement', 'children': ['168']}; {'id': '168', 'type': 'assignment', 'children': ['169', '172']}; {'id': '169', 'type': 'subscript', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '171', 'type': 'string', 'children': [], 'value': "'date'"}; {'id': '172', 'type': 'call', 'children': ['173', '176']}; {'id': '173', 'type': 'attribute', 'children': ['174', '175']}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'strptime'}; {'id': '176', 'type': 'argument_list', 'children': ['177', '180']}; {'id': '177', 'type': 'subscript', 'children': ['178', '179']}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '179', 'type': 'string', 'children': [], 'value': "'date'"}; {'id': '180', 'type': 'string', 'children': [], 'value': "'%Y-%m-%d %H:%M:%S %Z'"}; {'id': '181', 'type': 'expression_statement', 'children': ['182']}; {'id': '182', 'type': 'assignment', 'children': ['183', '186']}; {'id': '183', 'type': 'subscript', 'children': ['184', '185']}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '185', 'type': 'string', 'children': [], 'value': "'tags'"}; {'id': '186', 'type': 'subscript', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '188', 'type': 'string', 'children': [], 'value': "'tags'"}; {'id': '189', 'type': 'expression_statement', 'children': ['190']}; {'id': '190', 'type': 'assignment', 'children': ['191', '194']}; {'id': '191', 'type': 'subscript', 'children': ['192', '193']}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '193', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '194', 'type': 'subscript', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '196', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '197', 'type': 'expression_statement', 'children': ['198']}; {'id': '198', 'type': 'assignment', 'children': ['199', '202']}; {'id': '199', 'type': 'subscript', 'children': ['200', '201']}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '201', 'type': 'string', 'children': [], 'value': "'body'"}; {'id': '202', 'type': 'identifier', 'children': [], 'value': 'body'}; {'id': '203', 'type': 'expression_statement', 'children': ['204']}; {'id': '204', 'type': 'assignment', 'children': ['205', '208']}; {'id': '205', 'type': 'subscript', 'children': ['206', '207']}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'post'}; {'id': '207', 'type': 'string', 'children': [], 'value': "'description'"}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'description'}; {'id': '209', 'type': 'expression_statement', 'children': ['210']}; {'id': '210', 'type': 'call', 'children': ['211', '214']}; {'id': '211', 'type': 'attribute', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'all_posts'}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '214', 'type': 'argument_list', 'children': ['215']}; {'id': '215', 'type': 'identifier', 'children': [], 'value': 'post'}; {'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': 'posts_ids'}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '221', 'type': 'argument_list', 'children': ['222']}; {'id': '222', 'type': 'subscript', 'children': ['223', '224']}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '224', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '225', 'type': 'expression_statement', 'children': ['226']}; {'id': '226', 'type': 'assignment', 'children': ['227', '228']}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'newlist'}; {'id': '228', 'type': 'call', 'children': ['229', '230']}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '230', 'type': 'argument_list', 'children': ['231', '232']}; {'id': '231', 'type': 'identifier', 'children': [], 'value': 'all_posts'}; {'id': '232', 'type': 'keyword_argument', 'children': ['233', '234']}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '234', 'type': 'lambda', 'children': ['235', '237']}; {'id': '235', 'type': 'lambda_parameters', 'children': ['236']}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '237', 'type': 'subscript', 'children': ['238', '239']}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '239', 'type': 'string', 'children': [], 'value': "'date'"}; {'id': '240', 'type': 'return_statement', 'children': ['241']}; {'id': '241', 'type': 'identifier', 'children': [], 'value': 'newlist'}
Return all posts in blog sorted by date
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'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': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '7', 'type': 'block', 'children': ['8', '10', '16', '45']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'string', 'children': [], 'value': "'''sort results by given criteria'''"}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'criteria'}; {'id': '13', 'type': 'list', 'children': ['14', '15'], 'value': "['seeds', 'size']"}; {'id': '14', 'type': 'string', 'children': [], 'value': "'seeds'"}; {'id': '15', 'type': 'string', 'children': [], 'value': "'size'"}; {'id': '16', 'type': 'for_statement', 'children': ['17', '18', '19']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '23'], 'value': 'in'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'criteria'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '32', 'type': 'argument_list', 'children': ['33', '36', '42']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '44', 'type': 'True', 'children': []}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'self'}
sort results by given criteria
{'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', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'versions'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '24']}; {'id': '17', 'type': 'call', 'children': ['18', '23']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'versions'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'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': 'v'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0'}
Sort versions by their version number
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '6', 'type': 'block', 'children': ['7', '38']}; {'id': '7', 'type': 'function_definition', 'children': ['8', '9', '11']}; {'id': '8', 'type': 'function_name', 'children': [], 'value': 'key_func'}; {'id': '9', 'type': 'parameters', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'try_statement', 'children': ['13', '20']}; {'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': 'getattr'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '20', 'type': 'except_clause', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'try_statement', 'children': ['24', '29']}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '29', 'type': 'except_clause', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'key_func'}
General sort filter - sorts by either attribute or key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_migrations'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '35']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '11']}; {'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': '_sorted_migrations'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_sorted_migrations'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '27']}; {'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': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'migration_registry'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '26', 'type': 'argument_list', 'children': []}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'lambda', 'children': ['30', '32']}; {'id': '30', 'type': 'lambda_parameters', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'migration_tuple'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'migration_tuple'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': '_sorted_migrations'}
Sort migrations if necessary and store in self._sorted_migrations
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sorter'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'generated'}; {'id': '5', 'type': 'block', 'children': ['6', '36', '42']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'pairs'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '27']}; {'id': '10', 'type': 'tuple', 'children': ['11', '19']}; {'id': '11', 'type': 'call', 'children': ['12', '17']}; {'id': '12', 'type': 'attribute', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '19', 'type': 'call', 'children': ['20', '25']}; {'id': '20', 'type': 'attribute', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '27', 'type': 'for_in_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'generated'}; {'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': 'pairs'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'list_comprehension', 'children': ['44', '57']}; {'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': 'os'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '54']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '53', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '57', 'type': 'for_in_clause', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'pair'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'pairs'}
Return a list of paths sorted by dirname & basename.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_ordered'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '5', 'type': 'list_splat_pattern', 'children': ['6']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '7', 'type': 'dictionary_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '9', 'type': 'block', 'children': ['10', '28', '45', '51', '63']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'unordered_dict'}; {'id': '13', 'type': 'dictionary_comprehension', 'children': ['14', '17']}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '21']}; {'id': '18', 'type': 'pattern_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'generator'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '26']}; {'id': '24', 'type': 'list_splat', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '26', 'type': 'dictionary_splat', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '44']}; {'id': '38', 'type': 'attribute', 'children': ['39', '43']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'unordered_dict'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'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': 'result'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'for_statement', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '60']}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'unordered_dict'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'result'}
Sort keys of unordered_dict and store in OrderedDict.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_name'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '5', 'type': 'block', 'children': ['6', '61']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '10']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'last_name_key'}; {'id': '8', 'type': 'parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'full_name'}; {'id': '10', 'type': 'block', 'children': ['11', '20', '34', '55']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'full_name'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '20', 'type': 'if_statement', 'children': ['21', '27']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '26'], 'value': '=='}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'full_name'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'last_first'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '44'], 'value': '+'}; {'id': '38', 'type': 'binary_operator', 'children': ['39', '43'], 'value': '+'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '41', 'type': 'unary_operator', 'children': ['42'], 'value': '-'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '43', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '51', 'type': 'slice', 'children': ['52', '53']}; {'id': '52', 'type': 'colon', 'children': []}; {'id': '53', 'type': 'unary_operator', 'children': ['54'], 'value': '-'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'last_first'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '60', 'type': 'argument_list', 'children': []}; {'id': '61', 'type': 'return_statement', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '69']}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '69', 'type': 'keyword_argument', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'last_name_key'}
Sort by last name, uniquely.
{'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', '10', '47', '67']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'users'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '14', '31']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'itertools'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'groupby'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '25']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'commits'}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'string', 'children': [], 'value': "'author_mail'"}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'users'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'merge_user_commits'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'group'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted_commits'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56', '64']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'users'}; {'id': '56', 'type': 'keyword_argument', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'string', 'children': [], 'value': "'line_count'"}; {'id': '64', 'type': 'keyword_argument', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '66', 'type': 'True', 'children': []}; {'id': '67', 'type': 'return_statement', 'children': ['68']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'sorted_commits'}
Sort by commit size, per author.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rankingEval'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '19', '30', '61', '69', '91', '99', '110', '114', '161', '167', '173']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n\t\tSorting the pop. base on the fitnessEval result\n\t\t'''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'fitnessNorm'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '30', 'type': 'for_statement', 'children': ['31', '32', '38']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '38', 'type': 'block', 'children': ['39', '49']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '48']}; {'id': '41', 'type': 'attribute', 'children': ['42', '47']}; {'id': '42', 'type': 'subscript', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'Ind'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'fitnessEval'}; {'id': '48', 'type': 'argument_list', 'children': []}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '54']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '54', 'type': 'attribute', 'children': ['55', '60']}; {'id': '55', 'type': 'subscript', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'Ind'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'fitness'}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'assignment', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'maxFitness'}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '68', 'type': 'argument_list', 'children': []}; {'id': '69', 'type': 'for_statement', 'children': ['70', '71', '77']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '77', 'type': 'block', 'children': ['78']}; {'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': 'fitnessNorm'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '83', 'type': 'binary_operator', 'children': ['84', '90'], 'value': '/'}; {'id': '84', 'type': '()', 'children': ['85']}; {'id': '85', 'type': 'binary_operator', 'children': ['86', '87'], 'value': '-'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'maxFitness'}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'maxFitness'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'fitnessSorted'}; {'id': '94', 'type': 'call', 'children': ['95', '98']}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'fitnessNorm'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '98', 'type': 'argument_list', 'children': []}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'probability'}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'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': 'length'}; {'id': '110', 'type': 'expression_statement', 'children': ['111']}; {'id': '111', 'type': 'assignment', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '113', 'type': 'float', 'children': [], 'value': '2.0'}; {'id': '114', 'type': 'for_statement', 'children': ['115', '116', '122']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '116', 'type': 'call', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '122', 'type': 'block', 'children': ['123']}; {'id': '123', 'type': 'expression_statement', 'children': ['124']}; {'id': '124', 'type': 'assignment', 'children': ['125', '130']}; {'id': '125', 'type': 'subscript', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'probability'}; {'id': '127', 'type': 'subscript', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'fitnessSorted'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '130', 'type': 'binary_operator', 'children': ['131', '140'], 'value': '+'}; {'id': '131', 'type': '()', 'children': ['132']}; {'id': '132', 'type': 'binary_operator', 'children': ['133', '137'], 'value': '/'}; {'id': '133', 'type': '()', 'children': ['134']}; {'id': '134', 'type': 'binary_operator', 'children': ['135', '136'], 'value': '-'}; {'id': '135', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '137', 'type': 'attribute', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '140', 'type': 'binary_operator', 'children': ['141', '150'], 'value': '/'}; {'id': '141', 'type': '()', 'children': ['142']}; {'id': '142', 'type': 'binary_operator', 'children': ['143', '146'], 'value': '*'}; {'id': '143', 'type': 'binary_operator', 'children': ['144', '145'], 'value': '*'}; {'id': '144', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '146', 'type': '()', 'children': ['147']}; {'id': '147', 'type': 'binary_operator', 'children': ['148', '149'], 'value': '-'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'S'}; {'id': '149', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '150', 'type': '()', 'children': ['151']}; {'id': '151', 'type': 'binary_operator', 'children': ['152', '155'], 'value': '*'}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '155', 'type': '()', 'children': ['156']}; {'id': '156', 'type': 'binary_operator', 'children': ['157', '160'], 'value': '-'}; {'id': '157', 'type': 'attribute', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '160', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '161', 'type': 'expression_statement', 'children': ['162']}; {'id': '162', 'type': 'assignment', 'children': ['163', '166']}; {'id': '163', 'type': 'attribute', 'children': ['164', '165']}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '165', 'type': 'identifier', 'children': [], 'value': 'rankingComputed'}; {'id': '166', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '167', 'type': 'expression_statement', 'children': ['168']}; {'id': '168', 'type': 'assignment', 'children': ['169', '172']}; {'id': '169', 'type': 'attribute', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'fitness'}; {'id': '172', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '173', 'type': 'return_statement', 'children': ['174']}; {'id': '174', 'type': 'list', 'children': ['175', '176', '183'], 'value': '[fitnessAll, fitnessSorted[::-1], probability]'}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'fitnessAll'}; {'id': '176', 'type': 'subscript', 'children': ['177', '178']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'fitnessSorted'}; {'id': '178', 'type': 'slice', 'children': ['179', '180', '181']}; {'id': '179', 'type': 'colon', 'children': []}; {'id': '180', 'type': 'colon', 'children': []}; {'id': '181', 'type': 'unary_operator', 'children': ['182'], 'value': '-'}; {'id': '182', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'probability'}
Sorting the pop. base on the fitnessEval result
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortedbyAge'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '19', '40', '48']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n\t\tSorting the pop. base of the age\n\t\t'''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'ageAll'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '21', '27']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ageAll'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '33', 'type': 'attribute', 'children': ['34', '39']}; {'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': 'Ind'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'age'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'ageSorted'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ageAll'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'ageSorted'}; {'id': '51', 'type': 'slice', 'children': ['52', '53', '54']}; {'id': '52', 'type': 'colon', 'children': []}; {'id': '53', 'type': 'colon', 'children': []}; {'id': '54', 'type': 'unary_operator', 'children': ['55'], 'value': '-'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '1'}
Sorting the pop. base of the age
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'es_field_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'fld_name'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '35']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'fld_name'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"."'}; {'id': '15', 'type': 'if_statement', 'children': ['16', '22']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': 'not'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"_"'}; {'id': '18', 'type': 'subscript', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '20', 'type': 'unary_operator', 'children': ['21'], 'value': '-'}; {'id': '21', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '29']}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '27', 'type': 'unary_operator', 'children': ['28'], 'value': '-'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '29', 'type': 'binary_operator', 'children': ['30', '31'], 'value': '+'}; {'id': '30', 'type': 'string', 'children': [], 'value': '"_"'}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'parts'}; {'id': '33', 'type': 'unary_operator', 'children': ['34'], 'value': '-'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': '"."'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'parts'}
Used with lambda to sort fields
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '26', '62', '66', '102']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'function_definition', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'function_name', 'children': [], 'value': 'by_length'}; {'id': '12', 'type': 'parameters', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'word1'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'word2'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'binary_operator', 'children': ['18', '22'], 'value': '-'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'word2'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'word1'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '29', 'type': 'block', 'children': ['30', '42', '53']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'cword'}; {'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': 'word_count'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '41', 'type': 'True', 'children': []}; {'id': '42', 'type': 'if_statement', 'children': ['43', '46']}; {'id': '43', 'type': 'comparison_operator', 'children': ['44', '45'], 'value': 'not'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'cword'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '52']}; {'id': '49', 'type': 'subscript', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'cword'}; {'id': '52', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'cword'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '65', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '66', 'type': 'for_statement', 'children': ['67', '68', '79']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '76']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '75', 'type': 'argument_list', 'children': []}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '78', 'type': 'True', 'children': []}; {'id': '79', 'type': 'block', 'children': ['80', '95']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '85', 'type': 'argument_list', 'children': ['86', '89', '92']}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'track'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '89', 'type': 'keyword_argument', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '92', 'type': 'keyword_argument', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '94', 'type': 'True', 'children': []}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '100']}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'output'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '100', 'type': 'argument_list', 'children': ['101']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '102', 'type': 'return_statement', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'output'}
Sort a simple list by number of words and length.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'callable'}; {'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': 'nans'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '23', '123']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'jitfunc'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'nb'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'njit'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'func'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'nogil'}; {'id': '22', 'type': 'True', 'children': []}; {'id': '23', 'type': 'function_definition', 'children': ['24', '25', '30']}; {'id': '24', 'type': 'function_name', 'children': [], 'value': '_loop'}; {'id': '25', 'type': 'parameters', 'children': ['26', '27', '28', '29']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sortidx'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'group_idx'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '30', 'type': 'block', 'children': ['31', '38', '44', '50', '57']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'group_idx_srt'}; {'id': '41', 'type': 'subscript', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'group_idx'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sortidx'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'a_srt'}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sortidx'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'step_indices'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'group_idx_srt'}; {'id': '57', 'type': 'for_statement', 'children': ['58', '59', '68']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'binary_operator', 'children': ['63', '67'], 'value': '-'}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '68', 'type': 'block', 'children': ['69', '83', '89', '99', '109']}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '74']}; {'id': '71', 'type': 'pattern_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'start_idx'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'stop_idx'}; {'id': '74', 'type': 'expression_list', 'children': ['75', '78']}; {'id': '75', 'type': 'subscript', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '78', 'type': 'subscript', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '80', 'type': 'binary_operator', 'children': ['81', '82'], 'value': '+'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '82', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'ri'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'group_idx_srt'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'start_idx'}; {'id': '89', 'type': 'if_statement', 'children': ['90', '93']}; {'id': '90', 'type': 'comparison_operator', 'children': ['91', '92'], 'value': '<'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'ri'}; {'id': '92', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '93', 'type': 'block', 'children': ['94']}; {'id': '94', 'type': 'raise_statement', 'children': ['95']}; {'id': '95', 'type': 'call', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'string', 'children': [], 'value': '"negative indices not supported"'}; {'id': '99', 'type': 'if_statement', 'children': ['100', '103']}; {'id': '100', 'type': 'comparison_operator', 'children': ['101', '102'], 'value': '>='}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'ri'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'size'}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'raise_statement', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'string', 'children': [], 'value': '"one or more indices in group_idx are too large"'}; {'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': 'ret'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'ri'}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'jitfunc'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'subscript', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'a_srt'}; {'id': '119', 'type': 'slice', 'children': ['120', '121', '122']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'start_idx'}; {'id': '121', 'type': 'colon', 'children': []}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'stop_idx'}; {'id': '123', 'type': 'return_statement', 'children': ['124']}; {'id': '124', 'type': 'call', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'nb'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'njit'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': '_loop'}; {'id': '130', 'type': 'keyword_argument', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'nogil'}; {'id': '132', 'type': 'True', 'children': []}
Compile a jitted function and loop it over the sorted data.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'preProcessForComparison'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'size_tolerance_prct'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '53', '71', '75', '136', '148', '172', '377']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '15']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '24']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '21'], 'value': 'is'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'source_quality'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'CoverSourceQuality'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'REFERENCE'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'if_statement', 'children': ['26', '48']}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '32'], 'value': 'or'}; {'id': '28', 'type': '()', 'children': ['29']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': 'is'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': '()', 'children': ['33']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '47'], 'value': '>'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'CoverSourceResult'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'compare'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40', '41', '44']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'size_tolerance_prct'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'size_tolerance_prct'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'list'}; {'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': 'itertools'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'filterfalse'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '70']}; {'id': '64', 'type': 'call', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'string', 'children': [], 'value': '"is_only_reference"'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'no_dup_results'}; {'id': '74', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '75', 'type': 'for_statement', 'children': ['76', '77', '78']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '78', 'type': 'block', 'children': ['79', '83', '125']}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'is_dup'}; {'id': '82', 'type': 'False', 'children': []}; {'id': '83', 'type': 'for_statement', 'children': ['84', '85', '86']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'result_comp'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '86', 'type': 'block', 'children': ['87']}; {'id': '87', 'type': 'if_statement', 'children': ['88', '119']}; {'id': '88', 'type': '()', 'children': ['89']}; {'id': '89', 'type': 'boolean_operator', 'children': ['90', '103'], 'value': 'and'}; {'id': '90', 'type': 'boolean_operator', 'children': ['91', '95'], 'value': 'and'}; {'id': '91', 'type': '()', 'children': ['92']}; {'id': '92', 'type': 'comparison_operator', 'children': ['93', '94'], 'value': 'is'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'result_comp'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '95', 'type': '()', 'children': ['96']}; {'id': '96', 'type': 'comparison_operator', 'children': ['97', '100'], 'value': '=='}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'result_comp'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '103', 'type': '()', 'children': ['104']}; {'id': '104', 'type': 'comparison_operator', 'children': ['105', '118'], 'value': '<'}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'compare'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '111', '112', '115']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'result_comp'}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'target_size'}; {'id': '115', 'type': 'keyword_argument', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'size_tolerance_prct'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'size_tolerance_prct'}; {'id': '118', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '119', 'type': 'block', 'children': ['120', '124']}; {'id': '120', 'type': 'expression_statement', 'children': ['121']}; {'id': '121', 'type': 'assignment', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'is_dup'}; {'id': '123', 'type': 'True', 'children': []}; {'id': '124', 'type': 'break_statement', 'children': []}; {'id': '125', 'type': 'if_statement', 'children': ['126', '128']}; {'id': '126', 'type': 'not_operator', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'is_dup'}; {'id': '128', 'type': 'block', 'children': ['129']}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'call', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'no_dup_results'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '134', 'type': 'argument_list', 'children': ['135']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '136', 'type': 'expression_statement', 'children': ['137']}; {'id': '137', 'type': 'assignment', 'children': ['138', '139']}; {'id': '138', 'type': 'identifier', 'children': [], 'value': 'dup_count'}; {'id': '139', 'type': 'binary_operator', 'children': ['140', '144'], 'value': '-'}; {'id': '140', 'type': 'call', 'children': ['141', '142']}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '144', 'type': 'call', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '146', 'type': 'argument_list', 'children': ['147']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'no_dup_results'}; {'id': '148', 'type': 'if_statement', 'children': ['149', '152']}; {'id': '149', 'type': 'comparison_operator', 'children': ['150', '151'], 'value': '>'}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'dup_count'}; {'id': '151', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '152', 'type': 'block', 'children': ['153', '168']}; {'id': '153', 'type': 'expression_statement', 'children': ['154']}; {'id': '154', 'type': 'call', 'children': ['155', '163']}; {'id': '155', 'type': 'attribute', 'children': ['156', '162']}; {'id': '156', 'type': 'call', 'children': ['157', '160']}; {'id': '157', 'type': 'attribute', 'children': ['158', '159']}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'string', 'children': [], 'value': '"Cover"'}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '163', 'type': 'argument_list', 'children': ['164']}; {'id': '164', 'type': 'binary_operator', 'children': ['165', '166'], 'value': '%'}; {'id': '165', 'type': 'string', 'children': [], 'value': '"Removed %u duplicate results"'}; {'id': '166', 'type': '()', 'children': ['167']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'dup_count'}; {'id': '168', 'type': 'expression_statement', 'children': ['169']}; {'id': '169', 'type': 'assignment', 'children': ['170', '171']}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'no_dup_results'}; {'id': '172', 'type': 'if_statement', 'children': ['173', '176', '363']}; {'id': '173', 'type': 'comparison_operator', 'children': ['174', '175'], 'value': 'is'}; {'id': '174', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '175', 'type': 'None', 'children': []}; {'id': '176', 'type': 'block', 'children': ['177', '192', '198', '202', '230', '264', '275', '285']}; {'id': '177', 'type': 'expression_statement', 'children': ['178']}; {'id': '178', 'type': 'call', 'children': ['179', '187']}; {'id': '179', 'type': 'attribute', 'children': ['180', '186']}; {'id': '180', 'type': 'call', 'children': ['181', '184']}; {'id': '181', 'type': 'attribute', 'children': ['182', '183']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '184', 'type': 'argument_list', 'children': ['185']}; {'id': '185', 'type': 'string', 'children': [], 'value': '"Cover"'}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '187', 'type': 'argument_list', 'children': ['188']}; {'id': '188', 'type': 'binary_operator', 'children': ['189', '190'], 'value': '%'}; {'id': '189', 'type': 'string', 'children': [], 'value': '"Reference is: %s"'}; {'id': '190', 'type': '()', 'children': ['191']}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '192', 'type': 'expression_statement', 'children': ['193']}; {'id': '193', 'type': 'assignment', 'children': ['194', '197']}; {'id': '194', 'type': 'attribute', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'is_similar_to_reference'}; {'id': '197', 'type': 'True', 'children': []}; {'id': '198', 'type': 'expression_statement', 'children': ['199']}; {'id': '199', 'type': 'assignment', 'children': ['200', '201']}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '201', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '202', 'type': 'for_statement', 'children': ['203', '204', '205']}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '205', 'type': 'block', 'children': ['206', '214', '223']}; {'id': '206', 'type': 'expression_statement', 'children': ['207']}; {'id': '207', 'type': 'assignment', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'coroutine'}; {'id': '209', 'type': 'call', 'children': ['210', '213']}; {'id': '210', 'type': 'attribute', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'updateSignature'}; {'id': '213', 'type': 'argument_list', 'children': []}; {'id': '214', 'type': 'expression_statement', 'children': ['215']}; {'id': '215', 'type': 'assignment', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '217', 'type': 'call', 'children': ['218', '221']}; {'id': '218', 'type': 'attribute', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '220', 'type': 'identifier', 'children': [], 'value': 'ensure_future'}; {'id': '221', 'type': 'argument_list', 'children': ['222']}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'coroutine'}; {'id': '223', 'type': 'expression_statement', 'children': ['224']}; {'id': '224', 'type': 'call', 'children': ['225', '228']}; {'id': '225', 'type': 'attribute', 'children': ['226', '227']}; {'id': '226', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '228', 'type': 'argument_list', 'children': ['229']}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '230', 'type': 'if_statement', 'children': ['231', '234']}; {'id': '231', 'type': 'attribute', 'children': ['232', '233']}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'is_only_reference'}; {'id': '234', 'type': 'block', 'children': ['235', '240', '248', '257']}; {'id': '235', 'type': 'assert_statement', 'children': ['236']}; {'id': '236', 'type': '()', 'children': ['237']}; {'id': '237', 'type': 'comparison_operator', 'children': ['238', '239'], 'value': 'not'}; {'id': '238', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '240', 'type': 'expression_statement', 'children': ['241']}; {'id': '241', 'type': 'assignment', 'children': ['242', '243']}; {'id': '242', 'type': 'identifier', 'children': [], 'value': 'coroutine'}; {'id': '243', 'type': 'call', 'children': ['244', '247']}; {'id': '244', 'type': 'attribute', 'children': ['245', '246']}; {'id': '245', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '246', 'type': 'identifier', 'children': [], 'value': 'updateSignature'}; {'id': '247', 'type': 'argument_list', 'children': []}; {'id': '248', 'type': 'expression_statement', 'children': ['249']}; {'id': '249', 'type': 'assignment', 'children': ['250', '251']}; {'id': '250', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '251', 'type': 'call', 'children': ['252', '255']}; {'id': '252', 'type': 'attribute', 'children': ['253', '254']}; {'id': '253', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '254', 'type': 'identifier', 'children': [], 'value': 'ensure_future'}; {'id': '255', 'type': 'argument_list', 'children': ['256']}; {'id': '256', 'type': 'identifier', 'children': [], 'value': 'coroutine'}; {'id': '257', 'type': 'expression_statement', 'children': ['258']}; {'id': '258', 'type': 'call', 'children': ['259', '262']}; {'id': '259', 'type': 'attribute', 'children': ['260', '261']}; {'id': '260', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '261', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '262', 'type': 'argument_list', 'children': ['263']}; {'id': '263', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '264', 'type': 'if_statement', 'children': ['265', '266']}; {'id': '265', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '266', 'type': 'block', 'children': ['267']}; {'id': '267', 'type': 'expression_statement', 'children': ['268']}; {'id': '268', 'type': 'await', 'children': ['269']}; {'id': '269', 'type': 'call', 'children': ['270', '273']}; {'id': '270', 'type': 'attribute', 'children': ['271', '272']}; {'id': '271', 'type': 'identifier', 'children': [], 'value': 'asyncio'}; {'id': '272', 'type': 'identifier', 'children': [], 'value': 'wait'}; {'id': '273', 'type': 'argument_list', 'children': ['274']}; {'id': '274', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '275', 'type': 'for_statement', 'children': ['276', '277', '278']}; {'id': '276', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '277', 'type': 'identifier', 'children': [], 'value': 'futures'}; {'id': '278', 'type': 'block', 'children': ['279']}; {'id': '279', 'type': 'expression_statement', 'children': ['280']}; {'id': '280', 'type': 'call', 'children': ['281', '284']}; {'id': '281', 'type': 'attribute', 'children': ['282', '283']}; {'id': '282', 'type': 'identifier', 'children': [], 'value': 'future'}; {'id': '283', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '284', 'type': 'argument_list', 'children': []}; {'id': '285', 'type': 'for_statement', 'children': ['286', '287', '288']}; {'id': '286', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '287', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '288', 'type': 'block', 'children': ['289']}; {'id': '289', 'type': 'if_statement', 'children': ['290', '309']}; {'id': '290', 'type': '()', 'children': ['291']}; {'id': '291', 'type': 'boolean_operator', 'children': ['292', '303'], 'value': 'and'}; {'id': '292', 'type': 'boolean_operator', 'children': ['293', '297'], 'value': 'and'}; {'id': '293', 'type': '()', 'children': ['294']}; {'id': '294', 'type': 'comparison_operator', 'children': ['295', '296'], 'value': 'is'}; {'id': '295', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '296', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '297', 'type': '()', 'children': ['298']}; {'id': '298', 'type': 'comparison_operator', 'children': ['299', '302'], 'value': 'is'}; {'id': '299', 'type': 'attribute', 'children': ['300', '301']}; {'id': '300', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '301', 'type': 'identifier', 'children': [], 'value': 'thumbnail_sig'}; {'id': '302', 'type': 'None', 'children': []}; {'id': '303', 'type': '()', 'children': ['304']}; {'id': '304', 'type': 'comparison_operator', 'children': ['305', '308'], 'value': 'is'}; {'id': '305', 'type': 'attribute', 'children': ['306', '307']}; {'id': '306', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '307', 'type': 'identifier', 'children': [], 'value': 'thumbnail_sig'}; {'id': '308', 'type': 'None', 'children': []}; {'id': '309', 'type': 'block', 'children': ['310', '326']}; {'id': '310', 'type': 'expression_statement', 'children': ['311']}; {'id': '311', 'type': 'assignment', 'children': ['312', '315']}; {'id': '312', 'type': 'attribute', 'children': ['313', '314']}; {'id': '313', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '314', 'type': 'identifier', 'children': [], 'value': 'is_similar_to_reference'}; {'id': '315', 'type': 'call', 'children': ['316', '319']}; {'id': '316', 'type': 'attribute', 'children': ['317', '318']}; {'id': '317', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '318', 'type': 'identifier', 'children': [], 'value': 'areImageSigsSimilar'}; {'id': '319', 'type': 'argument_list', 'children': ['320', '323']}; {'id': '320', 'type': 'attribute', 'children': ['321', '322']}; {'id': '321', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '322', 'type': 'identifier', 'children': [], 'value': 'thumbnail_sig'}; {'id': '323', 'type': 'attribute', 'children': ['324', '325']}; {'id': '324', 'type': 'identifier', 'children': [], 'value': 'reference'}; {'id': '325', 'type': 'identifier', 'children': [], 'value': 'thumbnail_sig'}; {'id': '326', 'type': 'if_statement', 'children': ['327', '330', '346']}; {'id': '327', 'type': 'attribute', 'children': ['328', '329']}; {'id': '328', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '329', 'type': 'identifier', 'children': [], 'value': 'is_similar_to_reference'}; {'id': '330', 'type': 'block', 'children': ['331']}; {'id': '331', 'type': 'expression_statement', 'children': ['332']}; {'id': '332', 'type': 'call', 'children': ['333', '341']}; {'id': '333', 'type': 'attribute', 'children': ['334', '340']}; {'id': '334', 'type': 'call', 'children': ['335', '338']}; {'id': '335', 'type': 'attribute', 'children': ['336', '337']}; {'id': '336', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '337', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '338', 'type': 'argument_list', 'children': ['339']}; {'id': '339', 'type': 'string', 'children': [], 'value': '"Cover"'}; {'id': '340', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '341', 'type': 'argument_list', 'children': ['342']}; {'id': '342', 'type': 'binary_operator', 'children': ['343', '344'], 'value': '%'}; {'id': '343', 'type': 'string', 'children': [], 'value': '"%s is similar to reference"'}; {'id': '344', 'type': '()', 'children': ['345']}; {'id': '345', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '346', 'type': 'else_clause', 'children': ['347']}; {'id': '347', 'type': 'block', 'children': ['348']}; {'id': '348', 'type': 'expression_statement', 'children': ['349']}; {'id': '349', 'type': 'call', 'children': ['350', '358']}; {'id': '350', 'type': 'attribute', 'children': ['351', '357']}; {'id': '351', 'type': 'call', 'children': ['352', '355']}; {'id': '352', 'type': 'attribute', 'children': ['353', '354']}; {'id': '353', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '354', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '355', 'type': 'argument_list', 'children': ['356']}; {'id': '356', 'type': 'string', 'children': [], 'value': '"Cover"'}; {'id': '357', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '358', 'type': 'argument_list', 'children': ['359']}; {'id': '359', 'type': 'binary_operator', 'children': ['360', '361'], 'value': '%'}; {'id': '360', 'type': 'string', 'children': [], 'value': '"%s is NOT similar to reference"'}; {'id': '361', 'type': '()', 'children': ['362']}; {'id': '362', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '363', 'type': 'else_clause', 'children': ['364']}; {'id': '364', 'type': 'block', 'children': ['365']}; {'id': '365', 'type': 'expression_statement', 'children': ['366']}; {'id': '366', 'type': 'call', 'children': ['367', '375']}; {'id': '367', 'type': 'attribute', 'children': ['368', '374']}; {'id': '368', 'type': 'call', 'children': ['369', '372']}; {'id': '369', 'type': 'attribute', 'children': ['370', '371']}; {'id': '370', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '371', 'type': 'identifier', 'children': [], 'value': 'getLogger'}; {'id': '372', 'type': 'argument_list', 'children': ['373']}; {'id': '373', 'type': 'string', 'children': [], 'value': '"Cover"'}; {'id': '374', 'type': 'identifier', 'children': [], 'value': 'warning'}; {'id': '375', 'type': 'argument_list', 'children': ['376']}; {'id': '376', 'type': 'string', 'children': [], 'value': '"No reference result found"'}; {'id': '377', 'type': 'return_statement', 'children': ['378']}; {'id': '378', 'type': 'identifier', 'children': [], 'value': 'results'}
Process results to prepare them for future comparison and sorting.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_global_color_table'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '5', 'type': 'block', 'children': ['6', '24', '43', '55', '69']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'global_color_table'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'string', 'children': [], 'value': "b''"}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '13', 'type': 'generator_expression', 'children': ['14', '17']}; {'id': '14', 'type': 'subscript', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'most_common'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'full_table_size'}; {'id': '27', 'type': 'binary_operator', 'children': ['28', '29'], 'value': '**'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '29', 'type': '()', 'children': ['30']}; {'id': '30', 'type': 'binary_operator', 'children': ['31', '32'], 'value': '+'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '42']}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'get_color_table_size'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '42', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'repeats'}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '48'], 'value': '*'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '48', 'type': '()', 'children': ['49']}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '51'], 'value': '-'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'full_table_size'}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'colors'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'zeros'}; {'id': '58', 'type': 'call', 'children': ['59', '62']}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'struct'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'pack'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'string', 'children': [], 'value': "'<{}x'"}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'repeats'}; {'id': '69', 'type': 'return_statement', 'children': ['70']}; {'id': '70', 'type': 'binary_operator', 'children': ['71', '72'], 'value': '+'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'global_color_table'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'zeros'}
Return a color table sorted in descending order of count.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_r'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'processed'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'deps'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'dependency_tree'}; {'id': '9', 'type': 'block', 'children': ['10', '16', '23', '62']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '14']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '13'], 'value': 'in'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'processed'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'return_statement', 'children': []}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'processed'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '23', 'type': 'for_statement', 'children': ['24', '25', '26']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'dep_key'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'deps'}; {'id': '26', 'type': 'block', 'children': ['27', '36', '53']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'dep_deps'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'dependency_tree'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dep_key'}; {'id': '36', 'type': 'if_statement', 'children': ['37', '40']}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': 'is'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'dep_deps'}; {'id': '39', 'type': 'None', 'children': []}; {'id': '40', 'type': 'block', 'children': ['41', '52']}; {'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': 'log'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': '\'"%s" not found, skipped\''}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'Repr'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'dep_key'}; {'id': '52', 'type': 'continue_statement', 'children': []}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_sort_r'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '58', '59', '60', '61']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'processed'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'dep_key'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'dep_deps'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'dependency_tree'}; {'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': 'sorted'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'tuple', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'deps'}
Recursive topological sort implementation.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_timezones'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '59', '67', '71', '91', '138', '220', '226']}; {'id': '5', 'type': 'function_definition', 'children': ['6', '7', '9']}; {'id': '6', 'type': 'function_name', 'children': [], 'value': 'hourmin'}; {'id': '7', 'type': 'parameters', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '9', 'type': 'block', 'children': ['10', '45', '55']}; {'id': '10', 'type': 'if_statement', 'children': ['11', '16', '31']}; {'id': '11', 'type': 'comparison_operator', 'children': ['12', '15'], 'value': '<'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '15', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '22']}; {'id': '19', 'type': 'pattern_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'hours'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'remaining'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '30']}; {'id': '25', 'type': 'binary_operator', 'children': ['26', '27'], 'value': '-'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '86400'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'seconds'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '3600'}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '38']}; {'id': '35', 'type': 'pattern_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'hours'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'remaining'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'seconds'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '3600'}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'assignment', 'children': ['47', '50']}; {'id': '47', 'type': 'pattern_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'minutes'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'remaining'}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'divmod'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'remaining'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '60'}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'expression_list', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'hours'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'minutes'}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'utcnow'}; {'id': '66', 'type': 'argument_list', 'children': []}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'timezone_country'}; {'id': '70', 'type': 'dictionary', 'children': []}; {'id': '71', 'type': 'for_statement', 'children': ['72', '73', '76']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'countrycode'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'country_timezones'}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'for_statement', 'children': ['78', '79', '84']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '79', 'type': 'subscript', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'country_timezones'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'countrycode'}; {'id': '84', 'type': 'block', 'children': ['85']}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'assignment', 'children': ['87', '90']}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'timezone_country'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'countrycode'}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'timezones'}; {'id': '94', 'type': 'list_comprehension', 'children': ['95', '111', '116']}; {'id': '95', 'type': 'tuple', 'children': ['96', '110']}; {'id': '96', 'type': 'call', 'children': ['97', '105']}; {'id': '97', 'type': 'attribute', 'children': ['98', '104']}; {'id': '98', 'type': 'call', 'children': ['99', '102']}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'utcoffset'}; {'id': '105', 'type': 'argument_list', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '107', 'type': 'keyword_argument', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'is_dst'}; {'id': '109', 'type': 'False', 'children': []}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '111', 'type': 'for_in_clause', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'common_timezones'}; {'id': '116', 'type': 'if_clause', 'children': ['117']}; {'id': '117', 'type': 'boolean_operator', 'children': ['118', '133'], 'value': 'and'}; {'id': '118', 'type': 'boolean_operator', 'children': ['119', '126'], 'value': 'and'}; {'id': '119', 'type': 'not_operator', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '124', 'type': 'argument_list', 'children': ['125']}; {'id': '125', 'type': 'string', 'children': [], 'value': "'US/'"}; {'id': '126', 'type': 'not_operator', 'children': ['127']}; {'id': '127', 'type': 'call', 'children': ['128', '131']}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'string', 'children': [], 'value': "'Canada/'"}; {'id': '133', 'type': 'comparison_operator', 'children': ['134', '135'], 'value': 'not'}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '135', 'type': 'tuple', 'children': ['136', '137']}; {'id': '136', 'type': 'string', 'children': [], 'value': "'GMT'"}; {'id': '137', 'type': 'string', 'children': [], 'value': "'UTC'"}; {'id': '138', 'type': 'expression_statement', 'children': ['139']}; {'id': '139', 'type': 'assignment', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'presorted'}; {'id': '141', 'type': 'list_comprehension', 'children': ['142', '215']}; {'id': '142', 'type': 'tuple', 'children': ['143', '144', '214']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '144', 'type': 'binary_operator', 'children': ['145', '146'], 'value': '%'}; {'id': '145', 'type': 'string', 'children': [], 'value': "'%s%s - %s%s (%s)'"}; {'id': '146', 'type': 'tuple', 'children': ['147', '172', '178', '193', '200']}; {'id': '147', 'type': 'boolean_operator', 'children': ['148', '171'], 'value': 'or'}; {'id': '148', 'type': 'boolean_operator', 'children': ['149', '157'], 'value': 'or'}; {'id': '149', 'type': '()', 'children': ['150']}; {'id': '150', 'type': 'boolean_operator', 'children': ['151', '156'], 'value': 'and'}; {'id': '151', 'type': 'comparison_operator', 'children': ['152', '155'], 'value': '<'}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '155', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '156', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '157', 'type': '()', 'children': ['158']}; {'id': '158', 'type': 'boolean_operator', 'children': ['159', '170'], 'value': 'and'}; {'id': '159', 'type': 'boolean_operator', 'children': ['160', '165'], 'value': 'and'}; {'id': '160', 'type': 'comparison_operator', 'children': ['161', '164'], 'value': '=='}; {'id': '161', 'type': 'attribute', 'children': ['162', '163']}; {'id': '162', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '163', 'type': 'identifier', 'children': [], 'value': 'days'}; {'id': '164', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '165', 'type': 'comparison_operator', 'children': ['166', '169'], 'value': '=='}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'seconds'}; {'id': '169', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '170', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '171', 'type': 'string', 'children': [], 'value': "'+'"}; {'id': '172', 'type': 'binary_operator', 'children': ['173', '174'], 'value': '%'}; {'id': '173', 'type': 'string', 'children': [], 'value': "'%02d:%02d'"}; {'id': '174', 'type': 'call', 'children': ['175', '176']}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'hourmin'}; {'id': '176', 'type': 'argument_list', 'children': ['177']}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '178', 'type': 'conditional_expression', 'children': ['179', '189', '192'], 'value': 'if'}; {'id': '179', 'type': '()', 'children': ['180']}; {'id': '180', 'type': 'binary_operator', 'children': ['181', '188'], 'value': '+'}; {'id': '181', 'type': 'subscript', 'children': ['182', '185']}; {'id': '182', 'type': 'attribute', 'children': ['183', '184']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '184', 'type': 'identifier', 'children': [], 'value': 'country_names'}; {'id': '185', 'type': 'subscript', 'children': ['186', '187']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'timezone_country'}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '188', 'type': 'string', 'children': [], 'value': "': '"}; {'id': '189', 'type': 'comparison_operator', 'children': ['190', '191'], 'value': 'in'}; {'id': '190', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'timezone_country'}; {'id': '192', 'type': 'string', 'children': [], 'value': "''"}; {'id': '193', 'type': 'call', 'children': ['194', '197']}; {'id': '194', 'type': 'attribute', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '196', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '197', 'type': 'argument_list', 'children': ['198', '199']}; {'id': '198', 'type': 'string', 'children': [], 'value': "'_'"}; {'id': '199', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '200', 'type': 'call', 'children': ['201', '209']}; {'id': '201', 'type': 'attribute', 'children': ['202', '208']}; {'id': '202', 'type': 'call', 'children': ['203', '206']}; {'id': '203', 'type': 'attribute', 'children': ['204', '205']}; {'id': '204', 'type': 'identifier', 'children': [], 'value': 'pytz'}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'timezone'}; {'id': '206', 'type': 'argument_list', 'children': ['207']}; {'id': '207', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'tzname'}; {'id': '209', 'type': 'argument_list', 'children': ['210', '211']}; {'id': '210', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '211', 'type': 'keyword_argument', 'children': ['212', '213']}; {'id': '212', 'type': 'identifier', 'children': [], 'value': 'is_dst'}; {'id': '213', 'type': 'False', 'children': []}; {'id': '214', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '215', 'type': 'for_in_clause', 'children': ['216', '219']}; {'id': '216', 'type': 'pattern_list', 'children': ['217', '218']}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '218', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'timezones'}; {'id': '220', 'type': 'expression_statement', 'children': ['221']}; {'id': '221', 'type': 'call', 'children': ['222', '225']}; {'id': '222', 'type': 'attribute', 'children': ['223', '224']}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'presorted'}; {'id': '224', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '225', 'type': 'argument_list', 'children': []}; {'id': '226', 'type': 'return_statement', 'children': ['227']}; {'id': '227', 'type': 'list_comprehension', 'children': ['228', '231']}; {'id': '228', 'type': 'tuple', 'children': ['229', '230']}; {'id': '229', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '230', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '231', 'type': 'for_in_clause', 'children': ['232', '236']}; {'id': '232', 'type': 'tuple_pattern', 'children': ['233', '234', '235']}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'delta'}; {'id': '234', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '235', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'presorted'}
Return a list of timezones sorted by offset from UTC.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'copy'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '13', '18']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'keyword_argument', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_key'}; {'id': '18', 'type': 'keyword_argument', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'load'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_load'}
Return a shallow copy of the sorted list.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'copy'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': 'call', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '__class__'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '15', '18']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': '_key'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_load'}; {'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': '_iteritems'}; {'id': '22', 'type': 'argument_list', 'children': []}
Return a shallow copy of the sorted dictionary.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_group'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'return_only_first'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '11', '18', '25', '44']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': "''' Sort a dictionary of relative paths and cluster equal paths together at the same time '''"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'd_sort'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sort_dict_of_paths'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '21', 'type': 'tuple', 'children': ['22', '24']}; {'id': '22', 'type': 'unary_operator', 'children': ['23'], 'value': '-'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'None', 'children': []}; {'id': '25', 'type': 'while_statement', 'children': ['26', '34']}; {'id': '26', 'type': '()', 'children': ['27']}; {'id': '27', 'type': 'boolean_operator', 'children': ['28', '33'], 'value': 'and'}; {'id': '28', 'type': 'comparison_operator', 'children': ['29', '32'], 'value': 'is'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '32', 'type': 'None', 'children': []}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'd_sort'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'd_sort'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'if_statement', 'children': ['45', '50', '53']}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '49'], 'value': 'is'}; {'id': '46', 'type': 'subscript', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '48', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '49', 'type': 'None', 'children': []}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'return_statement', 'children': ['52']}; {'id': '52', 'type': 'None', 'children': []}; {'id': '53', 'type': 'else_clause', 'children': ['54']}; {'id': '54', 'type': 'block', 'children': ['55', '59', '67', '118']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '58', 'type': 'list', 'children': [], 'value': '[]'}; {'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': 'lst'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'list', 'children': ['66'], 'value': '[base_elt]'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '67', 'type': 'if_statement', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'd_sort'}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'for_statement', 'children': ['71', '72', '73']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'd_sort'}; {'id': '73', 'type': 'block', 'children': ['74']}; {'id': '74', 'type': 'if_statement', 'children': ['75', '80']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '79'], 'value': 'is'}; {'id': '76', 'type': 'subscript', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '79', 'type': 'None', 'children': []}; {'id': '80', 'type': 'block', 'children': ['81']}; {'id': '81', 'type': 'if_statement', 'children': ['82', '89', '100']}; {'id': '82', 'type': 'comparison_operator', 'children': ['83', '86'], 'value': '=='}; {'id': '83', 'type': 'subscript', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '86', 'type': 'subscript', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '88', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '89', 'type': 'block', 'children': ['90']}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '98']}; {'id': '92', 'type': 'attribute', 'children': ['93', '97']}; {'id': '93', 'type': 'subscript', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '95', 'type': 'unary_operator', 'children': ['96'], 'value': '-'}; {'id': '96', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '100', 'type': 'else_clause', 'children': ['101']}; {'id': '101', 'type': 'block', 'children': ['102', '106', '114']}; {'id': '102', 'type': 'if_statement', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'return_only_first'}; {'id': '104', 'type': 'block', 'children': ['105']}; {'id': '105', 'type': 'break_statement', 'children': []}; {'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': 'lst'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '111', 'type': 'argument_list', 'children': ['112']}; {'id': '112', 'type': 'list', 'children': ['113'], 'value': '[elt]'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'base_elt'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'elt'}; {'id': '118', 'type': 'return_statement', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'lst'}
Sort a dictionary of relative paths and cluster equal paths together at the same time
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_name'}; {'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', '16']}; {'id': '7', 'type': 'boolean_operator', 'children': ['8', '11'], 'value': 'and'}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_record'}; {'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': '_record'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sort_name'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'return_statement', 'children': ['18']}; {'id': '18', 'type': 'attribute', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_record'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sort_name'}; {'id': '23', 'type': 'return_statement', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'name'}
Get the sorting name of this category
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'previous'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '28']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'oldest'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'older'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '23']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '=='}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'newest'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'newer'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'None', 'children': []}
Gets the previous page, respecting sort order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'next'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '28']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'oldest'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'newer'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '23']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '=='}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'newest'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'older'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'None', 'children': []}
Gets the next page, respecting sort order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'newest'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '28']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'newest'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '23']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '=='}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'oldest'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'last'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '37', 'type': 'lambda', 'children': ['38', '40']}; {'id': '38', 'type': 'lambda_parameters', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '40', 'type': 'tuple', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'date'}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'id'}
Gets the newest entry in the view, regardless of sort order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'oldest'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '17', '28']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '11'], 'value': '=='}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '11', 'type': 'string', 'children': [], 'value': "'newest'"}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'last'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '23']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '22'], 'value': '=='}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_order_by'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'oldest'"}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'first'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '37', 'type': 'lambda', 'children': ['38', '40']}; {'id': '38', 'type': 'lambda_parameters', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '40', 'type': 'tuple', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'date'}; {'id': '44', 'type': 'unary_operator', 'children': ['45'], 'value': '-'}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'id'}
Gets the oldest entry in the view, regardless of sort order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_precursor'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'loci'}; {'id': '6', 'type': 'block', 'children': ['7', '59', '75']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'data_loci'}; {'id': '10', 'type': 'list_comprehension', 'children': ['11', '47']}; {'id': '11', 'type': 'list', 'children': ['12', '13', '18', '26', '34', '39'], 'value': '[x, loci[x].chr, int(loci[x].start), int(loci[x].end), loci[x].strand, len(c.loci2seq[x])]'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'subscript', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'loci'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'chr'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'attribute', 'children': ['22', '25']}; {'id': '22', 'type': 'subscript', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'loci'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '33']}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'loci'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'loci'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'strand'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'subscript', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'loci2seq'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '47', 'type': 'for_in_clause', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '58']}; {'id': '53', 'type': 'attribute', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'loci2seq'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '58', 'type': 'argument_list', 'children': []}; {'id': '59', 'type': 'expression_statement', 'children': ['60']}; {'id': '60', 'type': 'assignment', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'data_loci'}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '66', '72']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'data_loci'}; {'id': '66', 'type': 'keyword_argument', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '72', 'type': 'keyword_argument', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '74', 'type': 'True', 'children': []}; {'id': '75', 'type': 'return_statement', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'data_loci'}
Sort loci according to number of sequences mapped there.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'hash_prefix_list_checksum'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '24', '78']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'''SELECT value FROM hash_prefix\n WHERE threat_type=? AND platform_type=? AND threat_entry_type=?\n ORDER BY value\n '''"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '14', 'type': 'list', 'children': ['15', '18', '21'], 'value': '[threat_list.threat_type, threat_list.platform_type, threat_list.threat_entry_type]'}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'threat_type'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'platform_type'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'threat_entry_type'}; {'id': '24', 'type': 'with_statement', 'children': ['25', '35']}; {'id': '25', 'type': 'with_clause', 'children': ['26']}; {'id': '26', 'type': 'with_item', 'children': ['27']}; {'id': '27', 'type': 'as_pattern', 'children': ['28', '33']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'get_cursor'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'as_pattern_target', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '35', 'type': 'block', 'children': ['36', '44', '65']}; {'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': 'dbc'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'all_hashes'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "b''"}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '51', 'type': 'generator_expression', 'children': ['52', '58']}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'bytes'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'subscript', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '57', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '58', 'type': 'for_in_clause', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '60', 'type': 'call', 'children': ['61', '64']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'fetchall'}; {'id': '64', 'type': 'argument_list', 'children': []}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'checksum'}; {'id': '68', 'type': 'call', 'children': ['69', '77']}; {'id': '69', 'type': 'attribute', 'children': ['70', '76']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'hashlib'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'sha256'}; {'id': '74', 'type': 'argument_list', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'all_hashes'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'digest'}; {'id': '77', 'type': 'argument_list', 'children': []}; {'id': '78', 'type': 'return_statement', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'checksum'}
Returns SHA256 checksum for alphabetically-sorted concatenated list of hash prefixes
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'remove_hash_prefix_indices'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '7', 'type': 'block', 'children': ['8', '12', '16', '26']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'batch_size'}; {'id': '11', 'type': 'integer', 'children': [], 'value': '40'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '15', 'type': 'string', 'children': [], 'value': "'''DELETE FROM hash_prefix\n WHERE threat_type=? AND platform_type=? AND threat_entry_type=? AND value IN ({})\n '''"}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'prefixes_to_remove'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'get_hash_prefix_values_to_remove'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '26', 'type': 'with_statement', 'children': ['27', '37']}; {'id': '27', 'type': 'with_clause', 'children': ['28']}; {'id': '28', 'type': 'with_item', 'children': ['29']}; {'id': '29', 'type': 'as_pattern', 'children': ['30', '35']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'get_cursor'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'as_pattern_target', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'for_statement', 'children': ['39', '40', '49']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44', '48']}; {'id': '43', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'prefixes_to_remove'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'batch_size'}; {'id': '49', 'type': 'block', 'children': ['50', '62', '86']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'remove_batch'}; {'id': '53', 'type': 'subscript', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'prefixes_to_remove'}; {'id': '55', 'type': 'slice', 'children': ['56', '57', '58']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '57', 'type': 'colon', 'children': []}; {'id': '58', 'type': '()', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '+'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'batch_size'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '76'], 'value': '+'}; {'id': '66', 'type': 'list', 'children': ['67', '70', '73'], 'value': '[\n threat_list.threat_type,\n threat_list.platform_type,\n threat_list.threat_entry_type\n ]'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'threat_type'}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'platform_type'}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'threat_list'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'threat_entry_type'}; {'id': '76', 'type': 'list_comprehension', 'children': ['77', '83']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'sqlite3'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'Binary'}; {'id': '81', 'type': 'argument_list', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '83', 'type': 'for_in_clause', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'remove_batch'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'dbc'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '109']}; {'id': '92', 'type': 'call', 'children': ['93', '96']}; {'id': '93', 'type': 'attribute', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'q'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '96', 'type': 'argument_list', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'string', 'children': [], 'value': "','"}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '101', 'type': 'argument_list', 'children': ['102']}; {'id': '102', 'type': 'binary_operator', 'children': ['103', '105'], 'value': '*'}; {'id': '103', 'type': 'list', 'children': ['104'], 'value': "['?']"}; {'id': '104', 'type': 'string', 'children': [], 'value': "'?'"}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'remove_batch'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'params'}
Remove records matching idices from a lexicographically-sorted local threat list.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_releases'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '23', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'releases'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '18']}; {'id': '10', 'type': 'tuple', 'children': ['11', '17']}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'parse_version'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'release'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'version'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'release'}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'release'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'releases'}; {'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': 'releases'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '31', 'type': 'True', 'children': []}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'list_comprehension', 'children': ['34', '37']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'release'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'for_in_clause', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'release'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'releases'}
Releases sorted by version.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '35', '52']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'backups'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '22']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'glob'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'join'}; {'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': 'backup_directory'}; {'id': '21', 'type': 'string', 'children': [], 'value': "'*'"}; {'id': '22', 'type': 'block', 'children': ['23']}; {'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': 'backups'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'WorkspaceBackup'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'from_path'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'backups'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '49']}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '43', 'type': 'lambda', 'children': ['44', '46']}; {'id': '44', 'type': 'lambda_parameters', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'b'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'lastmod'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '51', 'type': 'True', 'children': []}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'backups'}
List all backups as WorkspaceBackup objects, sorted descending by lastmod.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'topological'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '93', '105']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '12']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10', '11']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'enter'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '12', 'type': 'expression_list', 'children': ['13', '16', '20']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'deque'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '20', 'type': 'dictionary', 'children': []}; {'id': '21', 'type': 'function_definition', 'children': ['22', '23', '25']}; {'id': '22', 'type': 'function_name', 'children': [], 'value': 'dfs'}; {'id': '23', 'type': 'parameters', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '25', 'type': 'block', 'children': ['26', '32', '80', '87']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'GRAY'}; {'id': '32', 'type': 'for_statement', 'children': ['33', '34', '41']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '40', 'type': 'tuple', 'children': []}; {'id': '41', 'type': 'block', 'children': ['42', '52', '62', '68', '75']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '51', 'type': 'None', 'children': []}; {'id': '52', 'type': 'if_statement', 'children': ['53', '56']}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '55'], 'value': '=='}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'GRAY'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'raise_statement', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'string', 'children': [], 'value': "'cycle'"}; {'id': '62', 'type': 'if_statement', 'children': ['63', '66']}; {'id': '63', 'type': 'comparison_operator', 'children': ['64', '65'], 'value': '=='}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'BLACK'}; {'id': '66', 'type': 'block', 'children': ['67']}; {'id': '67', 'type': 'continue_statement', 'children': []}; {'id': '68', 'type': 'expression_statement', 'children': ['69']}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'enter'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'discard'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '75', 'type': 'expression_statement', 'children': ['76']}; {'id': '76', 'type': 'call', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'dfs'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'appendleft'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'assignment', 'children': ['89', '92']}; {'id': '89', 'type': 'subscript', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'state'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'BLACK'}; {'id': '93', 'type': 'while_statement', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'enter'}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'dfs'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'enter'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '104', 'type': 'argument_list', 'children': []}; {'id': '105', 'type': 'return_statement', 'children': ['106']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'order'}
Return nodes in a topological order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '17']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_bits'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'generic_type', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '8', 'type': 'type_parameter', 'children': ['9']}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'generic_type', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '12', 'type': 'type_parameter', 'children': ['13', '15']}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '29']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'bit'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '31', 'type': 'lambda', 'children': ['32', '34']}; {'id': '32', 'type': 'lambda_parameters', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}
Return list of bit items sorted by position.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '17']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_enums'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'type', 'children': ['6']}; {'id': '6', 'type': 'generic_type', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '8', 'type': 'type_parameter', 'children': ['9']}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'generic_type', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '12', 'type': 'type_parameter', 'children': ['13', '15']}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '15', 'type': 'type', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'return_statement', 'children': ['19']}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '29']}; {'id': '22', 'type': 'call', 'children': ['23', '28']}; {'id': '23', 'type': 'attribute', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'enum'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '31', 'type': 'lambda', 'children': ['32', '34']}; {'id': '32', 'type': 'lambda_parameters', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}
Return list of enum items sorted by value.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_lambda'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sortedby'}; {'id': '6', 'type': 'string', 'children': [], 'value': "'cpu_percent'"}; {'id': '7', 'type': 'default_parameter', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sortedby_secondary'}; {'id': '9', 'type': 'string', 'children': [], 'value': "'memory_percent'"}; {'id': '10', 'type': 'block', 'children': ['11', '15', '33']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'if_statement', 'children': ['16', '19', '24']}; {'id': '16', 'type': 'comparison_operator', 'children': ['17', '18'], 'value': '=='}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sortedby'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'io_counters'"}; {'id': '19', 'type': 'block', 'children': ['20']}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_sort_io_counters'}; {'id': '24', 'type': 'elif_clause', 'children': ['25', '28']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': '=='}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sortedby'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'cpu_times'"}; {'id': '28', 'type': 'block', 'children': ['29']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': '_sort_cpu_times'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ret'}
Return a sort lambda function for the sortedbykey
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'loop_position'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '26']}; {'id': '6', 'type': 'for_statement', 'children': ['7', '10', '16']}; {'id': '7', 'type': 'pattern_list', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_sort_loop'}; {'id': '16', 'type': 'block', 'children': ['17']}; {'id': '17', 'type': 'if_statement', 'children': ['18', '23']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': '=='}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'glances_processes'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '26', 'type': 'return_statement', 'children': ['27']}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}
Return the current sort in the loop
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_event_sort_key'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '6', 'type': 'block', 'children': ['7', '37']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14', '19', '31']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'string', 'children': [], 'value': '"MEM"'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '18', 'type': 'string', 'children': [], 'value': "'memory_percent'"}; {'id': '19', 'type': 'elif_clause', 'children': ['20', '26']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"CPU_IOWAIT"'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'io_counters'"}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'cpu_percent'"}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ret'}
Return the process sort key
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_process_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'event_type'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'glances_processes'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'auto_sort'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'glances_processes'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'get_event_sort_key'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'event_type'}
Define the process auto sort key from the alert type.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '29']}; {'id': '15', 'type': 'if_statement', 'children': ['16', '22']}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '19'], 'value': 'and'}; {'id': '17', 'type': 'not_operator', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': '_keys'}; {'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': 'key'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'KeyValue'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '38']}; {'id': '31', 'type': 'attribute', 'children': ['32', '37']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'CliTable'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '42', '45']}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '42', 'type': 'keyword_argument', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'reverse'}
Overrides sort func to use the KeyValue for the key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_order'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '5', 'type': 'block', 'children': ['6', '8']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Do a topological sort on the dependency graph dict.\n '''"}; {'id': '8', 'type': 'while_statement', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '10', 'type': 'block', 'children': ['11', '28', '39', '45']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'leftmost'}; {'id': '14', 'type': 'list_comprehension', 'children': ['15', '16', '25']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '16', 'type': 'for_in_clause', 'children': ['17', '20']}; {'id': '17', 'type': 'pattern_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'if_clause', 'children': ['26']}; {'id': '26', 'type': 'not_operator', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '28', 'type': 'if_statement', 'children': ['29', '31']}; {'id': '29', 'type': 'not_operator', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'leftmost'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'raise_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '38'], 'value': '%'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'Dependency cycle detected! %s'"}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'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': 'leftmost'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'for_statement', 'children': ['46', '47', '48']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'leftmost'}; {'id': '48', 'type': 'block', 'children': ['49', '52', '59']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'yield', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '59', 'type': 'for_statement', 'children': ['60', '61', '66']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'bset'}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'graph'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '65', 'type': 'argument_list', 'children': []}; {'id': '66', 'type': 'block', 'children': ['67']}; {'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': 'bset'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'discard'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'result'}
Do a topological sort on the dependency graph dict.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_process_and_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'force_ascii'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'full_process'}; {'id': '8', 'type': 'True', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '25', '33', '45']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'ts'}; {'id': '13', 'type': 'conditional_expression', 'children': ['14', '23', '24'], 'value': 'if'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'full_process'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'force_ascii'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'force_ascii'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'full_process'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ts'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sorted_string'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': 'u" "'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'tokens'}; {'id': '45', 'type': 'return_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'sorted_string'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '50', 'type': 'argument_list', 'children': []}
Return a cleaned string with token sorted.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_depth'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'vals'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '28', '44']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '12', 'type': 'list_comprehension', 'children': ['13', '19']}; {'id': '13', 'type': 'list', 'children': ['14', '18'], 'value': '[float(price), quantity]'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'price'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'quantity'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '23']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'price'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'quantity'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'vals'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35', '41']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'lst'}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '41', 'type': 'keyword_argument', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'lst'}
Sort bids or asks by price
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'user_agents'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'return_statement', 'children': ['7']}; {'id': '7', 'type': '()', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '58']}; {'id': '9', 'type': 'attribute', 'children': ['10', '57']}; {'id': '10', 'type': 'call', 'children': ['11', '44']}; {'id': '11', 'type': 'attribute', 'children': ['12', '43']}; {'id': '12', 'type': 'call', 'children': ['13', '37']}; {'id': '13', 'type': 'attribute', 'children': ['14', '36']}; {'id': '14', 'type': 'call', 'children': ['15', '22']}; {'id': '15', 'type': 'attribute', 'children': ['16', '21']}; {'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_query'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'select'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '28']}; {'id': '23', 'type': 'subscript', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'PageView'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'User-Agent'"}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'Count'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'PageView'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'group_by'}; {'id': '37', 'type': 'argument_list', 'children': ['38']}; {'id': '38', 'type': 'subscript', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'PageView'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'headers'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'User-Agent'"}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'order_by'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '56']}; {'id': '46', 'type': 'attribute', 'children': ['47', '55']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'Count'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'PageView'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'tuples'}; {'id': '58', 'type': 'argument_list', 'children': []}
Retrieve user-agents, sorted by most common to least common.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_visible_units'}; {'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', '43']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '10', 'type': 'argument_list', 'children': ['11', '20']}; {'id': '11', 'type': 'attribute', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': '_obs'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'observation'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'raw_data'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'units'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '22', 'type': 'lambda', 'children': ['23', '25']}; {'id': '23', 'type': 'lambda_parameters', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '25', 'type': 'tuple', 'children': ['26', '31', '36', '40']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'pos'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'z'}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '35'], 'value': '!='}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'owner'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '16'}; {'id': '36', 'type': 'unary_operator', 'children': ['37'], 'value': '-'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'radius'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'yield', 'children': ['46']}; {'id': '46', 'type': 'expression_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'u'}; {'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': 'point'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'Point'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'build'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'u'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'pos'}
A generator of visible units and their positions as `Point`s, sorted.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zincrby'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'amount'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '8', 'type': 'block', 'children': ['9', '11']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': '"Increment the score of ``value`` in sorted set ``name`` by ``amount``"'}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'execute_command'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18', '19', '20']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'ZINCRBY'"}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'amount'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'value'}
Increment the score of ``value`` in sorted set ``name`` by ``amount``
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'argsort_k_smallest'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '6', 'type': 'block', 'children': ['7', '24', '43', '57', '63']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '=='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'np'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'dtype'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'intp'}; {'id': '24', 'type': 'if_statement', 'children': ['25', '35']}; {'id': '25', 'type': 'boolean_operator', 'children': ['26', '29'], 'value': 'or'}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': 'is'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '28', 'type': 'None', 'children': []}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': '>='}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '46', 'type': 'subscript', 'children': ['47', '54']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'argpartition'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '54', 'type': 'slice', 'children': ['55', '56']}; {'id': '55', 'type': 'colon', 'children': []}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '60', 'type': 'subscript', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'argsort'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'values'}
Return no more than ``k`` indices of smallest values.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'data'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '63']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '10', '25', '55']}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'xs'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dataset'}; {'id': '20', 'type': 'keyword_argument', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '25', 'type': 'elif_clause', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'shuffle'}; {'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': 'xs'}; {'id': '33', 'type': 'list_comprehension', 'children': ['34', '39']}; {'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': 'dataset'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'for_in_clause', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'random_shuffler'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'dataset'}; {'id': '55', 'type': 'else_clause', 'children': ['56']}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'xs'}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'dataset'}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'xs'}
Return the examples in the dataset in order, sorted, or shuffled.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_topological_dag_upstreams'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dag'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'op_runs'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'runs_by_ops'}; {'id': '8', 'type': 'block', 'children': ['9', '20']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorted_ops'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dags'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sort_topologically'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dag'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'dag'}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'op_id'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted_ops'}; {'id': '23', 'type': 'block', 'children': ['24', '30', '36']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'op_run_id'}; {'id': '27', 'type': 'subscript', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'runs_by_ops'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'op_id'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'op_run'}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'op_runs'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'op_run_id'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'set_op_upstreams'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '43']}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'op_run'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'op_run'}; {'id': '43', 'type': 'keyword_argument', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'op'}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'ops'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'op_id'}
Set the upstream runs for the operation runs in the dag following the topological sort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_product_set'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'array_a'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'array_b'}; {'id': '6', 'type': 'block', 'children': ['7']}; {'id': '7', 'type': 'return_statement', 'children': ['8']}; {'id': '8', 'type': 'subscript', 'children': ['9', '37']}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'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': 'np'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'concatenate'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '34']}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '25']}; {'id': '20', 'type': 'binary_operator', 'children': ['21', '24'], 'value': '*'}; {'id': '21', 'type': 'subscript', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'array_a'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'array_b'}; {'id': '25', 'type': 'for_in_clause', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'xrange'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'array_a'}; {'id': '34', 'type': 'keyword_argument', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'axis'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '37', 'type': 'slice', 'children': ['38', '39', '40']}; {'id': '38', 'type': 'colon', 'children': []}; {'id': '39', 'type': 'colon', 'children': []}; {'id': '40', 'type': 'unary_operator', 'children': ['41'], 'value': '-'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}
Compute the product set of array_a and array_b and sort it.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rank_items'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'userid'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'user_items'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'selected_items'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'recalculate_user'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '36', '42', '53', '77', '91', '112']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '30']}; {'id': '13', 'type': 'boolean_operator', 'children': ['14', '24'], 'value': 'or'}; {'id': '14', 'type': 'comparison_operator', 'children': ['15', '19'], 'value': '>='}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'selected_items'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'user_items'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'shape'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '29'], 'value': '<'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'selected_items'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '30', 'type': 'block', 'children': ['31']}; {'id': '31', 'type': 'raise_statement', 'children': ['32']}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'IndexError'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'string', 'children': [], 'value': '"Some of selected itemids are not in the model"'}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'liked_vector'}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'user_items'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'userid'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'recommendations'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'liked_vector'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'dot'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'similarity'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'best'}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '68']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '61', 'type': 'argument_list', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'recommendations'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'recommendations'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'lambda', 'children': ['71', '73']}; {'id': '71', 'type': 'lambda_parameters', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '73', 'type': 'unary_operator', 'children': ['74'], 'value': '-'}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '76', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '80', 'type': 'list_comprehension', 'children': ['81', '82', '85']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '82', 'type': 'for_in_clause', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'best'}; {'id': '85', 'type': 'if_clause', 'children': ['86']}; {'id': '86', 'type': 'comparison_operator', 'children': ['87', '90'], 'value': 'in'}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'rec'}; {'id': '89', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'selected_items'}; {'id': '91', 'type': 'for_statement', 'children': ['92', '93', '94']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'itemid'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'selected_items'}; {'id': '94', 'type': 'block', 'children': ['95']}; {'id': '95', 'type': 'if_statement', 'children': ['96', '101']}; {'id': '96', 'type': 'comparison_operator', 'children': ['97', '98'], 'value': 'not'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'itemid'}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'recommendations'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'indices'}; {'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': 'ret'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'tuple', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'itemid'}; {'id': '110', 'type': 'unary_operator', 'children': ['111'], 'value': '-'}; {'id': '111', 'type': 'float', 'children': [], 'value': '1.0'}; {'id': '112', 'type': 'return_statement', 'children': ['113']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'ret'}
Rank given items for a user and returns sorted item list
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'aos_as_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''\n Returns a list of atomic orbitals, sorted from lowest to highest energy\n '''"}; {'id': '8', 'type': 'return_statement', 'children': ['9']}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '11', 'type': 'argument_list', 'children': ['12', '37']}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'chain'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'from_iterable'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'list_comprehension', 'children': ['18', '32']}; {'id': '18', 'type': 'binary_operator', 'children': ['19', '24'], 'value': '*'}; {'id': '19', 'type': 'subscript', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'aos'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'el'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'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': 'composition'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'el'}; {'id': '32', 'type': 'for_in_clause', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'el'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'elements'}; {'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': '2'}
Returns a list of atomic orbitals, sorted from lowest to highest energy
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_dataframe'}; {'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': 'sort_key'}; {'id': '7', 'type': 'string', 'children': [], 'value': '"wall_time"'}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'block', 'children': ['11', '16', '29', '54', '62', '70', '78', '86', '94', '102', '110']}; {'id': '11', 'type': 'import_statement', 'children': ['12']}; {'id': '12', 'type': 'aliased_import', 'children': ['13', '15']}; {'id': '13', 'type': 'dotted_name', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'pandas'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'pd'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'DataFrame'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'keyword_argument', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'AbinitTimerSection'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'FIELDS'}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '37']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'osect'}; {'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': 'order_sections'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '51']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'osect'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'to_dict'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ignore_index'}; {'id': '53', 'type': 'True', 'children': []}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'cpu_time'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'cpu_time'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'wall_time'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'wall_time'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'mpi_nprocs'}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'mpi_nprocs'}; {'id': '86', 'type': 'expression_statement', 'children': ['87']}; {'id': '87', 'type': 'assignment', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'omp_nthreads'}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'omp_nthreads'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'mpi_rank'}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'mpi_rank'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'assignment', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'frame'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'fname'}; {'id': '110', 'type': 'return_statement', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'frame'}
Return a pandas DataFrame with entries sorted according to `sort_key`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'order_sections'}; {'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': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '8', 'type': 'True', 'children': []}; {'id': '9', 'type': 'block', 'children': ['10', '21']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fsort'}; {'id': '13', 'type': 'lambda', 'children': ['14', '16']}; {'id': '14', 'type': 'lambda_parameters', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '16', 'type': 'subscript', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '__dict__'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '28', '31']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sections'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'fsort'}; {'id': '31', 'type': 'keyword_argument', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'reverse'}
Sort sections according to the value of key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_efficiency'}; {'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': 'reverse'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '28']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'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': '_confs'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '25']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '19', 'type': 'lambda', 'children': ['20', '22']}; {'id': '20', 'type': 'lambda_parameters', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'efficiency'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}
Sort the configurations in place. items with highest efficiency come first
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_speedup'}; {'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': 'reverse'}; {'id': '7', 'type': 'True', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '28']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'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': '_confs'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '25']}; {'id': '17', 'type': 'keyword_argument', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '19', 'type': 'lambda', 'children': ['20', '22']}; {'id': '20', 'type': 'lambda_parameters', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'speedup'}; {'id': '25', 'type': 'keyword_argument', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}
Sort the configurations in place. items with highest speedup come first
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_by_mem_per_proc'}; {'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': 'reverse'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '41']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '21']}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'any'}; {'id': '12', 'type': 'generator_expression', 'children': ['13', '18']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '17'], 'value': '>'}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'mem_per_proc'}; {'id': '17', 'type': 'float', 'children': [], 'value': '0.0'}; {'id': '18', 'type': 'for_in_clause', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_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': '_confs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '38']}; {'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': 'c'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'mem_per_proc'}; {'id': '38', 'type': 'keyword_argument', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}
Sort the configurations in place. items with lowest memory per proc come first.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_line_in_facet'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'facet'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '20', '24', '125']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'facet'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'outer_lines'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'pt'}; {'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': 'prev'}; {'id': '23', 'type': 'None', 'children': []}; {'id': '24', 'type': 'while_statement', 'children': ['25', '31']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '30'], 'value': '>'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '31', 'type': 'block', 'children': ['32', '85', '102', '119']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36', '46']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': 'is'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'prev'}; {'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': 'l'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '46', 'type': 'else_clause', 'children': ['47']}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'for_statement', 'children': ['49', '52', '56']}; {'id': '49', 'type': 'pattern_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '54', 'type': 'argument_list', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'if_statement', 'children': ['58', '61']}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '60'], 'value': 'in'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'prev'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '61', 'type': 'block', 'children': ['62', '71', '84']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '71', 'type': 'if_statement', 'children': ['72', '77']}; {'id': '72', 'type': 'comparison_operator', 'children': ['73', '76'], 'value': '=='}; {'id': '73', 'type': 'subscript', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'prev'}; {'id': '77', 'type': 'block', 'children': ['78']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '83', 'type': 'argument_list', 'children': []}; {'id': '84', 'type': 'break_statement', 'children': []}; {'id': '85', 'type': 'expression_statement', 'children': ['86']}; {'id': '86', 'type': 'call', 'children': ['87', '90']}; {'id': '87', 'type': 'attribute', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'pt'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'call', 'children': ['92', '101']}; {'id': '92', 'type': 'attribute', 'children': ['93', '100']}; {'id': '93', 'type': 'subscript', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'wulff_pt_list'}; {'id': '97', 'type': 'subscript', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '99', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'tolist'}; {'id': '101', 'type': 'argument_list', 'children': []}; {'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': 'pt'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '118']}; {'id': '109', 'type': 'attribute', 'children': ['110', '117']}; {'id': '110', 'type': 'subscript', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'wulff_pt_list'}; {'id': '114', 'type': 'subscript', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '116', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'tolist'}; {'id': '118', 'type': 'argument_list', 'children': []}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'prev'}; {'id': '122', 'type': 'subscript', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '124', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'pt'}
Returns the sorted pts in a facet used to draw a line
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_all_ns_packages'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '16']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'pkgs'}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '15'], 'value': 'or'}; {'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': 'distribution'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'namespace_packages'}; {'id': '15', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'flatten'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': '_pkg_names'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'pkgs'}
Return sorted list of all package namespaces
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sorter'}; {'id': '3', 'type': 'parameters', 'children': ['4', '7']}; {'id': '4', 'type': 'default_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'subpath'}; {'id': '6', 'type': 'string', 'children': [], 'value': "''"}; {'id': '7', 'type': 'dictionary_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'defaults'}; {'id': '9', 'type': 'block', 'children': ['10', '86']}; {'id': '10', 'type': 'decorated_definition', 'children': ['11', '18']}; {'id': '11', 'type': 'decorator', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'restrict_access'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'keyword_argument', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '17', 'type': 'string', 'children': [], 'value': "'read'"}; {'id': '18', 'type': 'function_definition', 'children': ['19', '20', '26']}; {'id': '19', 'type': 'function_name', 'children': [], 'value': '_sorted'}; {'id': '20', 'type': 'parameters', 'children': ['21', '22', '24']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'list_splat_pattern', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '24', 'type': 'dictionary_splat_pattern', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '26', 'type': 'block', 'children': ['27', '42', '63', '73']}; {'id': '27', 'type': 'if_statement', 'children': ['28', '35']}; {'id': '28', 'type': 'not_operator', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'string', 'children': [], 'value': "'params'"}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'assignment', 'children': ['38', '41']}; {'id': '38', 'type': 'subscript', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '40', 'type': 'string', 'children': [], 'value': "'params'"}; {'id': '41', 'type': 'dictionary', 'children': []}; {'id': '42', 'type': 'for_statement', 'children': ['43', '46', '52']}; {'id': '43', 'type': 'pattern_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'defaults'}; {'id': '52', 'type': 'block', 'children': ['53']}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'subscript', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '58', 'type': 'string', 'children': [], 'value': "'params'"}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'urljoin'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_url'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'subpath'}; {'id': '73', 'type': 'return_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '80']}; {'id': '75', 'type': 'attribute', 'children': ['76', '79']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'reddit_session'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'get_content'}; {'id': '80', 'type': 'argument_list', 'children': ['81', '82', '84']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '82', 'type': 'list_splat', 'children': ['83']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '84', 'type': 'dictionary_splat', 'children': ['85']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': '_sorted'}
Return function to generate specific subreddit Submission listings.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_draw_banner'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '20', '38', '44', '62', '77', '90', '116', '129', '138', '150', '206']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '11']}; {'id': '8', 'type': 'pattern_list', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'n_rows'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'n_cols'}; {'id': '11', 'type': 'call', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'attribute', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'stdscr'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'getmaxyx'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'window'}; {'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': 'term'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'stdscr'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'derwin'}; {'id': '31', 'type': 'argument_list', 'children': ['32', '33', '34', '37']}; {'id': '32', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'n_cols'}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_row'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'window'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'erase'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'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': 'window'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'bkgd'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '54']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '54', 'type': 'call', 'children': ['55', '60']}; {'id': '55', 'type': 'attribute', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'string', 'children': [], 'value': "'OrderBar'"}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'banner'}; {'id': '65', 'type': 'conditional_expression', 'children': ['66', '69', '74'], 'value': 'if'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'docs'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'BANNER_SEARCH'}; {'id': '69', 'type': 'attribute', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'BANNER'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'items'}; {'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': 'banner'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '86', 'type': 'argument_list', 'children': []}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '88', 'type': 'argument_list', 'children': ['89']}; {'id': '89', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '90', 'type': 'expression_statement', 'children': ['91']}; {'id': '91', 'type': 'assignment', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '93', 'type': 'binary_operator', 'children': ['94', '109'], 'value': '/'}; {'id': '94', 'type': '()', 'children': ['95']}; {'id': '95', 'type': 'binary_operator', 'children': ['96', '108'], 'value': '-'}; {'id': '96', 'type': 'binary_operator', 'children': ['97', '98'], 'value': '-'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'n_cols'}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '100', 'type': 'generator_expression', 'children': ['101', '105']}; {'id': '101', 'type': 'call', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '103', 'type': 'argument_list', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '105', 'type': 'for_in_clause', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '108', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '109', 'type': '()', 'children': ['110']}; {'id': '110', 'type': 'binary_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': 'items'}; {'id': '115', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '116', 'type': 'expression_statement', 'children': ['117']}; {'id': '117', 'type': 'assignment', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'spacing'}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '128'], 'value': '*'}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '122', 'type': 'argument_list', 'children': ['123', '124']}; {'id': '123', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '124', 'type': 'call', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '126', 'type': 'argument_list', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'distance'}; {'id': '128', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'assignment', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '132', 'type': 'call', 'children': ['133', '136']}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'spacing'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '136', 'type': 'argument_list', 'children': ['137']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '138', 'type': 'expression_statement', 'children': ['139']}; {'id': '139', 'type': 'call', 'children': ['140', '145']}; {'id': '140', 'type': 'attribute', 'children': ['141', '144']}; {'id': '141', 'type': 'attribute', 'children': ['142', '143']}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'add_line'}; {'id': '145', 'type': 'argument_list', 'children': ['146', '147', '148', '149']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'window'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '148', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '149', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '150', 'type': 'if_statement', 'children': ['151', '158']}; {'id': '151', 'type': 'comparison_operator', 'children': ['152', '157'], 'value': 'is'}; {'id': '152', 'type': 'attribute', 'children': ['153', '156']}; {'id': '153', 'type': 'attribute', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '155', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '157', 'type': 'None', 'children': []}; {'id': '158', 'type': 'block', 'children': ['159', '174', '185', '196']}; {'id': '159', 'type': 'expression_statement', 'children': ['160']}; {'id': '160', 'type': 'assignment', 'children': ['161', '162']}; {'id': '161', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '162', 'type': 'subscript', 'children': ['163', '173']}; {'id': '163', 'type': 'call', 'children': ['164', '171']}; {'id': '164', 'type': 'attribute', 'children': ['165', '170']}; {'id': '165', 'type': 'attribute', 'children': ['166', '169']}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '169', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '170', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '171', 'type': 'argument_list', 'children': ['172']}; {'id': '172', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '173', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '174', 'type': 'expression_statement', 'children': ['175']}; {'id': '175', 'type': 'assignment', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '177', 'type': 'binary_operator', 'children': ['178', '184'], 'value': '-'}; {'id': '178', 'type': 'call', 'children': ['179', '182']}; {'id': '179', 'type': 'attribute', 'children': ['180', '181']}; {'id': '180', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '181', 'type': 'identifier', 'children': [], 'value': 'find'}; {'id': '182', 'type': 'argument_list', 'children': ['183']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '184', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '185', 'type': 'expression_statement', 'children': ['186']}; {'id': '186', 'type': 'assignment', 'children': ['187', '188']}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '188', 'type': 'call', 'children': ['189', '194']}; {'id': '189', 'type': 'attribute', 'children': ['190', '193']}; {'id': '190', 'type': 'attribute', 'children': ['191', '192']}; {'id': '191', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'term'}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '194', 'type': 'argument_list', 'children': ['195']}; {'id': '195', 'type': 'string', 'children': [], 'value': "'OrderBarHighlight'"}; {'id': '196', 'type': 'expression_statement', 'children': ['197']}; {'id': '197', 'type': 'call', 'children': ['198', '201']}; {'id': '198', 'type': 'attribute', 'children': ['199', '200']}; {'id': '199', 'type': 'identifier', 'children': [], 'value': 'window'}; {'id': '200', 'type': 'identifier', 'children': [], 'value': 'chgat'}; {'id': '201', 'type': 'argument_list', 'children': ['202', '203', '204', '205']}; {'id': '202', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '203', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '204', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '206', 'type': 'expression_statement', 'children': ['207']}; {'id': '207', 'type': 'augmented_assignment', 'children': ['208', '211'], 'value': '+='}; {'id': '208', 'type': 'attribute', 'children': ['209', '210']}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '210', 'type': 'identifier', 'children': [], 'value': '_row'}; {'id': '211', 'type': 'integer', 'children': [], 'value': '1'}
Draw the banner with sorting options at the top of the page
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_args'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '5', 'type': 'block', 'children': ['6', '14', '31', '42']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'flags'}; {'id': '17', 'type': 'list_comprehension', 'children': ['18', '19', '22']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '22', 'type': 'if_clause', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'FLAGS_RE'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'for_statement', 'children': ['32', '33', '34']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'flags'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'binary_operator', 'children': ['44', '45'], 'value': '+'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'flags'}
Put flags at the end
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'plot_fracs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'fignum'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15', '22', '28', '36', '59', '70', '79', '100', '122', '129', '136', '150', '170', '181']}; {'id': '15', 'type': 'import_from_statement', 'children': ['16', '20']}; {'id': '16', 'type': 'relative_import', 'children': ['17', '18']}; {'id': '17', 'type': 'import_prefix', 'children': []}; {'id': '18', 'type': 'dotted_name', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'plotting'}; {'id': '20', 'type': 'dotted_name', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'Tango'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'Tango'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reset'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'Tango'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'nextMedium'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'if_statement', 'children': ['37', '40']}; {'id': '37', 'type': 'comparison_operator', 'children': ['38', '39'], 'value': 'is'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '39', 'type': 'None', 'children': []}; {'id': '40', 'type': 'block', 'children': ['41', '50']}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'fig'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'pylab'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'figure'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'fignum'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'fig'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'add_subplot'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'integer', 'children': [], 'value': '111'}; {'id': '59', 'type': 'if_statement', 'children': ['60', '63']}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '62'], 'value': 'is'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '62', 'type': 'None', 'children': []}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'assignment', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'arange'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '79', 'type': 'expression_statement', 'children': ['80']}; {'id': '80', 'type': 'assignment', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'bar'}; {'id': '82', 'type': 'call', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'bar'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '90', '97']}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '89'], 'value': '-'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '89', 'type': 'float', 'children': [], 'value': '.4'}; {'id': '90', 'type': 'subscript', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'fracs'}; {'id': '94', 'type': 'slice', 'children': ['95', '96']}; {'id': '95', 'type': 'colon', 'children': []}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'Q'}; {'id': '97', 'type': 'keyword_argument', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'color'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '100', 'type': 'expression_statement', 'children': ['101']}; {'id': '101', 'type': 'call', 'children': ['102', '105']}; {'id': '102', 'type': 'attribute', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'set_xticks'}; {'id': '105', 'type': 'argument_list', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '107', 'type': 'call', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'map'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '119']}; {'id': '110', 'type': 'lambda', 'children': ['111', '113']}; {'id': '111', 'type': 'lambda_parameters', 'children': ['112']}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'string', 'children': [], 'value': 'r"${}$"'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '117', 'type': 'argument_list', 'children': ['118']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '121'], 'value': '+'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '121', 'type': 'integer', 'children': [], 'value': '1'}; {'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': 'ax'}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'set_ylabel'}; {'id': '127', 'type': 'argument_list', 'children': ['128']}; {'id': '128', 'type': 'string', 'children': [], 'value': '"Eigenvalue fraction"'}; {'id': '129', 'type': 'expression_statement', 'children': ['130']}; {'id': '130', 'type': 'call', 'children': ['131', '134']}; {'id': '131', 'type': 'attribute', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'set_xlabel'}; {'id': '134', 'type': 'argument_list', 'children': ['135']}; {'id': '135', 'type': 'string', 'children': [], 'value': '"PC"'}; {'id': '136', 'type': 'expression_statement', 'children': ['137']}; {'id': '137', 'type': 'call', 'children': ['138', '141']}; {'id': '138', 'type': 'attribute', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'set_ylim'}; {'id': '141', 'type': 'argument_list', 'children': ['142', '143']}; {'id': '142', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '143', 'type': 'subscript', 'children': ['144', '149']}; {'id': '144', 'type': 'call', 'children': ['145', '148']}; {'id': '145', 'type': 'attribute', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'get_ylim'}; {'id': '148', 'type': 'argument_list', 'children': []}; {'id': '149', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '150', 'type': 'expression_statement', 'children': ['151']}; {'id': '151', 'type': 'call', 'children': ['152', '155']}; {'id': '152', 'type': 'attribute', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'ax'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'set_xlim'}; {'id': '155', 'type': 'argument_list', 'children': ['156', '163']}; {'id': '156', 'type': 'binary_operator', 'children': ['157', '162'], 'value': '-'}; {'id': '157', 'type': 'call', 'children': ['158', '161']}; {'id': '158', 'type': 'attribute', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 'min'}; {'id': '161', 'type': 'argument_list', 'children': []}; {'id': '162', 'type': 'float', 'children': [], 'value': '.5'}; {'id': '163', 'type': 'binary_operator', 'children': ['164', '169'], 'value': '+'}; {'id': '164', 'type': 'call', 'children': ['165', '168']}; {'id': '165', 'type': 'attribute', 'children': ['166', '167']}; {'id': '166', 'type': 'identifier', 'children': [], 'value': 'ticks'}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '168', 'type': 'argument_list', 'children': []}; {'id': '169', 'type': 'float', 'children': [], 'value': '.5'}; {'id': '170', 'type': 'try_statement', 'children': ['171', '178']}; {'id': '171', 'type': 'block', 'children': ['172']}; {'id': '172', 'type': 'expression_statement', 'children': ['173']}; {'id': '173', 'type': 'call', 'children': ['174', '177']}; {'id': '174', 'type': 'attribute', 'children': ['175', '176']}; {'id': '175', 'type': 'identifier', 'children': [], 'value': 'pylab'}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'tight_layout'}; {'id': '177', 'type': 'argument_list', 'children': []}; {'id': '178', 'type': 'except_clause', 'children': ['179']}; {'id': '179', 'type': 'block', 'children': ['180']}; {'id': '180', 'type': 'pass_statement', 'children': []}; {'id': '181', 'type': 'return_statement', 'children': ['182']}; {'id': '182', 'type': 'identifier', 'children': [], 'value': 'bar'}
Plot fractions of Eigenvalues sorted in descending order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_values'}; {'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': 'ascending'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9']}; {'id': '9', 'type': 'if_statement', 'children': ['10', '15', '101']}; {'id': '10', 'type': 'comparison_operator', 'children': ['11', '14'], 'value': 'is'}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'index_type'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '28', '40', '51', '65', '81']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'index_expr'}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'get_field'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'assignment', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'column_expr'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get_field'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '39', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'zip_expr'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'zip_columns'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'list', 'children': ['49', '50'], 'value': '[index_expr, column_expr]'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'index_expr'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'column_expr'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'result_expr'}; {'id': '54', 'type': 'call', 'children': ['55', '58']}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '58', 'type': 'argument_list', 'children': ['59', '60', '61', '64']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'zip_expr'}; {'id': '60', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'unzip_expr'}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'unzip_columns'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'result_expr'}; {'id': '74', 'type': 'list', 'children': ['75', '78'], 'value': '[self.index_type, self.weld_type]'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'index_type'}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '81', 'type': 'return_statement', 'children': ['82']}; {'id': '82', 'type': 'call', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'SeriesWeld'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '86', '89', '92', '95', '98']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'unzip_expr'}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'weld_type'}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'df'}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'column_name'}; {'id': '95', 'type': 'attribute', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'index_type'}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'index_name'}; {'id': '101', 'type': 'else_clause', 'children': ['102']}; {'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': 'result_expr'}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'grizzly_impl'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'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': 'expr'}
Sorts the values of this series
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'resort_client_actions'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'portal'}; {'id': '5', 'type': 'block', 'children': ['6', '21', '32', '49', '66', '86', '96']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sorted_actions'}; {'id': '9', 'type': 'list', 'children': ['10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'], 'value': '[\n "edit",\n "contacts",\n "view",\n "analysisrequests",\n "batches",\n "samplepoints",\n "profiles",\n "templates",\n "specs",\n "orders",\n "reports_listing"\n ]'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"edit"'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"contacts"'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"view"'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"analysisrequests"'}; {'id': '14', 'type': 'string', 'children': [], 'value': '"batches"'}; {'id': '15', 'type': 'string', 'children': [], 'value': '"samplepoints"'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"profiles"'}; {'id': '17', 'type': 'string', 'children': [], 'value': '"templates"'}; {'id': '18', 'type': 'string', 'children': [], 'value': '"specs"'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"orders"'}; {'id': '20', 'type': 'string', 'children': [], 'value': '"reports_listing"'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'type_info'}; {'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': 'portal'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'portal_types'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'getTypeInfo'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"Client"'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '35', 'type': 'call', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '46']}; {'id': '38', 'type': 'lambda', 'children': ['39', '41']}; {'id': '39', 'type': 'lambda_parameters', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '45'], 'value': 'in'}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'sorted_actions'}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'type_info'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_actions'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '52', 'type': 'call', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '63']}; {'id': '55', 'type': 'lambda', 'children': ['56', '58']}; {'id': '56', 'type': 'lambda_parameters', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '62'], 'value': 'not'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sorted_actions'}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'type_info'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '_actions'}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'assignment', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '69', 'type': 'call', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '75', 'type': 'lambda', 'children': ['76', '78']}; {'id': '76', 'type': 'lambda_parameters', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '78', 'type': 'call', 'children': ['79', '82']}; {'id': '79', 'type': 'attribute', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'sorted_actions'}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'act'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '86', 'type': 'if_statement', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '88', 'type': 'block', 'children': ['89']}; {'id': '89', 'type': 'expression_statement', 'children': ['90']}; {'id': '90', 'type': 'call', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'actions'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '96', 'type': 'expression_statement', 'children': ['97']}; {'id': '97', 'type': 'assignment', 'children': ['98', '101']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'type_info'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': '_actions'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'actions'}
Resorts client action views
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reindex_sortable_title'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'portal'}; {'id': '5', 'type': 'block', 'children': ['6', '13']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'catalogs'}; {'id': '9', 'type': 'list', 'children': ['10', '11', '12'], 'value': '[\n "bika_catalog",\n "bika_setup_catalog",\n "portal_catalog",\n ]'}; {'id': '10', 'type': 'string', 'children': [], 'value': '"bika_catalog"'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"bika_setup_catalog"'}; {'id': '12', 'type': 'string', 'children': [], 'value': '"portal_catalog"'}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '16']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'catalog_name'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'catalogs'}; {'id': '16', 'type': 'block', 'children': ['17', '29', '38', '47', '58']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'logger'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"Reindexing sortable_title for {} ..."'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'catalog_name'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'handler'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'ZLogHandler'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'keyword_argument', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'steps'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'catalog'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'get_tool'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'catalog_name'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'catalog'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'reindexIndex'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54', '55']}; {'id': '53', 'type': 'string', 'children': [], 'value': '"sortable_title"'}; {'id': '54', 'type': 'None', 'children': []}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'pghandler'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'handler'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'commit_transaction'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'portal'}
Reindex sortable_title from some catalogs
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortable_title'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '25']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'plone_sortable_title'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '18']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'safe_callable'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '30', 'type': 'argument_list', 'children': []}
Uses the default Plone sortable_text index lower-case
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortable_sortkey_title'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '25', '33', '42']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sortable_title'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '13', 'type': 'if_statement', 'children': ['14', '18']}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'safe_callable'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'assignment', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'instance'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'getSortKey'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'if_statement', 'children': ['34', '37']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '36'], 'value': 'is'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '36', 'type': 'None', 'children': []}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '999999'}; {'id': '42', 'type': 'return_statement', 'children': ['43']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'string', 'children': [], 'value': '"{:010.3f}{}"'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'title'}
Returns a sortable title as a mxin of sortkey + lowercase sortable_title
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sorted_attachments'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '21', '29', '93', '103']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'inf'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': '"inf"'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'order'}; {'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_attachments_order'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'attachments'}; {'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_attachments'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'function_definition', 'children': ['30', '31', '34']}; {'id': '30', 'type': 'function_name', 'children': [], 'value': 'att_cmp'}; {'id': '31', 'type': 'parameters', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'att1'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'att2'}; {'id': '34', 'type': 'block', 'children': ['35', '44', '53', '70', '87']}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'att1'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'string', 'children': [], 'value': "'UID'"}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'att2'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': "'UID'"}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_i1'}; {'id': '56', 'type': 'boolean_operator', 'children': ['57', '69'], 'value': 'or'}; {'id': '57', 'type': 'boolean_operator', 'children': ['58', '61'], 'value': 'and'}; {'id': '58', 'type': 'comparison_operator', 'children': ['59', '60'], 'value': 'in'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '61', 'type': 'binary_operator', 'children': ['62', '68'], 'value': '+'}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'inf'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': '_i2'}; {'id': '73', 'type': 'boolean_operator', 'children': ['74', '86'], 'value': 'or'}; {'id': '74', 'type': 'boolean_operator', 'children': ['75', '78'], 'value': 'and'}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'in'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '78', 'type': 'binary_operator', 'children': ['79', '85'], 'value': '+'}; {'id': '79', 'type': 'call', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'inf'}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '90', 'type': 'argument_list', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': '_i1'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': '_i2'}; {'id': '93', 'type': 'expression_statement', 'children': ['94']}; {'id': '94', 'type': 'assignment', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'sorted_attachments'}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '98', 'type': 'argument_list', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'attachments'}; {'id': '100', 'type': 'keyword_argument', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'att_cmp'}; {'id': '103', 'type': 'return_statement', 'children': ['104']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'sorted_attachments'}
Returns a sorted list of analysis info dictionaries
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rejectionOptionsList'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '14', '20', '42', '53', '65', '69', '86']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"Return a sorted list with the options defined in bikasetup"'}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'plone'}; {'id': '11', 'type': 'call', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'getSite'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'plone'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'bika_setup'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '29', '38']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '28'], 'value': '>'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'RejectionReasons'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'reject_reasons'}; {'id': '33', 'type': 'subscript', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'RejectionReasons'}; {'id': '37', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '38', 'type': 'else_clause', 'children': ['39']}; {'id': '39', 'type': 'block', 'children': ['40']}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'reject_reasons'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '52', 'type': 'argument_list', 'children': []}; {'id': '53', 'type': 'if_statement', 'children': ['54', '57']}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '56'], 'value': 'in'}; {'id': '55', 'type': 'string', 'children': [], 'value': "'checkbox'"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '57', 'type': 'block', 'children': ['58']}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'checkbox'"}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '68', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '69', 'type': 'for_statement', 'children': ['70', '71', '72']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sorted_keys'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'call', 'children': ['75', '78']}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '78', 'type': 'argument_list', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '85']}; {'id': '80', 'type': 'attribute', 'children': ['81', '84']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'reject_reasons'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '85', 'type': 'argument_list', 'children': []}; {'id': '86', 'type': 'return_statement', 'children': ['87']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'items'}
Return a sorted list with the options defined in bikasetup