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': 'get_sorted_fields'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '21', '83']}; {'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_field_order'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'function_definition', 'children': ['22', '23', '26']}; {'id': '22', 'type': 'function_name', 'children': [], 'value': 'field_cmp'}; {'id': '23', 'type': 'parameters', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'field1'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'field2'}; {'id': '26', 'type': 'block', 'children': ['27', '35', '43', '60', '77']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'field1'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'getName'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'field2'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'getName'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_i1'}; {'id': '46', 'type': 'boolean_operator', 'children': ['47', '59'], 'value': 'or'}; {'id': '47', 'type': 'boolean_operator', 'children': ['48', '51'], 'value': 'and'}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': 'in'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '51', 'type': 'binary_operator', 'children': ['52', '58'], 'value': '+'}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': '_n1'}; {'id': '58', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'inf'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_i2'}; {'id': '63', 'type': 'boolean_operator', 'children': ['64', '76'], 'value': 'or'}; {'id': '64', 'type': 'boolean_operator', 'children': ['65', '68'], 'value': 'and'}; {'id': '65', 'type': 'comparison_operator', 'children': ['66', '67'], 'value': 'in'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '68', 'type': 'binary_operator', 'children': ['69', '75'], 'value': '+'}; {'id': '69', 'type': 'call', 'children': ['70', '73']}; {'id': '70', 'type': 'attribute', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_n2'}; {'id': '75', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'inf'}; {'id': '77', 'type': 'return_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '80', 'type': 'argument_list', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': '_i1'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': '_i2'}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'call', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '86', 'type': 'argument_list', 'children': ['87', '92']}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'get_fields'}; {'id': '91', 'type': 'argument_list', 'children': []}; {'id': '92', 'type': 'keyword_argument', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'field_cmp'}
Return the sorted fields
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'resolve_sorting'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '21', '33', '43', '124']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '10', 'type': 'dictionary', 'children': []}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '14', 'type': 'call', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': '"sidx"'}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '24', 'type': 'boolean_operator', 'children': ['25', '26'], 'value': 'or'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"sort_on"'}; {'id': '32', 'type': 'None', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '36', 'type': 'boolean_operator', 'children': ['37', '42'], 'value': 'or'}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '41'], 'value': 'and'}; {'id': '38', 'type': 'comparison_operator', 'children': ['39', '40'], 'value': '=='}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '40', 'type': 'string', 'children': [], 'value': '"Title"'}; {'id': '41', 'type': 'string', 'children': [], 'value': '"sortable_title"'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '43', 'type': 'if_statement', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '45', 'type': 'block', 'children': ['46', '52', '62', '74', '97', '115']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '51']}; {'id': '48', 'type': 'subscript', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '50', 'type': 'string', 'children': [], 'value': '"sort_on"'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sort_on'}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61']}; {'id': '60', 'type': 'string', 'children': [], 'value': '"sord"'}; {'id': '61', 'type': 'None', 'children': []}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '65', 'type': 'boolean_operator', 'children': ['66', '67'], 'value': 'or'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '67', 'type': 'call', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '71', 'type': 'argument_list', 'children': ['72', '73']}; {'id': '72', 'type': 'string', 'children': [], 'value': '"sort_order"'}; {'id': '73', 'type': 'None', 'children': []}; {'id': '74', 'type': 'if_statement', 'children': ['75', '82', '89']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'in'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '77', 'type': 'list', 'children': ['78', '79', '80', '81'], 'value': '["desc", "reverse", "rev", "descending"]'}; {'id': '78', 'type': 'string', 'children': [], 'value': '"desc"'}; {'id': '79', 'type': 'string', 'children': [], 'value': '"reverse"'}; {'id': '80', 'type': 'string', 'children': [], 'value': '"rev"'}; {'id': '81', 'type': 'string', 'children': [], 'value': '"descending"'}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'expression_statement', 'children': ['84']}; {'id': '84', 'type': 'assignment', 'children': ['85', '88']}; {'id': '85', 'type': 'subscript', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '87', 'type': 'string', 'children': [], 'value': '"sort_order"'}; {'id': '88', 'type': 'string', 'children': [], 'value': '"descending"'}; {'id': '89', 'type': 'else_clause', 'children': ['90']}; {'id': '90', 'type': 'block', 'children': ['91']}; {'id': '91', 'type': 'expression_statement', 'children': ['92']}; {'id': '92', 'type': 'assignment', 'children': ['93', '96']}; {'id': '93', 'type': 'subscript', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '95', 'type': 'string', 'children': [], 'value': '"sort_order"'}; {'id': '96', 'type': 'string', 'children': [], 'value': '"ascending"'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'assignment', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'sort_limit'}; {'id': '100', 'type': 'call', 'children': ['101', '104']}; {'id': '101', 'type': 'attribute', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'api'}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'to_int'}; {'id': '104', 'type': 'argument_list', 'children': ['105', '112']}; {'id': '105', 'type': 'call', 'children': ['106', '109']}; {'id': '106', 'type': 'attribute', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '109', 'type': 'argument_list', 'children': ['110', '111']}; {'id': '110', 'type': 'string', 'children': [], 'value': '"limit"'}; {'id': '111', 'type': 'integer', 'children': [], 'value': '30'}; {'id': '112', 'type': 'keyword_argument', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'default'}; {'id': '114', 'type': 'integer', 'children': [], 'value': '30'}; {'id': '115', 'type': 'if_statement', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'sort_limit'}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '123']}; {'id': '120', 'type': 'subscript', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '122', 'type': 'string', 'children': [], 'value': '"sort_limit"'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'sort_limit'}; {'id': '124', 'type': 'return_statement', 'children': ['125']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'sorting'}
Resolves the sorting criteria for the given query
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'is_sortable_index'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index_name'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'catalog'}; {'id': '7', 'type': 'block', 'children': ['8', '18', '24']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'get_index'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'index_name'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'catalog'}; {'id': '18', 'type': 'if_statement', 'children': ['19', '21']}; {'id': '19', 'type': 'not_operator', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'False', 'children': []}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '29'], 'value': 'in'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'meta_type'}; {'id': '29', 'type': 'list', 'children': ['30', '31'], 'value': '["FieldIndex", "DateIndex"]'}; {'id': '30', 'type': 'string', 'children': [], 'value': '"FieldIndex"'}; {'id': '31', 'type': 'string', 'children': [], 'value': '"DateIndex"'}
Returns whether the index is sortable
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortable_title'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'portal'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '23', '38', '48', '97']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '10']}; {'id': '8', 'type': 'not_operator', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'string', 'children': [], 'value': "''"}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'def_charset'}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'portal'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'plone_utils'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'getSiteEncoding'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '37']}; {'id': '30', 'type': 'attribute', 'children': ['31', '36']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'num_sort_regex'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sub'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'zero_fill'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '48', 'type': 'for_statement', 'children': ['49', '50', '54']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'charset'}; {'id': '50', 'type': 'list', 'children': ['51', '52', '53'], 'value': "[def_charset, 'latin-1', 'utf-8']"}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'def_charset'}; {'id': '52', 'type': 'string', 'children': [], 'value': "'latin-1'"}; {'id': '53', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'try_statement', 'children': ['56', '81', '85']}; {'id': '56', 'type': 'block', 'children': ['57', '69', '80']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '60', 'type': 'subscript', 'children': ['61', '66']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'safe_unicode'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'charset'}; {'id': '66', 'type': 'slice', 'children': ['67', '68']}; {'id': '67', 'type': 'colon', 'children': []}; {'id': '68', 'type': 'integer', 'children': [], 'value': '30'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'boolean_operator', 'children': ['78', '79'], 'value': 'or'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'def_charset'}; {'id': '79', 'type': 'string', 'children': [], 'value': "'utf-8'"}; {'id': '80', 'type': 'break_statement', 'children': []}; {'id': '81', 'type': 'except_clause', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'UnicodeError'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'pass_statement', 'children': []}; {'id': '85', 'type': 'except_clause', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '87', 'type': 'block', 'children': ['88', '96']}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '91', 'type': 'subscript', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}; {'id': '93', 'type': 'slice', 'children': ['94', '95']}; {'id': '94', 'type': 'colon', 'children': []}; {'id': '95', 'type': 'integer', 'children': [], 'value': '30'}; {'id': '96', 'type': 'break_statement', 'children': []}; {'id': '97', 'type': 'return_statement', 'children': ['98']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'sortabletitle'}
Convert title to sortable title
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_column'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '7', 'type': 'block', 'children': ['8', '20', '41', '65', '85']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '18']}; {'id': '9', 'type': 'comparison_operator', 'children': ['10', '13'], 'value': 'in'}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'tk'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'DISABLED'}; {'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': 'state'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'block', 'children': ['19']}; {'id': '19', 'type': 'return_statement', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '23', 'type': 'list_comprehension', 'children': ['24', '33']}; {'id': '24', 'type': 'tuple', 'children': ['25', '32']}; {'id': '25', 'type': 'call', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '33', 'type': 'for_in_clause', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'get_children'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'string', 'children': [], 'value': "''"}; {'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': 'l'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '50']}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '50', 'type': 'keyword_argument', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '52', 'type': 'lambda', 'children': ['53', '55']}; {'id': '53', 'type': 'lambda_parameters', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '55', 'type': 'call', 'children': ['56', '61']}; {'id': '56', 'type': 'subscript', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_column_types'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'subscript', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '65', 'type': 'for_statement', 'children': ['66', '71', '75']}; {'id': '66', 'type': 'pattern_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '68', 'type': 'tuple_pattern', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '71', 'type': 'call', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'expression_statement', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'move'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '83', '84']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '83', 'type': 'string', 'children': [], 'value': '""'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'index'}; {'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': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'heading'}; {'id': '90', 'type': 'argument_list', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '92', 'type': 'keyword_argument', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '94', 'type': 'lambda', 'children': ['95']}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': '_sort_column'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'column'}; {'id': '101', 'type': 'not_operator', 'children': ['102']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'reverse'}
Sort a column by its values
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_config_sortable'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '6', 'type': 'block', 'children': ['7', '42']}; {'id': '7', 'type': 'for_statement', 'children': ['8', '9', '12']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '9', 'type': 'subscript', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'string', 'children': [], 'value': '"columns"'}; {'id': '12', 'type': 'block', 'children': ['13', '32']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '16', 'type': 'conditional_expression', 'children': ['17', '30', '31'], 'value': 'if'}; {'id': '17', 'type': '()', 'children': ['18']}; {'id': '18', 'type': 'lambda', 'children': ['19', '23']}; {'id': '19', 'type': 'lambda_parameters', 'children': ['20']}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_sort_column'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '29', 'type': 'True', 'children': []}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sortable'}; {'id': '31', 'type': 'string', 'children': [], 'value': '""'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'heading'}; {'id': '37', 'type': 'argument_list', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'command'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': '_sortable'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sortable'}
Configure a new sortable state
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'unique_categories'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '5', 'type': 'block', 'children': ['6', '15', '32', '54']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'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': 'unique'}; {'id': '13', 'type': 'argument_list', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'setdiff1d'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'settings'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'categories_to_ignore'}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'natsorted'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'categories'}; {'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': 'v'}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'upper'}; {'id': '53', 'type': 'argument_list', 'children': []}; {'id': '54', 'type': 'return_statement', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'categories'}
Pass array-like categories, return sorted cleaned unique categories.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '26']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '8', '11', '14', '17', '20', '23']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'list_splat_pattern', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'get_patterns'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'by'}; {'id': '10', 'type': 'None', 'children': []}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '16', 'type': 'None', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'asc'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'default_parameter', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '22', 'type': 'False', 'children': []}; {'id': '23', 'type': 'default_parameter', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '25', 'type': 'None', 'children': []}; {'id': '26', 'type': 'block', 'children': ['27', '31', '42', '58', '75', '91', '99', '110']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '30', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'is'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'by'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'augmented_assignment', 'children': ['38', '39'], 'value': '+='}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '39', 'type': 'list', 'children': ['40', '41'], 'value': "[b'BY', by]"}; {'id': '40', 'type': 'string', 'children': [], 'value': "b'BY'"}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'by'}; {'id': '42', 'type': 'if_statement', 'children': ['43', '50']}; {'id': '43', 'type': 'boolean_operator', 'children': ['44', '47'], 'value': 'and'}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '46'], 'value': 'is'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '46', 'type': 'None', 'children': []}; {'id': '47', 'type': 'comparison_operator', 'children': ['48', '49'], 'value': 'is'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '49', 'type': 'None', 'children': []}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'augmented_assignment', 'children': ['53', '54'], 'value': '+='}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '54', 'type': 'list', 'children': ['55', '56', '57'], 'value': "[b'LIMIT', offset, count]"}; {'id': '55', 'type': 'string', 'children': [], 'value': "b'LIMIT'"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '58', 'type': 'if_statement', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'get_patterns'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'augmented_assignment', 'children': ['63', '64'], 'value': '+='}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '66', 'type': 'argument_list', 'children': ['67', '74']}; {'id': '67', 'type': 'generator_expression', 'children': ['68', '71']}; {'id': '68', 'type': 'list', 'children': ['69', '70'], 'value': "[b'GET', pattern]"}; {'id': '69', 'type': 'string', 'children': [], 'value': "b'GET'"}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '71', 'type': 'for_in_clause', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'get_patterns'}; {'id': '74', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '75', 'type': 'if_statement', 'children': ['76', '79']}; {'id': '76', 'type': 'comparison_operator', 'children': ['77', '78'], 'value': 'is'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'asc'}; {'id': '78', 'type': 'None', 'children': []}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'augmented_assignment', 'children': ['82', '83'], 'value': '+='}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '83', 'type': 'list', 'children': ['84'], 'value': "[asc is True and b'ASC' or b'DESC']"}; {'id': '84', 'type': 'boolean_operator', 'children': ['85', '90'], 'value': 'or'}; {'id': '85', 'type': 'boolean_operator', 'children': ['86', '89'], 'value': 'and'}; {'id': '86', 'type': 'comparison_operator', 'children': ['87', '88'], 'value': 'is'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'asc'}; {'id': '88', 'type': 'True', 'children': []}; {'id': '89', 'type': 'string', 'children': [], 'value': "b'ASC'"}; {'id': '90', 'type': 'string', 'children': [], 'value': "b'DESC'"}; {'id': '91', 'type': 'if_statement', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'alpha'}; {'id': '93', 'type': 'block', 'children': ['94']}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'augmented_assignment', 'children': ['96', '97'], 'value': '+='}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '97', 'type': 'list', 'children': ['98'], 'value': "[b'ALPHA']"}; {'id': '98', 'type': 'string', 'children': [], 'value': "b'ALPHA'"}; {'id': '99', 'type': 'if_statement', 'children': ['100', '103']}; {'id': '100', 'type': 'comparison_operator', 'children': ['101', '102'], 'value': 'is'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '102', 'type': 'None', 'children': []}; {'id': '103', 'type': 'block', 'children': ['104']}; {'id': '104', 'type': 'expression_statement', 'children': ['105']}; {'id': '105', 'type': 'augmented_assignment', 'children': ['106', '107'], 'value': '+='}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '107', 'type': 'list', 'children': ['108', '109'], 'value': "[b'STORE', store]"}; {'id': '108', 'type': 'string', 'children': [], 'value': "b'STORE'"}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'store'}; {'id': '110', 'type': 'return_statement', 'children': ['111']}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '115', 'type': 'argument_list', 'children': ['116', '117', '118']}; {'id': '116', 'type': 'string', 'children': [], 'value': "b'SORT'"}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '118', 'type': 'list_splat', 'children': ['119']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'args'}
Sort the elements in a list, set or sorted set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zrem'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'member'}; {'id': '7', 'type': 'list_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'members'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '18', '19']}; {'id': '16', 'type': 'string', 'children': [], 'value': "b'ZREM'"}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'member'}; {'id': '19', 'type': 'list_splat', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'members'}
Remove one or more members from a sorted set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zscore'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'member'}; {'id': '7', 'type': 'block', 'children': ['8', '19']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'fut'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'string', 'children': [], 'value': "b'ZSCORE'"}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'member'}; {'id': '19', 'type': 'return_statement', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'wait_convert'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'fut'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'optional_int_or_float'}
Get the score associated with the given member in a sorted set.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zunionstore'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '9', '12']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'destkey'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '7', 'type': 'list_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'with_weights'}; {'id': '11', 'type': 'False', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'aggregate'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '23', '30', '34', '94', '142', '155']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '22'], 'value': '+'}; {'id': '20', 'type': 'tuple', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'numkeys'}; {'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': 'keys'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '33', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '36', '85']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'with_weights'}; {'id': '36', 'type': 'block', 'children': ['37', '53', '58', '78']}; {'id': '37', 'type': 'assert_statement', 'children': ['38', '51']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '40', 'type': 'generator_expression', 'children': ['41', '48']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '45', 'type': 'tuple', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '48', 'type': 'for_in_clause', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '51', 'type': '()', 'children': ['52']}; {'id': '52', 'type': 'string', 'children': [], 'value': '"All key arguments must be (key, weight) tuples"'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'weights'}; {'id': '56', 'type': 'list', 'children': ['57'], 'value': "['WEIGHTS']"}; {'id': '57', 'type': 'string', 'children': [], 'value': "'WEIGHTS'"}; {'id': '58', 'type': 'for_statement', 'children': ['59', '62', '63']}; {'id': '59', 'type': 'pattern_list', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '63', 'type': 'block', 'children': ['64', '71']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'call', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'weights'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'weight'}; {'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': 'args'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'weights'}; {'id': '85', 'type': 'else_clause', 'children': ['86']}; {'id': '86', 'type': 'block', 'children': ['87']}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'call', 'children': ['89', '92']}; {'id': '89', 'type': 'attribute', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '94', 'type': 'if_statement', 'children': ['95', '100', '110', '126']}; {'id': '95', 'type': 'comparison_operator', 'children': ['96', '97'], 'value': 'is'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'aggregate'}; {'id': '97', 'type': 'attribute', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'ZSET_AGGREGATE_SUM'}; {'id': '100', 'type': 'block', 'children': ['101']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'tuple', 'children': ['108', '109']}; {'id': '108', 'type': 'string', 'children': [], 'value': "'AGGREGATE'"}; {'id': '109', 'type': 'string', 'children': [], 'value': "'SUM'"}; {'id': '110', 'type': 'elif_clause', 'children': ['111', '116']}; {'id': '111', 'type': 'comparison_operator', 'children': ['112', '113'], 'value': 'is'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'aggregate'}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'ZSET_AGGREGATE_MAX'}; {'id': '116', 'type': 'block', 'children': ['117']}; {'id': '117', 'type': 'expression_statement', 'children': ['118']}; {'id': '118', 'type': 'call', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '122', 'type': 'argument_list', 'children': ['123']}; {'id': '123', 'type': 'tuple', 'children': ['124', '125']}; {'id': '124', 'type': 'string', 'children': [], 'value': "'AGGREGATE'"}; {'id': '125', 'type': 'string', 'children': [], 'value': "'MAX'"}; {'id': '126', 'type': 'elif_clause', 'children': ['127', '132']}; {'id': '127', 'type': 'comparison_operator', 'children': ['128', '129'], 'value': 'is'}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'aggregate'}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'ZSET_AGGREGATE_MIN'}; {'id': '132', 'type': 'block', 'children': ['133']}; {'id': '133', 'type': 'expression_statement', 'children': ['134']}; {'id': '134', 'type': 'call', 'children': ['135', '138']}; {'id': '135', 'type': 'attribute', 'children': ['136', '137']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '138', 'type': 'argument_list', 'children': ['139']}; {'id': '139', 'type': 'tuple', 'children': ['140', '141']}; {'id': '140', 'type': 'string', 'children': [], 'value': "'AGGREGATE'"}; {'id': '141', 'type': 'string', 'children': [], 'value': "'MIN'"}; {'id': '142', 'type': 'expression_statement', 'children': ['143']}; {'id': '143', 'type': 'assignment', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'fut'}; {'id': '145', 'type': 'call', 'children': ['146', '149']}; {'id': '146', 'type': 'attribute', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '149', 'type': 'argument_list', 'children': ['150', '151', '152', '153']}; {'id': '150', 'type': 'string', 'children': [], 'value': "b'ZUNIONSTORE'"}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'destkey'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'numkeys'}; {'id': '153', 'type': 'list_splat', 'children': ['154']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '155', 'type': 'return_statement', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'fut'}
Add multiple sorted sets and store result in a new key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'zscan'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '9', '12']}; {'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': 'cursor'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'block', 'children': ['16', '20', '31', '42', '55', '74']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '19', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '24']}; {'id': '21', 'type': 'comparison_operator', 'children': ['22', '23'], 'value': 'is'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '23', 'type': 'None', 'children': []}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'expression_statement', 'children': ['26']}; {'id': '26', 'type': 'augmented_assignment', 'children': ['27', '28'], 'value': '+='}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '28', 'type': 'list', 'children': ['29', '30'], 'value': "[b'MATCH', match]"}; {'id': '29', 'type': 'string', 'children': [], 'value': "b'MATCH'"}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': 'is'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '34', 'type': 'None', 'children': []}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'expression_statement', 'children': ['37']}; {'id': '37', 'type': 'augmented_assignment', 'children': ['38', '39'], 'value': '+='}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '39', 'type': 'list', 'children': ['40', '41'], 'value': "[b'COUNT', count]"}; {'id': '40', 'type': 'string', 'children': [], 'value': "b'COUNT'"}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'fut'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51', '52', '53']}; {'id': '50', 'type': 'string', 'children': [], 'value': "b'ZSCAN'"}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '53', 'type': 'list_splat', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '55', 'type': 'function_definition', 'children': ['56', '57', '59']}; {'id': '56', 'type': 'function_name', 'children': [], 'value': '_converter'}; {'id': '57', 'type': 'parameters', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'tuple', 'children': ['62', '68']}; {'id': '62', 'type': 'call', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '64', 'type': 'argument_list', 'children': ['65']}; {'id': '65', 'type': 'subscript', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '67', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'pairs_int_or_float'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '73', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '74', 'type': 'return_statement', 'children': ['75']}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'wait_convert'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'fut'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': '_converter'}
Incrementally iterate sorted sets elements and associated scores.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_UpdateForemanProcessStatus'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '29', '78']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'used_memory'}; {'id': '9', 'type': 'boolean_operator', 'children': ['10', '17'], 'value': 'or'}; {'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': '_process_information'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'GetUsedMemory'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'display_name'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27', '28']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': '_merge_task'}; {'id': '27', 'type': 'string', 'children': [], 'value': "'identifier'"}; {'id': '28', 'type': 'string', 'children': [], 'value': "''"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '36']}; {'id': '31', 'type': 'attribute', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': '_processing_status'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'UpdateForemanStatus'}; {'id': '36', 'type': 'argument_list', 'children': ['37', '40', '43', '46', '47', '48', '51', '54', '57', '60', '63', '66', '69', '72', '75']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': '_name'}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_status'}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_pid'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'used_memory'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'display_name'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': '_number_of_consumed_sources'}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': '_number_of_produced_sources'}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_number_of_consumed_events'}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_number_of_produced_events'}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_number_of_consumed_event_tags'}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': '_number_of_produced_event_tags'}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': '_number_of_consumed_warnings'}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_number_of_produced_warnings'}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': '_number_of_consumed_reports'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '_number_of_produced_reports'}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'call', 'children': ['80', '85']}; {'id': '80', 'type': 'attribute', 'children': ['81', '84']}; {'id': '81', 'type': 'attribute', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': '_processing_status'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'UpdateEventsStatus'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': '_events_status'}
Update the foreman process status.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'workers_status'}; {'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': 'list_comprehension', 'children': ['8', '13']}; {'id': '8', 'type': 'subscript', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_workers_status'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '13', 'type': 'for_in_clause', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'identifier'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '24']}; {'id': '19', 'type': 'attribute', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_workers_status'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '24', 'type': 'argument_list', 'children': []}
The worker status objects sorted by identifier.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_state'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'best_hyp_indices'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'attribute', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'mx'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'nd'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'NDArray'}; {'id': '13', 'type': 'block', 'children': ['14']}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'states'}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '29']}; {'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': 'mx'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'nd'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'take'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ds'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'best_hyp_indices'}; {'id': '29', 'type': 'for_in_clause', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ds'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'states'}
Sorts states according to k-best order from last step in beam search.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_filetype_items'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '25']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'processed_types'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'file_type_items'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'deque'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '24']}; {'id': '17', 'type': 'attribute', 'children': ['18', '23']}; {'id': '18', 'type': 'subscript', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '22', 'type': 'string', 'children': [], 'value': "'file_types'"}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'while_statement', 'children': ['26', '30']}; {'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': 'file_type_items'}; {'id': '30', 'type': 'block', 'children': ['31', '41', '50', '80', '87']}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '36']}; {'id': '33', 'type': 'pattern_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'filetype_info'}; {'id': '36', 'type': 'call', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'file_type_items'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'popleft'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'requirements'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'filetype_info'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'requires'"}; {'id': '50', 'type': 'if_statement', 'children': ['51', '54']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': 'is'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'requirements'}; {'id': '53', 'type': 'None', 'children': []}; {'id': '54', 'type': 'block', 'children': ['55', '67']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '58', 'type': 'list_comprehension', 'children': ['59', '60', '63']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '60', 'type': 'for_in_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'requirements'}; {'id': '63', 'type': 'if_clause', 'children': ['64']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '66'], 'value': 'not'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'req'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'processed_types'}; {'id': '67', 'type': 'if_statement', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'missing'}; {'id': '69', 'type': 'block', 'children': ['70', '79']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '75']}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'file_type_items'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'tuple', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'filetype_info'}; {'id': '79', 'type': 'continue_statement', 'children': []}; {'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': 'processed_types'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'yield', 'children': ['89']}; {'id': '89', 'type': 'expression_list', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'filetype'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'filetype_info'}
Sort the instance's filetypes in using order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'combine_hashes'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'hashes'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '33']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'hasher'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sha1'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'for_statement', 'children': ['13', '14', '18']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '14', 'type': 'call', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'hashes'}; {'id': '18', 'type': 'block', 'children': ['19', '26']}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'ensure_binary'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'hasher'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'update'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'h'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'conditional_expression', 'children': ['35', '40', '41'], 'value': 'if'}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'hasher'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'hexdigest'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'PY3'}; {'id': '41', 'type': 'call', 'children': ['42', '49']}; {'id': '42', 'type': 'attribute', 'children': ['43', '48']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'hasher'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'hexdigest'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'decode'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'utf-8'"}
A simple helper function to combine other hashes. Sorts the hashes before rolling them in.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_available_urls'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '6', 'type': 'block', 'children': ['7', '22', '40', '69', '84', '102', '116']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'baseurl_to_urls'}; {'id': '10', 'type': 'dictionary_comprehension', 'children': ['11', '19']}; {'id': '11', 'type': 'pair', 'children': ['12', '18']}; {'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': '_baseurl'}; {'id': '16', 'type': 'argument_list', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'url'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'urls'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'pingtimes'}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': '_pinger'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'pings'}; {'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': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'baseurl_to_urls'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '47']}; {'id': '42', 'type': 'attribute', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_log'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'call', 'children': ['49', '52']}; {'id': '49', 'type': 'attribute', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'Artifact cache server ping times: {}'"}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'list_comprehension', 'children': ['59', '66']}; {'id': '59', 'type': 'call', 'children': ['60', '63']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'string', 'children': [], 'value': "'{}: {:.6f} secs'"}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '63', 'type': 'argument_list', 'children': ['64']}; {'id': '64', 'type': 'list_splat', 'children': ['65']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '66', 'type': 'for_in_clause', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'pingtimes'}; {'id': '69', 'type': 'expression_statement', 'children': ['70']}; {'id': '70', 'type': 'assignment', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sorted_pingtimes'}; {'id': '72', 'type': 'call', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'pingtimes'}; {'id': '76', 'type': 'keyword_argument', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '78', 'type': 'lambda', 'children': ['79', '81']}; {'id': '79', 'type': 'lambda_parameters', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '83', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'available_urls'}; {'id': '87', 'type': 'list_comprehension', 'children': ['88', '91', '96']}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'baseurl_to_urls'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'baseurl'}; {'id': '91', 'type': 'for_in_clause', 'children': ['92', '95']}; {'id': '92', 'type': 'pattern_list', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'baseurl'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'pingtime'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'sorted_pingtimes'}; {'id': '96', 'type': 'if_clause', 'children': ['97']}; {'id': '97', 'type': 'comparison_operator', 'children': ['98', '99'], 'value': '<'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'pingtime'}; {'id': '99', 'type': 'attribute', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'Pinger'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'UNREACHABLE'}; {'id': '102', 'type': 'expression_statement', 'children': ['103']}; {'id': '103', 'type': 'call', 'children': ['104', '109']}; {'id': '104', 'type': 'attribute', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': '_log'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'call', 'children': ['111', '114']}; {'id': '111', 'type': 'attribute', 'children': ['112', '113']}; {'id': '112', 'type': 'string', 'children': [], 'value': "'Available cache servers: {0}'"}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '114', 'type': 'argument_list', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'available_urls'}; {'id': '116', 'type': 'return_statement', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'available_urls'}
Return reachable urls sorted by their ping times.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_topological_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'id': '6', 'type': 'block', 'children': ['7', '14']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'target_set'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'list_comprehension', 'children': ['16', '17', '26']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '17', 'type': 'for_in_clause', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'reversed'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sort_targets'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'id': '26', 'type': 'if_clause', 'children': ['27']}; {'id': '27', 'type': 'comparison_operator', 'children': ['28', '29'], 'value': 'in'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 't'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'target_set'}
Topologically order a list of targets
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortmerna_detailed_barplot'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '18', '53', '72', '85']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '11', 'type': 'argument_list', 'children': []}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'metrics'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'for_statement', 'children': ['19', '20', '23']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sortmerna'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'for_statement', 'children': ['25', '26', '31']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '26', 'type': 'subscript', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'sortmerna'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sample'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '45']}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '41'], 'value': 'and'}; {'id': '34', 'type': 'not_operator', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': 'in'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '37', 'type': 'list', 'children': ['38', '39', '40'], 'value': '["total", "rRNA", "non_rRNA"]'}; {'id': '38', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '39', 'type': 'string', 'children': [], 'value': '"rRNA"'}; {'id': '40', 'type': 'string', 'children': [], 'value': '"non_rRNA"'}; {'id': '41', 'type': 'not_operator', 'children': ['42']}; {'id': '42', 'type': 'comparison_operator', 'children': ['43', '44'], 'value': 'in'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"_pct"'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '45', 'type': 'block', 'children': ['46']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'metrics'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '53', 'type': 'for_statement', 'children': ['54', '55', '56']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'metrics'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '62']}; {'id': '59', 'type': 'subscript', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '62', 'type': 'dictionary', 'children': ['63']}; {'id': '63', 'type': 'pair', 'children': ['64', '65']}; {'id': '64', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '65', 'type': 'call', 'children': ['66', '69']}; {'id': '66', 'type': 'attribute', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'replace'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '71']}; {'id': '70', 'type': 'string', 'children': [], 'value': '"_count"'}; {'id': '71', 'type': 'string', 'children': [], 'value': '""'}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'pconfig'}; {'id': '75', 'type': 'dictionary', 'children': ['76', '79', '82']}; {'id': '76', 'type': 'pair', 'children': ['77', '78']}; {'id': '77', 'type': 'string', 'children': [], 'value': "'id'"}; {'id': '78', 'type': 'string', 'children': [], 'value': "'sortmerna-detailed-plot'"}; {'id': '79', 'type': 'pair', 'children': ['80', '81']}; {'id': '80', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '81', 'type': 'string', 'children': [], 'value': "'SortMeRNA: Hit Counts'"}; {'id': '82', 'type': 'pair', 'children': ['83', '84']}; {'id': '83', 'type': 'string', 'children': [], 'value': "'ylab'"}; {'id': '84', 'type': 'string', 'children': [], 'value': "'Reads'"}; {'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': 'self'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'add_section'}; {'id': '90', 'type': 'argument_list', 'children': ['91']}; {'id': '91', 'type': 'keyword_argument', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'plot'}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'bargraph'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'plot'}; {'id': '97', 'type': 'argument_list', 'children': ['98', '101', '102']}; {'id': '98', 'type': 'attribute', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'sortmerna'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'pconfig'}
Make the HighCharts HTML to plot the sortmerna rates
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'deepvalues'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'mapping'}; {'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': 'values'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'vals_sorted_by_key'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'mapping'}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '16']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '16', 'type': 'block', 'children': ['17', '21', '47']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'mapping'}; {'id': '20', 'type': 'False', 'children': []}; {'id': '21', 'type': 'try_statement', 'children': ['22', '27', '31']}; {'id': '22', 'type': 'block', 'children': ['23']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '27', 'type': 'except_clause', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'AttributeError'}; {'id': '29', 'type': 'block', 'children': ['30']}; {'id': '30', 'type': 'pass_statement', 'children': []}; {'id': '31', 'type': 'else_clause', 'children': ['32']}; {'id': '32', 'type': 'block', 'children': ['33', '37']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'mapping'}; {'id': '36', 'type': 'True', 'children': []}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '43']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'subobj'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'deepvalues'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'obj'}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'yield', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'subobj'}; {'id': '47', 'type': 'if_statement', 'children': ['48', '50']}; {'id': '48', 'type': 'not_operator', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'mapping'}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'yield', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'obj'}
Iterates over nested mapping, depth-first, in sorted order by key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '23', '29', '35', '43', '54']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'filehandle'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'in_file'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'r'"}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'filehandle'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'readlines'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'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': 'filehandle'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'expression_statement', 'children': ['36']}; {'id': '36', 'type': 'assignment', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'filehandle'}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '40', 'type': 'argument_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'out_file'}; {'id': '42', 'type': 'string', 'children': [], 'value': "'w'"}; {'id': '43', 'type': 'for_statement', 'children': ['44', '45', '46']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'lines'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'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': 'filehandle'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'line'}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'filehandle'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'close'}; {'id': '59', 'type': 'argument_list', 'children': []}
Sorts the given file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'merge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'filehandle_1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'filehandle_2'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'output_filehandle'}; {'id': '7', 'type': 'block', 'children': ['8', '16', '55']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'filehandle_2'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'readline'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'for_statement', 'children': ['17', '18', '23']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'line1'}; {'id': '18', 'type': 'call', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'filehandle_1'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'readlines'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'block', 'children': ['24', '48']}; {'id': '24', 'type': 'while_statement', 'children': ['25', '32']}; {'id': '25', 'type': 'boolean_operator', 'children': ['26', '29'], 'value': 'and'}; {'id': '26', 'type': 'comparison_operator', 'children': ['27', '28'], 'value': '!='}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '28', 'type': 'string', 'children': [], 'value': "''"}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': '<='}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'line1'}; {'id': '32', 'type': 'block', 'children': ['33', '40']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'output_filehandle'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'filehandle_2'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'readline'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'output_filehandle'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'line1'}; {'id': '55', 'type': 'while_statement', 'children': ['56', '59']}; {'id': '56', 'type': 'comparison_operator', 'children': ['57', '58'], 'value': '!='}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '58', 'type': 'string', 'children': [], 'value': "''"}; {'id': '59', 'type': 'block', 'children': ['60', '67']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'output_filehandle'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'write'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '67', 'type': 'expression_statement', 'children': ['68']}; {'id': '68', 'type': 'assignment', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'line2'}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'filehandle_2'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'readline'}; {'id': '74', 'type': 'argument_list', 'children': []}
Merges together two files maintaining sorted order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'decorateSubHeader'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '7', 'type': 'block', 'children': ['8', '16']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '15', 'type': 'argument_list', 'children': []}; {'id': '16', 'type': 'if_statement', 'children': ['17', '22', '71']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': '!='}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '22', 'type': 'block', 'children': ['23', '69']}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'assignment', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '28'], 'value': '%'}; {'id': '27', 'type': 'string', 'children': [], 'value': '"| %*s%*s%*s%*s%*s "'}; {'id': '28', 'type': 'tuple', 'children': ['29', '36', '37', '44', '45', '52', '53', '60', '61', '68']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '35', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '36', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '41', 'type': 'argument_list', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"med"'}; {'id': '44', 'type': 'string', 'children': [], 'value': '"med"'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '51', 'type': 'string', 'children': [], 'value': '"ave"'}; {'id': '52', 'type': 'string', 'children': [], 'value': '"ave"'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '59', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '60', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '67', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '68', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '69', 'type': 'return_statement', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '71', 'type': 'else_clause', 'children': ['72']}; {'id': '72', 'type': 'block', 'children': ['73', '77', '155', '159']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '76', 'type': 'string', 'children': [], 'value': '"| "'}; {'id': '77', 'type': 'for_statement', 'children': ['78', '81', '127']}; {'id': '78', 'type': 'pattern_list', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '81', 'type': 'list', 'children': ['82', '91', '100', '109', '118'], 'value': '[("min", columnWidths.getWidth(title, "min")),\n ("med", columnWidths.getWidth(title, "med")),\n ("ave", columnWidths.getWidth(title, "ave")),\n ("max", columnWidths.getWidth(title, "max")),\n ("total", columnWidths.getWidth(title, "total"))]'}; {'id': '82', 'type': 'tuple', 'children': ['83', '84']}; {'id': '83', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '84', 'type': 'call', 'children': ['85', '88']}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '90', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '91', 'type': 'tuple', 'children': ['92', '93']}; {'id': '92', 'type': 'string', 'children': [], 'value': '"med"'}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '97', 'type': 'argument_list', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '99', 'type': 'string', 'children': [], 'value': '"med"'}; {'id': '100', 'type': 'tuple', 'children': ['101', '102']}; {'id': '101', 'type': 'string', 'children': [], 'value': '"ave"'}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '106', 'type': 'argument_list', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '108', 'type': 'string', 'children': [], 'value': '"ave"'}; {'id': '109', 'type': 'tuple', 'children': ['110', '111']}; {'id': '110', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '111', 'type': 'call', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '115', 'type': 'argument_list', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '117', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '118', 'type': 'tuple', 'children': ['119', '120']}; {'id': '119', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '120', 'type': 'call', 'children': ['121', '124']}; {'id': '121', 'type': 'attribute', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'columnWidths'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'getWidth'}; {'id': '124', 'type': 'argument_list', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'title'}; {'id': '126', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '127', 'type': 'block', 'children': ['128']}; {'id': '128', 'type': 'if_statement', 'children': ['129', '134', '145']}; {'id': '129', 'type': 'comparison_operator', 'children': ['130', '133'], 'value': '=='}; {'id': '130', 'type': 'attribute', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'sortField'}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '134', 'type': 'block', 'children': ['135']}; {'id': '135', 'type': 'expression_statement', 'children': ['136']}; {'id': '136', 'type': 'augmented_assignment', 'children': ['137', '138'], 'value': '+='}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '138', 'type': 'binary_operator', 'children': ['139', '140'], 'value': '%'}; {'id': '139', 'type': 'string', 'children': [], 'value': '"%*s*"'}; {'id': '140', 'type': 'tuple', 'children': ['141', '144']}; {'id': '141', 'type': 'binary_operator', 'children': ['142', '143'], 'value': '-'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '143', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '145', 'type': 'else_clause', 'children': ['146']}; {'id': '146', 'type': 'block', 'children': ['147']}; {'id': '147', 'type': 'expression_statement', 'children': ['148']}; {'id': '148', 'type': 'augmented_assignment', 'children': ['149', '150'], 'value': '+='}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '150', 'type': 'binary_operator', 'children': ['151', '152'], 'value': '%'}; {'id': '151', 'type': 'string', 'children': [], 'value': '"%*s"'}; {'id': '152', 'type': 'tuple', 'children': ['153', '154']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'width'}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'field'}; {'id': '155', 'type': 'expression_statement', 'children': ['156']}; {'id': '156', 'type': 'augmented_assignment', 'children': ['157', '158'], 'value': '+='}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '158', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '159', 'type': 'return_statement', 'children': ['160']}; {'id': '160', 'type': 'identifier', 'children': [], 'value': 's'}
Add a marker to the correct field if the TITLE is sorted on.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortJobs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'jobTypes'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '6', 'type': 'block', 'children': ['7', '26', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'longforms'}; {'id': '10', 'type': 'dictionary', 'children': ['11', '14', '17', '20', '23']}; {'id': '11', 'type': 'pair', 'children': ['12', '13']}; {'id': '12', 'type': 'string', 'children': [], 'value': '"med"'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"median"'}; {'id': '14', 'type': 'pair', 'children': ['15', '16']}; {'id': '15', 'type': 'string', 'children': [], 'value': '"ave"'}; {'id': '16', 'type': 'string', 'children': [], 'value': '"average"'}; {'id': '17', 'type': 'pair', 'children': ['18', '19']}; {'id': '18', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '19', 'type': 'string', 'children': [], 'value': '"min"'}; {'id': '20', 'type': 'pair', 'children': ['21', '22']}; {'id': '21', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '22', 'type': 'string', 'children': [], 'value': '"total"'}; {'id': '23', 'type': 'pair', 'children': ['24', '25']}; {'id': '24', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '25', 'type': 'string', 'children': [], 'value': '"max"'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sortField'}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'longforms'}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sortField'}; {'id': '34', 'type': 'if_statement', 'children': ['35', '59', '86', '111']}; {'id': '35', 'type': '()', 'children': ['36']}; {'id': '36', 'type': 'boolean_operator', 'children': ['37', '54'], 'value': 'or'}; {'id': '37', 'type': 'boolean_operator', 'children': ['38', '49'], 'value': 'or'}; {'id': '38', 'type': 'boolean_operator', 'children': ['39', '44'], 'value': 'or'}; {'id': '39', 'type': 'comparison_operator', 'children': ['40', '43'], 'value': '=='}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '43', 'type': 'string', 'children': [], 'value': '"time"'}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '48'], 'value': '=='}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '48', 'type': 'string', 'children': [], 'value': '"clock"'}; {'id': '49', 'type': 'comparison_operator', 'children': ['50', '53'], 'value': '=='}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '53', 'type': 'string', 'children': [], 'value': '"wait"'}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '58'], 'value': '=='}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '58', 'type': 'string', 'children': [], 'value': '"memory"'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65', '81']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'jobTypes'}; {'id': '65', 'type': 'keyword_argument', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '67', 'type': 'lambda', 'children': ['68', '70']}; {'id': '68', 'type': 'lambda_parameters', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '74', 'type': 'binary_operator', 'children': ['75', '76'], 'value': '%'}; {'id': '75', 'type': 'string', 'children': [], 'value': '"%s_%s"'}; {'id': '76', 'type': 'tuple', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'sortField'}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '81', 'type': 'keyword_argument', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'sortReverse'}; {'id': '86', 'type': 'elif_clause', 'children': ['87', '92']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '91'], 'value': '=='}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '91', 'type': 'string', 'children': [], 'value': '"alpha"'}; {'id': '92', 'type': 'block', 'children': ['93']}; {'id': '93', 'type': 'return_statement', 'children': ['94']}; {'id': '94', 'type': 'call', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '96', 'type': 'argument_list', 'children': ['97', '98', '106']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'jobTypes'}; {'id': '98', 'type': 'keyword_argument', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '100', 'type': 'lambda', 'children': ['101', '103']}; {'id': '101', 'type': 'lambda_parameters', 'children': ['102']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '106', 'type': 'keyword_argument', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'sortReverse'}; {'id': '111', 'type': 'elif_clause', 'children': ['112', '117']}; {'id': '112', 'type': 'comparison_operator', 'children': ['113', '116'], 'value': '=='}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'sortCategory'}; {'id': '116', 'type': 'string', 'children': [], 'value': '"count"'}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'return_statement', 'children': ['119']}; {'id': '119', 'type': 'call', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '121', 'type': 'argument_list', 'children': ['122', '123', '131']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'jobTypes'}; {'id': '123', 'type': 'keyword_argument', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '125', 'type': 'lambda', 'children': ['126', '128']}; {'id': '126', 'type': 'lambda_parameters', 'children': ['127']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '128', 'type': 'attribute', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'tag'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'total_number'}; {'id': '131', 'type': 'keyword_argument', 'children': ['132', '133']}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '133', 'type': 'attribute', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'options'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'sortReverse'}
Return a jobTypes all sorted.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_deffacts'}; {'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': 'sorted'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '16']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_get_by_type'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'DefFacts'}; {'id': '16', 'type': 'keyword_argument', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '18', 'type': 'lambda', 'children': ['19', '21']}; {'id': '19', 'type': 'lambda_parameters', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'order'}
Return the existing deffacts sorted by the internal order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'to_json'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '14']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'sets'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sets'}; {'id': '13', 'type': 'argument_list', 'children': []}; {'id': '14', 'type': 'return_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '17', 'type': 'generator_expression', 'children': ['18', '22']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '22', 'type': 'for_in_clause', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sets'}
Returns the equivalence classes a sorted list of sorted lists.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'reload'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '14', '20']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'Generate histrow for each row and then reverse-sort by length.'"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'rows'}; {'id': '13', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'discreteBinning'}; {'id': '19', 'type': 'argument_list', 'children': []}; {'id': '20', 'type': 'for_statement', 'children': ['21', '22', '25']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'nonKeyVisibleCols'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_cachedValues'}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'collections'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '35', 'type': 'argument_list', 'children': []}
Generate histrow for each row and then reverse-sort by length.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_write_contribs'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'type', 'children': ['5']}; {'id': '5', 'type': 'None', 'children': []}; {'id': '6', 'type': 'block', 'children': ['7', '11', '40', '47', '70', '77', '88', '95']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'map_file_auth'}; {'id': '10', 'type': 'dictionary', 'children': []}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '17']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'scantree'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'string', 'children': [], 'value': "'cltk'"}; {'id': '17', 'type': 'block', 'children': ['18', '24', '31']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'authors_list'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'get_authors'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'authors_list'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'map_file_auth'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'filepath'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'authors_list'}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'defaultdict'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '47', 'type': 'for_statement', 'children': ['48', '51', '56']}; {'id': '48', 'type': 'pattern_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'authors_file'}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'map_file_auth'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'for_statement', 'children': ['58', '59', '60']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'authors_file'}; {'id': '60', 'type': 'block', 'children': ['61']}; {'id': '61', 'type': 'expression_statement', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '68']}; {'id': '63', 'type': 'attribute', 'children': ['64', '67']}; {'id': '64', 'type': 'subscript', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'author'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '68', 'type': 'argument_list', 'children': ['69']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'file'}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'assignment', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'sort_def_dict'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'assignment', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'map_auth_file_sorted'}; {'id': '80', 'type': 'call', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '82', 'type': 'argument_list', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '87']}; {'id': '84', 'type': 'attribute', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '87', 'type': 'argument_list', 'children': []}; {'id': '88', 'type': 'expression_statement', 'children': ['89']}; {'id': '89', 'type': 'assignment', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}; {'id': '91', 'type': 'call', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '93', 'type': 'argument_list', 'children': ['94']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'map_auth_file_sorted'}; {'id': '95', 'type': 'expression_statement', 'children': ['96']}; {'id': '96', 'type': 'call', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'write_contribs'}; {'id': '98', 'type': 'argument_list', 'children': ['99']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'map_auth_file'}
Look for files, find authors, sort, write file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'find_files'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'folder'}; {'id': '5', 'type': 'block', 'children': ['6', '26', '32', '71', '87']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '11', '19']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '11', 'type': 'for_in_clause', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'listdir'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'folder'}; {'id': '19', 'type': 'if_clause', 'children': ['20']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'string', 'children': [], 'value': '"left"'}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'for_statement', 'children': ['33', '34', '41']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '41', 'type': 'block', 'children': ['42', '59']}; {'id': '42', 'type': 'expression_statement', 'children': ['43']}; {'id': '43', 'type': 'assignment', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'insert_string'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': '"right{}"'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'subscript', 'children': ['51', '56']}; {'id': '51', 'type': 'subscript', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '*'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '55', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '56', 'type': 'slice', 'children': ['57', '58']}; {'id': '57', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '58', 'type': 'colon', 'children': []}; {'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': 'files'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '64', 'type': 'argument_list', 'children': ['65', '70']}; {'id': '65', 'type': 'binary_operator', 'children': ['66', '69'], 'value': '+'}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '*'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '69', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'insert_string'}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '74', 'type': 'list_comprehension', 'children': ['75', '84']}; {'id': '75', 'type': 'call', 'children': ['76', '81']}; {'id': '76', 'type': 'attribute', 'children': ['77', '80']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '81', 'type': 'argument_list', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'folder'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '84', 'type': 'for_in_clause', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '87', 'type': 'return_statement', 'children': ['88']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'files'}
Discover stereo photos and return them as a pairwise sorted list.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'cdx_sort_closest'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'closest'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'cdx_iter'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '8', 'type': 'integer', 'children': [], 'value': '10'}; {'id': '9', 'type': 'block', 'children': ['10', '14', '18', '25', '104']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '13', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'closest_keys'}; {'id': '17', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'closest_sec'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'timestamp_to_sec'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'closest'}; {'id': '25', 'type': 'for_statement', 'children': ['26', '27', '28']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cdx'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'cdx_iter'}; {'id': '28', 'type': 'block', 'children': ['29', '38', '47', '57', '65', '73', '90']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sec'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'timestamp_to_sec'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'subscript', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'cdx'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'TIMESTAMP'}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'abs'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'binary_operator', 'children': ['45', '46'], 'value': '-'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'closest_sec'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'sec'}; {'id': '47', 'type': 'expression_statement', 'children': ['48']}; {'id': '48', 'type': 'assignment', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'bisect'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'bisect_right'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'closest_keys'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': 'closest_keys'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'insert'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'cdx'}; {'id': '73', 'type': 'if_statement', 'children': ['74', '80']}; {'id': '74', 'type': 'comparison_operator', 'children': ['75', '79'], 'value': '=='}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '80', 'type': 'block', 'children': ['81']}; {'id': '81', 'type': 'if_statement', 'children': ['82', '88']}; {'id': '82', 'type': 'comparison_operator', 'children': ['83', '84'], 'value': '>'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'closest_keys'}; {'id': '86', 'type': 'unary_operator', 'children': ['87'], 'value': '-'}; {'id': '87', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '88', 'type': 'block', 'children': ['89']}; {'id': '89', 'type': 'break_statement', 'children': []}; {'id': '90', 'type': 'if_statement', 'children': ['91', '97']}; {'id': '91', 'type': 'comparison_operator', 'children': ['92', '96'], 'value': '>'}; {'id': '92', 'type': 'call', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '103', 'type': 'argument_list', 'children': []}; {'id': '104', 'type': 'for_statement', 'children': ['105', '106', '107']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'cdx'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'closest_cdx'}; {'id': '107', 'type': 'block', 'children': ['108']}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'yield', 'children': ['110']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'cdx'}
sort CDXCaptureResult by closest to timestamp.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_single_reference'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'ref_entry'}; {'id': '5', 'type': 'block', 'children': ['6', '29', '53']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': '_keyorder'}; {'id': '9', 'type': 'list', 'children': ['10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'], 'value': "[\n 'schema_type', 'schema_version',\n 'type',\n 'authors', 'title', 'booktitle', 'series', 'editors', 'journal',\n 'institution', 'volume', 'number', 'page', 'year', 'note', 'publisher',\n 'address', 'isbn', 'doi'\n ]"}; {'id': '10', 'type': 'string', 'children': [], 'value': "'schema_type'"}; {'id': '11', 'type': 'string', 'children': [], 'value': "'schema_version'"}; {'id': '12', 'type': 'string', 'children': [], 'value': "'type'"}; {'id': '13', 'type': 'string', 'children': [], 'value': "'authors'"}; {'id': '14', 'type': 'string', 'children': [], 'value': "'title'"}; {'id': '15', 'type': 'string', 'children': [], 'value': "'booktitle'"}; {'id': '16', 'type': 'string', 'children': [], 'value': "'series'"}; {'id': '17', 'type': 'string', 'children': [], 'value': "'editors'"}; {'id': '18', 'type': 'string', 'children': [], 'value': "'journal'"}; {'id': '19', 'type': 'string', 'children': [], 'value': "'institution'"}; {'id': '20', 'type': 'string', 'children': [], 'value': "'volume'"}; {'id': '21', 'type': 'string', 'children': [], 'value': "'number'"}; {'id': '22', 'type': 'string', 'children': [], 'value': "'page'"}; {'id': '23', 'type': 'string', 'children': [], 'value': "'year'"}; {'id': '24', 'type': 'string', 'children': [], 'value': "'note'"}; {'id': '25', 'type': 'string', 'children': [], 'value': "'publisher'"}; {'id': '26', 'type': 'string', 'children': [], 'value': "'address'"}; {'id': '27', 'type': 'string', 'children': [], 'value': "'isbn'"}; {'id': '28', 'type': 'string', 'children': [], 'value': "'doi'"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'sorted_entry'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '34', 'type': 'argument_list', 'children': ['35', '40']}; {'id': '35', 'type': 'call', 'children': ['36', '39']}; {'id': '36', 'type': 'attribute', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'ref_entry'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '39', 'type': 'argument_list', 'children': []}; {'id': '40', 'type': 'keyword_argument', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '42', 'type': 'lambda', 'children': ['43', '45']}; {'id': '43', 'type': 'lambda_parameters', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': '_keyorder'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '53', 'type': 'if_statement', 'children': ['54', '55', '61']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': '_use_odict'}; {'id': '55', 'type': 'block', 'children': ['56']}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'sorted_entry'}; {'id': '61', 'type': 'else_clause', 'children': ['62']}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'return_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '66', 'type': 'argument_list', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'sorted_entry'}
Sorts a dictionary containing data for a single reference into a standard order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_merge_sorted_items'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '6', 'type': 'block', 'children': ['7', '63', '79', '144']}; {'id': '7', 'type': 'function_definition', 'children': ['8', '9', '11']}; {'id': '8', 'type': 'function_name', 'children': [], 'value': 'load_partition'}; {'id': '9', 'type': 'parameters', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '11', 'type': 'block', 'children': ['12', '21', '36']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': '_get_spill_dir'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'p'}; {'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': 'join'}; {'id': '30', 'type': 'argument_list', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '32', 'type': 'call', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '34', 'type': 'argument_list', 'children': ['35']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '36', 'type': 'with_statement', 'children': ['37', '48']}; {'id': '37', 'type': 'with_clause', 'children': ['38']}; {'id': '38', 'type': 'with_item', 'children': ['39']}; {'id': '39', 'type': 'as_pattern', 'children': ['40', '46']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'open'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '44', '45']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '44', 'type': 'string', 'children': [], 'value': "'rb'"}; {'id': '45', 'type': 'integer', 'children': [], 'value': '65536'}; {'id': '46', 'type': 'as_pattern_target', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '48', 'type': 'block', 'children': ['49']}; {'id': '49', 'type': 'for_statement', 'children': ['50', '51', '59']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '51', 'type': 'call', 'children': ['52', '57']}; {'id': '52', 'type': 'attribute', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'serializer'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'load_stream'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '59', 'type': 'block', 'children': ['60']}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'yield', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'disk_items'}; {'id': '66', 'type': 'list_comprehension', 'children': ['67', '71']}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'load_partition'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '71', 'type': 'for_in_clause', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'j'}; {'id': '73', 'type': 'call', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '75', 'type': 'argument_list', 'children': ['76']}; {'id': '76', 'type': 'attribute', 'children': ['77', '78']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'spills'}; {'id': '79', 'type': 'if_statement', 'children': ['80', '83', '101']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': '_sorted'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '87', 'type': 'call', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'heapq'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'merge'}; {'id': '91', 'type': 'argument_list', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'disk_items'}; {'id': '93', 'type': 'keyword_argument', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '95', 'type': 'call', 'children': ['96', '99']}; {'id': '96', 'type': 'attribute', 'children': ['97', '98']}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '101', 'type': 'else_clause', 'children': ['102']}; {'id': '102', 'type': 'block', 'children': ['103', '111', '121']}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'assignment', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'ser'}; {'id': '106', 'type': 'call', 'children': ['107', '110']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'flattened_serializer'}; {'id': '110', 'type': 'argument_list', 'children': []}; {'id': '111', 'type': 'expression_statement', 'children': ['112']}; {'id': '112', 'type': 'assignment', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'sorter'}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'ExternalSorter'}; {'id': '116', 'type': 'argument_list', 'children': ['117', '120']}; {'id': '117', 'type': 'attribute', 'children': ['118', '119']}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'memory_limit'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'ser'}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'assignment', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}; {'id': '124', 'type': 'call', 'children': ['125', '128']}; {'id': '125', 'type': 'attribute', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'sorter'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '128', 'type': 'argument_list', 'children': ['129', '136']}; {'id': '129', 'type': 'call', 'children': ['130', '133']}; {'id': '130', 'type': 'attribute', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'itertools'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'chain'}; {'id': '133', 'type': 'argument_list', 'children': ['134']}; {'id': '134', 'type': 'list_splat', 'children': ['135']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'disk_items'}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '142', 'type': 'argument_list', 'children': ['143']}; {'id': '143', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '144', 'type': 'return_statement', 'children': ['145']}; {'id': '145', 'type': 'generator_expression', 'children': ['146', '149']}; {'id': '146', 'type': 'tuple', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '148', 'type': 'identifier', 'children': [], 'value': 'vs'}; {'id': '149', 'type': 'for_in_clause', 'children': ['150', '153']}; {'id': '150', 'type': 'pattern_list', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '152', 'type': 'identifier', 'children': [], 'value': 'vs'}; {'id': '153', 'type': 'call', 'children': ['154', '155']}; {'id': '154', 'type': 'identifier', 'children': [], 'value': 'GroupByKey'}; {'id': '155', 'type': 'argument_list', 'children': ['156']}; {'id': '156', 'type': 'identifier', 'children': [], 'value': 'sorted_items'}
load a partition from disk, then sort and group by key
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_cols'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '39', '50', '60', '125']}; {'id': '8', 'type': 'if_statement', 'children': ['9', '11']}; {'id': '9', 'type': 'not_operator', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'raise_statement', 'children': ['13']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'string', 'children': [], 'value': '"should sort by at least one column"'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '32']}; {'id': '18', 'type': 'boolean_operator', 'children': ['19', '25'], 'value': 'and'}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '24'], 'value': '=='}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '24', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '31']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'list'}; {'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': 'cols'}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'assignment', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'jcols'}; {'id': '42', 'type': 'list_comprehension', 'children': ['43', '47']}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_to_java_column'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '47', 'type': 'for_in_clause', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'cols'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': "'ascending'"}; {'id': '59', 'type': 'True', 'children': []}; {'id': '60', 'type': 'if_statement', 'children': ['61', '68', '85', '113']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '65', 'type': 'tuple', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '68', 'type': 'block', 'children': ['69']}; {'id': '69', 'type': 'if_statement', 'children': ['70', '72']}; {'id': '70', 'type': 'not_operator', 'children': ['71']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '72', 'type': 'block', 'children': ['73']}; {'id': '73', 'type': 'expression_statement', 'children': ['74']}; {'id': '74', 'type': 'assignment', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'jcols'}; {'id': '76', 'type': 'list_comprehension', 'children': ['77', '82']}; {'id': '77', 'type': 'call', 'children': ['78', '81']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'jc'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '81', 'type': 'argument_list', 'children': []}; {'id': '82', 'type': 'for_in_clause', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'jc'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'jcols'}; {'id': '85', 'type': 'elif_clause', 'children': ['86', '91']}; {'id': '86', 'type': 'call', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '88', 'type': 'argument_list', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '91', 'type': 'block', 'children': ['92']}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'assignment', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'jcols'}; {'id': '95', 'type': 'list_comprehension', 'children': ['96', '104']}; {'id': '96', 'type': 'conditional_expression', 'children': ['97', '98', '99'], 'value': 'if'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'jc'}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'asc'}; {'id': '99', 'type': 'call', 'children': ['100', '103']}; {'id': '100', 'type': 'attribute', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'jc'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '103', 'type': 'argument_list', 'children': []}; {'id': '104', 'type': 'for_in_clause', 'children': ['105', '108']}; {'id': '105', 'type': 'pattern_list', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'asc'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'jc'}; {'id': '108', 'type': 'call', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '110', 'type': 'argument_list', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'jcols'}; {'id': '113', 'type': 'else_clause', 'children': ['114']}; {'id': '114', 'type': 'block', 'children': ['115']}; {'id': '115', 'type': 'raise_statement', 'children': ['116']}; {'id': '116', 'type': 'call', 'children': ['117', '118']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'TypeError'}; {'id': '118', 'type': 'argument_list', 'children': ['119']}; {'id': '119', 'type': 'binary_operator', 'children': ['120', '121'], 'value': '%'}; {'id': '120', 'type': 'string', 'children': [], 'value': '"ascending can only be boolean or list, but got %s"'}; {'id': '121', 'type': 'call', 'children': ['122', '123']}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '123', 'type': 'argument_list', 'children': ['124']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '125', 'type': 'return_statement', 'children': ['126']}; {'id': '126', 'type': 'call', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': '_jseq'}; {'id': '130', 'type': 'argument_list', 'children': ['131']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'jcols'}
Return a JVM Seq of Columns that describes the sort order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_values'}; {'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': 'return_indexer'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '10', 'type': 'True', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'if_statement', 'children': ['13', '14', '50']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'return_indexer'}; {'id': '14', 'type': 'block', 'children': ['15', '23', '37', '46']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '_as'}; {'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': 'argsort'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'if_statement', 'children': ['24', '26']}; {'id': '24', 'type': 'not_operator', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'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': '_as'}; {'id': '30', 'type': 'subscript', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': '_as'}; {'id': '32', 'type': 'slice', 'children': ['33', '34', '35']}; {'id': '33', 'type': 'colon', 'children': []}; {'id': '34', 'type': 'colon', 'children': []}; {'id': '35', 'type': 'unary_operator', 'children': ['36'], 'value': '-'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sorted_index'}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'take'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': '_as'}; {'id': '46', 'type': 'return_statement', 'children': ['47']}; {'id': '47', 'type': 'expression_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'sorted_index'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_as'}; {'id': '50', 'type': 'else_clause', 'children': ['51']}; {'id': '51', 'type': 'block', 'children': ['52', '63', '71', '77', '121', '127', '141']}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sorted_values'}; {'id': '55', 'type': 'call', 'children': ['56', '59']}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'np'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'attribute', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': '_ndarray_values'}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'attribs'}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': '_get_attributes_dict'}; {'id': '70', 'type': 'argument_list', 'children': []}; {'id': '71', 'type': 'expression_statement', 'children': ['72']}; {'id': '72', 'type': 'assignment', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'attribs'}; {'id': '76', 'type': 'string', 'children': [], 'value': "'freq'"}; {'id': '77', 'type': 'if_statement', 'children': ['78', '87']}; {'id': '78', 'type': 'boolean_operator', 'children': ['79', '82'], 'value': 'and'}; {'id': '79', 'type': 'comparison_operator', 'children': ['80', '81'], 'value': 'is'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '81', 'type': 'None', 'children': []}; {'id': '82', 'type': 'not_operator', 'children': ['83']}; {'id': '83', 'type': 'call', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'is_period_dtype'}; {'id': '85', 'type': 'argument_list', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '87', 'type': 'block', 'children': ['88']}; {'id': '88', 'type': 'if_statement', 'children': ['89', '97', '105']}; {'id': '89', 'type': 'boolean_operator', 'children': ['90', '95'], 'value': 'and'}; {'id': '90', 'type': 'comparison_operator', 'children': ['91', '94'], 'value': '>'}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '94', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '95', 'type': 'not_operator', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '97', 'type': 'block', 'children': ['98']}; {'id': '98', 'type': 'expression_statement', 'children': ['99']}; {'id': '99', 'type': 'assignment', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '101', 'type': 'binary_operator', 'children': ['102', '103'], 'value': '*'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '103', 'type': 'unary_operator', 'children': ['104'], 'value': '-'}; {'id': '104', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '105', 'type': 'elif_clause', 'children': ['106', '113']}; {'id': '106', 'type': 'boolean_operator', 'children': ['107', '112'], 'value': 'and'}; {'id': '107', 'type': 'comparison_operator', 'children': ['108', '111'], 'value': '<'}; {'id': '108', 'type': 'attribute', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'n'}; {'id': '111', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '113', 'type': 'block', 'children': ['114']}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'assignment', 'children': ['116', '117']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '117', 'type': 'binary_operator', 'children': ['118', '119'], 'value': '*'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '119', 'type': 'unary_operator', 'children': ['120'], 'value': '-'}; {'id': '120', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '121', 'type': 'expression_statement', 'children': ['122']}; {'id': '122', 'type': 'assignment', 'children': ['123', '126']}; {'id': '123', 'type': 'subscript', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'attribs'}; {'id': '125', 'type': 'string', 'children': [], 'value': "'freq'"}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'freq'}; {'id': '127', 'type': 'if_statement', 'children': ['128', '130']}; {'id': '128', 'type': 'not_operator', 'children': ['129']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'ascending'}; {'id': '130', 'type': 'block', 'children': ['131']}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'sorted_values'}; {'id': '134', 'type': 'subscript', 'children': ['135', '136']}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'sorted_values'}; {'id': '136', 'type': 'slice', 'children': ['137', '138', '139']}; {'id': '137', 'type': 'colon', 'children': []}; {'id': '138', 'type': 'colon', 'children': []}; {'id': '139', 'type': 'unary_operator', 'children': ['140'], 'value': '-'}; {'id': '140', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '141', 'type': 'return_statement', 'children': ['142']}; {'id': '142', 'type': 'call', 'children': ['143', '146']}; {'id': '143', 'type': 'attribute', 'children': ['144', '145']}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '145', 'type': 'identifier', 'children': [], 'value': '_simple_new'}; {'id': '146', 'type': 'argument_list', 'children': ['147', '148']}; {'id': '147', 'type': 'identifier', 'children': [], 'value': 'sorted_values'}; {'id': '148', 'type': 'dictionary_splat', 'children': ['149']}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'attribs'}
Return sorted copy of Index.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_classes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '15', '31', '38', '44']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': '"Generate classes from `items` by taking the sorted unique values."'}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '18']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'items'}; {'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': 'classes'}; {'id': '22', 'type': 'call', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'union'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'id': '34', 'type': 'call', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'classes'}; {'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': 'classes'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'classes'}
Generate classes from `items` by taking the sorted unique values.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_toplosses_idxs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'learn'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'n_imgs'}; {'id': '7', 'type': 'dictionary_splat_pattern', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '9', 'type': 'block', 'children': ['10', '12', '20', '33', '52', '64']}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'string', 'children': [], 'value': '"Sorts `ds_type` dataset by top losses and returns dataset and sorted indices."'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'dl'}; {'id': '15', 'type': 'attribute', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'learn'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'fix_dl'}; {'id': '20', 'type': 'if_statement', 'children': ['21', '23']}; {'id': '21', 'type': 'not_operator', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'n_imgs'}; {'id': '23', 'type': 'block', 'children': ['24']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'n_imgs'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'dl'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'dataset'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '39']}; {'id': '35', 'type': 'pattern_list', 'children': ['36', '37', '38']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'top_losses'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'learn'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'get_preds'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '49']}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'ds_type'}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'DatasetType'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'Fix'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'with_loss'}; {'id': '51', 'type': 'True', 'children': []}; {'id': '52', 'type': 'expression_statement', 'children': ['53']}; {'id': '53', 'type': 'assignment', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '55', 'type': 'subscript', 'children': ['56', '63']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'torch'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'topk'}; {'id': '60', 'type': 'argument_list', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'top_losses'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'n_imgs'}; {'id': '63', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '64', 'type': 'return_statement', 'children': ['65']}; {'id': '65', 'type': 'expression_list', 'children': ['66', '76']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'padded_ds'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'dl'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'dataset'}; {'id': '74', 'type': 'dictionary_splat', 'children': ['75']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'idxs'}
Sorts `ds_type` dataset by top losses and returns dataset and sorted indices.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_idxs'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'similarities'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '22', '48']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': '"Sorts `similarities` and return the indexes in pairs ordered by highest similarity."'}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'largest_indices'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'similarities'}; {'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': 'similarities'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '25', 'type': 'list_comprehension', 'children': ['26', '37']}; {'id': '26', 'type': 'tuple', 'children': ['27', '32']}; {'id': '27', 'type': 'subscript', 'children': ['28', '31']}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '32', 'type': 'subscript', 'children': ['33', '36']}; {'id': '33', 'type': 'subscript', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '37', 'type': 'for_in_clause', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'list_comprehension', 'children': ['50', '51', '54']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '51', 'type': 'for_in_clause', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'l'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'idxs'}; {'id': '54', 'type': 'for_in_clause', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'l'}
Sorts `similarities` and return the indexes in pairs ordered by highest similarity.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'uniqueify'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'Series'}; {'id': '8', 'type': 'typed_default_parameter', 'children': ['9', '10', '12']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'bool'}; {'id': '12', 'type': 'False', 'children': []}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '15', 'type': 'block', 'children': ['16', '18', '34', '43']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': '"Return sorted unique values of `x`."'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '33']}; {'id': '25', 'type': 'attribute', 'children': ['26', '32']}; {'id': '26', 'type': 'call', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'fromkeys'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'if_statement', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'res'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '42', 'type': 'argument_list', 'children': []}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'res'}
Return sorted unique values of `x`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_freq_tuples'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'my_list'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'print_total_threshold'}; {'id': '6', 'type': 'block', 'children': ['7', '11', '29']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '10', 'type': 'dictionary', 'children': []}; {'id': '11', 'type': 'for_statement', 'children': ['12', '13', '14']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'my_list'}; {'id': '14', 'type': 'block', 'children': ['15', '23']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '22', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'augmented_assignment', 'children': ['25', '28'], 'value': '+='}; {'id': '25', 'type': 'subscript', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'token'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'subscript', 'children': ['31', '50']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '39', '47']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'keyword_argument', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '47', 'type': 'keyword_argument', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '49', 'type': 'True', 'children': []}; {'id': '50', 'type': 'slice', 'children': ['51', '52']}; {'id': '51', 'type': 'colon', 'children': []}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'print_total_threshold'}
Turn a list of errors into frequency-sorted tuples thresholded by a certain total number
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'max_heapify'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'simulation'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '8', 'type': 'block', 'children': ['9', '18', '119', '135']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '17'], 'value': '//'}; {'id': '13', 'type': '()', 'children': ['14']}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '16'], 'value': '-'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '16', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '18', 'type': 'for_statement', 'children': ['19', '20', '28']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '20', 'type': 'call', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '22', 'type': 'argument_list', 'children': ['23', '24', '26']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '24', 'type': 'unary_operator', 'children': ['25'], 'value': '-'}; {'id': '25', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '26', 'type': 'unary_operator', 'children': ['27'], 'value': '-'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'block', 'children': ['29', '33']}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '33', 'type': 'while_statement', 'children': ['34', '37']}; {'id': '34', 'type': 'comparison_operator', 'children': ['35', '36'], 'value': '<='}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '37', 'type': 'block', 'children': ['38', '46', '69']}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'assignment', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '41', 'type': 'binary_operator', 'children': ['42', '45'], 'value': '+'}; {'id': '42', 'type': 'binary_operator', 'children': ['43', '44'], 'value': '*'}; {'id': '43', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '45', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '46', 'type': 'if_statement', 'children': ['47', '62']}; {'id': '47', 'type': 'boolean_operator', 'children': ['48', '53'], 'value': 'and'}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '52'], 'value': '<='}; {'id': '49', 'type': 'binary_operator', 'children': ['50', '51'], 'value': '+'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '51', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '53', 'type': 'comparison_operator', 'children': ['54', '57'], 'value': '<'}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '+'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'assignment', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '66', 'type': 'binary_operator', 'children': ['67', '68'], 'value': '+'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '68', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '69', 'type': 'if_statement', 'children': ['70', '77', '116']}; {'id': '70', 'type': 'comparison_operator', 'children': ['71', '74'], 'value': '>'}; {'id': '71', 'type': 'subscript', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '74', 'type': 'subscript', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '77', 'type': 'block', 'children': ['78', '94', '98']}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '87']}; {'id': '80', 'type': 'pattern_list', 'children': ['81', '84']}; {'id': '81', 'type': 'subscript', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '84', 'type': 'subscript', 'children': ['85', '86']}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '87', 'type': 'expression_list', 'children': ['88', '91']}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '91', 'type': 'subscript', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'simulation'}; {'id': '100', 'type': 'block', 'children': ['101', '107']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'assignment', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '104', 'type': 'binary_operator', 'children': ['105', '106'], 'value': '+'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '106', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '107', 'type': 'expression_statement', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '110', 'type': 'argument_list', 'children': ['111', '112', '113', '114']}; {'id': '111', 'type': 'string', 'children': [], 'value': '"iteration"'}; {'id': '112', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '113', 'type': 'string', 'children': [], 'value': '":"'}; {'id': '114', 'type': 'list_splat', 'children': ['115']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '116', 'type': 'else_clause', 'children': ['117']}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'break_statement', 'children': []}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '128']}; {'id': '121', 'type': 'pattern_list', 'children': ['122', '125']}; {'id': '122', 'type': 'subscript', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '124', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '125', 'type': 'subscript', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '128', 'type': 'expression_list', 'children': ['129', '132']}; {'id': '129', 'type': 'subscript', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '132', 'type': 'subscript', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '134', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '135', 'type': 'return_statement', 'children': ['136']}; {'id': '136', 'type': 'identifier', 'children': [], 'value': 'iteration'}
Max heapify helper for max_heap_sort
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'min_heapify'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'simulation'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '8', 'type': 'block', 'children': ['9', '18', '29', '149']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '17'], 'value': '-'}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '17', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '28'], 'value': '//'}; {'id': '22', 'type': '()', 'children': ['23']}; {'id': '23', 'type': 'binary_operator', 'children': ['24', '27'], 'value': '-'}; {'id': '24', 'type': 'binary_operator', 'children': ['25', '26'], 'value': '-'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '27', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '28', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '29', 'type': 'for_statement', 'children': ['30', '31', '39']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35', '37']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '35', 'type': 'unary_operator', 'children': ['36'], 'value': '-'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '37', 'type': 'unary_operator', 'children': ['38'], 'value': '-'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '39', 'type': 'block', 'children': ['40', '44']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'assignment', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '44', 'type': 'while_statement', 'children': ['45', '48']}; {'id': '45', 'type': 'comparison_operator', 'children': ['46', '47'], 'value': '<='}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'last_parent'}; {'id': '48', 'type': 'block', 'children': ['49', '57', '86']}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '52', 'type': 'binary_operator', 'children': ['53', '56'], 'value': '+'}; {'id': '53', 'type': 'binary_operator', 'children': ['54', '55'], 'value': '*'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '56', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '57', 'type': 'if_statement', 'children': ['58', '79']}; {'id': '58', 'type': 'boolean_operator', 'children': ['59', '66'], 'value': 'and'}; {'id': '59', 'type': 'comparison_operator', 'children': ['60', '63'], 'value': '<='}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '62'], 'value': '+'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '62', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '63', 'type': 'binary_operator', 'children': ['64', '65'], 'value': '-'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'end'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '72'], 'value': '>'}; {'id': '67', 'type': 'subscript', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '69', 'type': 'binary_operator', 'children': ['70', '71'], 'value': '+'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '72', 'type': 'subscript', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '74', 'type': 'binary_operator', 'children': ['75', '78'], 'value': '+'}; {'id': '75', 'type': 'binary_operator', 'children': ['76', '77'], 'value': '+'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '77', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'assignment', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '83', 'type': 'binary_operator', 'children': ['84', '85'], 'value': '+'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '85', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '86', 'type': 'if_statement', 'children': ['87', '98', '146']}; {'id': '87', 'type': 'comparison_operator', 'children': ['88', '93'], 'value': '<'}; {'id': '88', 'type': 'subscript', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '90', 'type': 'binary_operator', 'children': ['91', '92'], 'value': '+'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '93', 'type': 'subscript', 'children': ['94', '95']}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '95', 'type': 'binary_operator', 'children': ['96', '97'], 'value': '+'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '98', 'type': 'block', 'children': ['99', '124', '128']}; {'id': '99', 'type': 'expression_statement', 'children': ['100']}; {'id': '100', 'type': 'assignment', 'children': ['101', '112', '113']}; {'id': '101', 'type': 'pattern_list', 'children': ['102', '107']}; {'id': '102', 'type': 'subscript', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '104', 'type': 'binary_operator', 'children': ['105', '106'], 'value': '+'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '107', 'type': 'subscript', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '109', 'type': 'binary_operator', 'children': ['110', '111'], 'value': '+'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '112', 'type': 'line_continuation', 'children': [], 'value': '\\'}; {'id': '113', 'type': 'expression_list', 'children': ['114', '119']}; {'id': '114', 'type': 'subscript', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '116', 'type': 'binary_operator', 'children': ['117', '118'], 'value': '+'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '119', 'type': 'subscript', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '121', 'type': 'binary_operator', 'children': ['122', '123'], 'value': '+'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '124', 'type': 'expression_statement', 'children': ['125']}; {'id': '125', 'type': 'assignment', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'current_parent'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '128', 'type': 'if_statement', 'children': ['129', '130']}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'simulation'}; {'id': '130', 'type': 'block', 'children': ['131', '137']}; {'id': '131', 'type': 'expression_statement', 'children': ['132']}; {'id': '132', 'type': 'assignment', 'children': ['133', '134']}; {'id': '133', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '134', 'type': 'binary_operator', 'children': ['135', '136'], 'value': '+'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '136', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '137', 'type': 'expression_statement', 'children': ['138']}; {'id': '138', 'type': 'call', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'print'}; {'id': '140', 'type': 'argument_list', 'children': ['141', '142', '143', '144']}; {'id': '141', 'type': 'string', 'children': [], 'value': '"iteration"'}; {'id': '142', 'type': 'identifier', 'children': [], 'value': 'iteration'}; {'id': '143', 'type': 'string', 'children': [], 'value': '":"'}; {'id': '144', 'type': 'list_splat', 'children': ['145']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'arr'}; {'id': '146', 'type': 'else_clause', 'children': ['147']}; {'id': '147', 'type': 'block', 'children': ['148']}; {'id': '148', 'type': 'break_statement', 'children': []}; {'id': '149', 'type': 'return_statement', 'children': ['150']}; {'id': '150', 'type': 'identifier', 'children': [], 'value': 'iteration'}
Min heapify helper for min_heap_sort
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'natural_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '7', 'type': 'lambda', 'children': ['8', '10']}; {'id': '8', 'type': 'lambda_parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '11', 'type': 'block', 'children': ['12', '55', '62']}; {'id': '12', 'type': 'function_definition', 'children': ['13', '14', '16']}; {'id': '13', 'type': 'function_name', 'children': [], 'value': 'get_alphanum_key_func'}; {'id': '14', 'type': 'parameters', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '16', 'type': 'block', 'children': ['17', '34']}; {'id': '17', 'type': 'expression_statement', 'children': ['18']}; {'id': '18', 'type': 'assignment', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'convert'}; {'id': '20', 'type': 'lambda', 'children': ['21', '23']}; {'id': '21', 'type': 'lambda_parameters', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '23', 'type': 'conditional_expression', 'children': ['24', '28', '33'], 'value': 'if'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'isdigit'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'lambda', 'children': ['36', '38']}; {'id': '36', 'type': 'lambda_parameters', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '38', 'type': 'list_comprehension', 'children': ['39', '43']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'convert'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '43', 'type': 'for_in_clause', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '49', 'type': 'argument_list', 'children': ['50', '51']}; {'id': '50', 'type': 'string', 'children': [], 'value': "'([0-9]+)'"}; {'id': '51', 'type': 'call', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '53', 'type': 'argument_list', 'children': ['54']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'sort_key'}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'get_alphanum_key_func'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': 'list'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'sort_key'}
Sort the list into natural alphanumeric order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_read_stepfiles_list'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'path_prefix'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'path_suffix'}; {'id': '7', 'type': 'string', 'children': [], 'value': '".index"'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'min_steps'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '11', 'type': 'block', 'children': ['12', '16', '119']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'stepfiles'}; {'id': '15', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '16', 'type': 'for_statement', 'children': ['17', '18', '26']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_try_twice_tf_glob'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'binary_operator', 'children': ['22', '25'], 'value': '+'}; {'id': '22', 'type': 'binary_operator', 'children': ['23', '24'], 'value': '+'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'path_prefix'}; {'id': '24', 'type': 'string', 'children': [], 'value': '"*-[0-9]*"'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'path_suffix'}; {'id': '26', 'type': 'block', 'children': ['27', '42', '63', '69', '92']}; {'id': '27', 'type': 'expression_statement', 'children': ['28']}; {'id': '28', 'type': 'assignment', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '30', 'type': 'conditional_expression', 'children': ['31', '40', '41'], 'value': 'if'}; {'id': '31', 'type': 'subscript', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '33', 'type': 'slice', 'children': ['34', '35']}; {'id': '34', 'type': 'colon', 'children': []}; {'id': '35', 'type': 'unary_operator', 'children': ['36'], 'value': '-'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'path_suffix'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'path_suffix'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '42', 'type': 'try_statement', 'children': ['43', '59']}; {'id': '43', 'type': 'block', 'children': ['44']}; {'id': '44', 'type': 'expression_statement', 'children': ['45']}; {'id': '45', 'type': 'assignment', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'steps'}; {'id': '47', 'type': 'call', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'subscript', 'children': ['51', '57']}; {'id': '51', 'type': 'call', 'children': ['52', '55']}; {'id': '52', 'type': 'attribute', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'rsplit'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'string', 'children': [], 'value': '"-"'}; {'id': '57', 'type': 'unary_operator', 'children': ['58'], 'value': '-'}; {'id': '58', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '59', 'type': 'except_clause', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'continue_statement', 'children': []}; {'id': '63', 'type': 'if_statement', 'children': ['64', '67']}; {'id': '64', 'type': 'comparison_operator', 'children': ['65', '66'], 'value': '<'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'steps'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'min_steps'}; {'id': '67', 'type': 'block', 'children': ['68']}; {'id': '68', 'type': 'continue_statement', 'children': []}; {'id': '69', 'type': 'if_statement', 'children': ['70', '79']}; {'id': '70', 'type': 'not_operator', 'children': ['71']}; {'id': '71', 'type': 'call', 'children': ['72', '77']}; {'id': '72', 'type': 'attribute', 'children': ['73', '76']}; {'id': '73', 'type': 'attribute', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'exists'}; {'id': '77', 'type': 'argument_list', 'children': ['78']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '79', 'type': 'block', 'children': ['80', '91']}; {'id': '80', 'type': 'expression_statement', 'children': ['81']}; {'id': '81', 'type': 'call', 'children': ['82', '87']}; {'id': '82', 'type': 'attribute', 'children': ['83', '86']}; {'id': '83', 'type': 'attribute', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'tf'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'logging'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'info'}; {'id': '87', 'type': 'argument_list', 'children': ['88']}; {'id': '88', 'type': 'binary_operator', 'children': ['89', '90'], 'value': '+'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '90', 'type': 'string', 'children': [], 'value': '" was deleted, so skipping it"'}; {'id': '91', 'type': 'continue_statement', 'children': []}; {'id': '92', 'type': 'expression_statement', 'children': ['93']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'stepfiles'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '97', 'type': 'argument_list', 'children': ['98']}; {'id': '98', 'type': 'call', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'StepFile'}; {'id': '100', 'type': 'argument_list', 'children': ['101', '102', '110', '118']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '102', 'type': 'call', 'children': ['103', '108']}; {'id': '103', 'type': 'attribute', 'children': ['104', '107']}; {'id': '104', 'type': 'attribute', 'children': ['105', '106']}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'getmtime'}; {'id': '108', 'type': 'argument_list', 'children': ['109']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '110', 'type': 'call', 'children': ['111', '116']}; {'id': '111', 'type': 'attribute', 'children': ['112', '115']}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'getctime'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'filename'}; {'id': '118', 'type': 'identifier', 'children': [], 'value': 'steps'}; {'id': '119', 'type': 'return_statement', 'children': ['120']}; {'id': '120', 'type': 'call', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '122', 'type': 'argument_list', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'stepfiles'}; {'id': '124', 'type': 'keyword_argument', 'children': ['125', '126']}; {'id': '125', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '126', 'type': 'lambda', 'children': ['127', '129']}; {'id': '127', 'type': 'lambda_parameters', 'children': ['128']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '129', 'type': 'unary_operator', 'children': ['130'], 'value': '-'}; {'id': '130', 'type': 'attribute', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'steps'}
Return list of StepFiles sorted by step from files at path_prefix.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '13', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'render_config'}; {'id': '3', 'type': 'parameters', 'children': ['4', '8']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'Config'}; {'id': '8', 'type': 'typed_default_parameter', 'children': ['9', '10', '12']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '12', 'type': 'string', 'children': [], 'value': '""'}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '15', 'type': 'block', 'children': ['16', '22']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'new_indent'}; {'id': '19', 'type': 'binary_operator', 'children': ['20', '21'], 'value': '+'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '21', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '22', 'type': 'return_statement', 'children': ['23']}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': '""'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'list', 'children': ['29', '30', '36', '51', '52'], 'value': '[\n "{\\n",\n f\'{new_indent}"type": "{config.typ3}",\\n\' if config.typ3 else \'\',\n "".join(_render(item, new_indent) for item in config.items),\n indent,\n "}\\n"\n ]'}; {'id': '29', 'type': 'string', 'children': [], 'value': '"{\\n"'}; {'id': '30', 'type': 'conditional_expression', 'children': ['31', '32', '35'], 'value': 'if'}; {'id': '31', 'type': 'string', 'children': [], 'value': 'f\'{new_indent}"type": "{config.typ3}",\\n\''}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'typ3'}; {'id': '35', 'type': 'string', 'children': [], 'value': "''"}; {'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': 'generator_expression', 'children': ['41', '46']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '_render'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'new_indent'}; {'id': '46', 'type': 'for_in_clause', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'config'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'indent'}; {'id': '52', 'type': 'string', 'children': [], 'value': '"}\\n"'}
Pretty-print a config in sort-of-JSON+comments.
{'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', '22', '44']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'beams'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '11', 'type': 'for_in_clause', 'children': ['12', '15']}; {'id': '12', 'type': 'tuple_pattern', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '15', 'type': 'call', 'children': ['16', '21']}; {'id': '16', 'type': 'attribute', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'entries'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '21', 'type': 'argument_list', 'children': []}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sortedBeams'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29', '32']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'beams'}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '31', 'type': 'True', 'children': []}; {'id': '32', 'type': 'keyword_argument', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '34', 'type': 'lambda', 'children': ['35', '37']}; {'id': '35', 'type': 'lambda_parameters', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '37', 'type': 'binary_operator', 'children': ['38', '41'], 'value': '*'}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'prTotal'}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'prText'}; {'id': '44', 'type': 'return_statement', 'children': ['45']}; {'id': '45', 'type': 'list_comprehension', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'labeling'}; {'id': '49', 'type': 'for_in_clause', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sortedBeams'}
return beam-labelings, sorted by probability
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_naturalize'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'string'}; {'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': 'splits'}; {'id': '9', 'type': 'call', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 're'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': '"([0-9]+)"'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'string'}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'list_comprehension', 'children': ['18', '33']}; {'id': '18', 'type': 'conditional_expression', 'children': ['19', '23', '28'], 'value': 'if'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isdigit'}; {'id': '27', 'type': 'argument_list', 'children': []}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'for_in_clause', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'splits'}
Provides a natural representation for string for nice sorting.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted'}; {'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': 'wantdirs'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '62', '71', '101']}; {'id': '9', 'type': 'function_definition', 'children': ['10', '11', '14']}; {'id': '10', 'type': 'function_name', 'children': [], 'value': 'add_dir'}; {'id': '11', 'type': 'parameters', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '14', 'type': 'block', 'children': ['15', '22', '30']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'add'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'd'}; {'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': 'logger'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'debug'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'add_dir added %s'"}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '30', 'type': 'if_statement', 'children': ['31', '36']}; {'id': '31', 'type': 'comparison_operator', 'children': ['32', '33'], 'value': '!='}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'base'}; {'id': '36', 'type': 'block', 'children': ['37', '50', '56']}; {'id': '37', 'type': 'expression_statement', 'children': ['38']}; {'id': '38', 'type': 'assignment', 'children': ['39', '42']}; {'id': '39', 'type': 'pattern_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '42', 'type': 'call', 'children': ['43', '48']}; {'id': '43', 'type': 'attribute', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '50', 'type': 'assert_statement', 'children': ['51']}; {'id': '51', 'type': 'comparison_operator', 'children': ['52', '53'], 'value': 'not'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '53', 'type': 'tuple', 'children': ['54', '55']}; {'id': '54', 'type': 'string', 'children': [], 'value': "''"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'/'"}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'add_dir'}; {'id': '59', 'type': 'argument_list', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'parent'}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'assignment', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '71', 'type': 'if_statement', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'wantdirs'}; {'id': '73', 'type': 'block', 'children': ['74', '80', '97']}; {'id': '74', 'type': 'expression_statement', 'children': ['75']}; {'id': '75', 'type': 'assignment', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'set'}; {'id': '79', 'type': 'argument_list', 'children': []}; {'id': '80', 'type': 'for_statement', 'children': ['81', '82', '83']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '83', 'type': 'block', 'children': ['84']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'call', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'add_dir'}; {'id': '87', 'type': 'argument_list', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '89', 'type': 'call', 'children': ['90', '95']}; {'id': '90', 'type': 'attribute', 'children': ['91', '94']}; {'id': '91', 'type': 'attribute', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'dirname'}; {'id': '95', 'type': 'argument_list', 'children': ['96']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'f'}; {'id': '97', 'type': 'expression_statement', 'children': ['98']}; {'id': '98', 'type': 'augmented_assignment', 'children': ['99', '100'], 'value': '|='}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'dirs'}; {'id': '101', 'type': 'return_statement', 'children': ['102']}; {'id': '102', 'type': 'list_comprehension', 'children': ['103', '112']}; {'id': '103', 'type': 'call', 'children': ['104', '109']}; {'id': '104', 'type': 'attribute', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '109', 'type': 'argument_list', 'children': ['110']}; {'id': '110', 'type': 'list_splat', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'path_tuple'}; {'id': '112', 'type': 'for_in_clause', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'path_tuple'}; {'id': '114', 'type': 'call', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '116', 'type': 'generator_expression', 'children': ['117', '125']}; {'id': '117', 'type': 'call', 'children': ['118', '123']}; {'id': '118', 'type': 'attribute', 'children': ['119', '122']}; {'id': '119', 'type': 'attribute', 'children': ['120', '121']}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '123', 'type': 'argument_list', 'children': ['124']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '125', 'type': 'for_in_clause', 'children': ['126', '127']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'result'}
Return sorted files in directory order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sorted_resource_labels'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '5', 'type': 'block', 'children': ['6', '18', '32']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '11', '14']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '11', 'type': 'for_in_clause', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'TOP_RESOURCE_LABELS'}; {'id': '14', 'type': 'if_clause', 'children': ['15']}; {'id': '15', 'type': 'comparison_operator', 'children': ['16', '17'], 'value': 'in'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'tail'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '23', 'type': 'generator_expression', 'children': ['24', '25', '28']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '25', 'type': 'for_in_clause', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'labels'}; {'id': '28', 'type': 'if_clause', 'children': ['29']}; {'id': '29', 'type': 'comparison_operator', 'children': ['30', '31'], 'value': 'not'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'label'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'TOP_RESOURCE_LABELS'}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '35'], 'value': '+'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'head'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'tail'}
Sort label names, putting well-known resource labels first.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_item_children'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '5', 'type': 'block', 'children': ['6', '26', '49']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '9', 'type': 'list_comprehension', 'children': ['10', '16']}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '16', 'type': 'for_in_clause', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'childCount'}; {'id': '25', 'type': 'argument_list', 'children': []}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '32']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '28', 'type': 'subscript', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '30', 'type': 'slice', 'children': ['31']}; {'id': '31', 'type': 'colon', 'children': []}; {'id': '32', 'type': 'block', 'children': ['33', '40']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'others'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'get_item_children'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '44']}; {'id': '41', 'type': 'comparison_operator', 'children': ['42', '43'], 'value': 'is'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'others'}; {'id': '43', 'type': 'None', 'children': []}; {'id': '44', 'type': 'block', 'children': ['45']}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'augmented_assignment', 'children': ['47', '48'], 'value': '+='}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'others'}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'children'}; {'id': '54', 'type': 'keyword_argument', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '56', 'type': 'lambda', 'children': ['57', '59']}; {'id': '57', 'type': 'lambda_parameters', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'child'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'line'}
Return a sorted list of all the children items of 'item'.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortByColumn'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '6', 'type': 'block', 'children': ['7', '24', '34', '42', '96']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '14']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '12'], 'value': '=='}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sort_old'}; {'id': '12', 'type': 'list', 'children': ['13'], 'value': '[None]'}; {'id': '13', 'type': 'None', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '22']}; {'id': '17', 'type': 'attribute', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'header_class'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'setSortIndicatorShown'}; {'id': '22', 'type': 'argument_list', 'children': ['23']}; {'id': '23', 'type': 'True', 'children': []}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '27', 'type': 'call', 'children': ['28', '33']}; {'id': '28', 'type': 'attribute', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'header_class'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sortIndicatorOrder'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sig_sort_by_column'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'emit'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'if_statement', 'children': ['43', '55']}; {'id': '43', 'type': 'not_operator', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '52']}; {'id': '45', 'type': 'attribute', 'children': ['46', '51']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '52', 'type': 'argument_list', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '55', 'type': 'block', 'children': ['56', '95']}; {'id': '56', 'type': 'if_statement', 'children': ['57', '65', '75']}; {'id': '57', 'type': 'comparison_operator', 'children': ['58', '64'], 'value': '!='}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'sort_old'}; {'id': '64', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '65', 'type': 'block', 'children': ['66']}; {'id': '66', 'type': 'expression_statement', 'children': ['67']}; {'id': '67', 'type': 'call', 'children': ['68', '73']}; {'id': '68', 'type': 'attribute', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'header_class'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'setSortIndicatorShown'}; {'id': '73', 'type': 'argument_list', 'children': ['74']}; {'id': '74', 'type': 'False', 'children': []}; {'id': '75', 'type': 'else_clause', 'children': ['76']}; {'id': '76', 'type': 'block', 'children': ['77']}; {'id': '77', 'type': 'expression_statement', 'children': ['78']}; {'id': '78', 'type': 'call', 'children': ['79', '84']}; {'id': '79', 'type': 'attribute', 'children': ['80', '83']}; {'id': '80', 'type': 'attribute', 'children': ['81', '82']}; {'id': '81', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'header_class'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'setSortIndicator'}; {'id': '84', 'type': 'argument_list', 'children': ['85', '90']}; {'id': '85', 'type': 'subscript', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'sort_old'}; {'id': '89', 'type': 'integer', 'children': [], 'value': '0'}; {'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': 'sort_old'}; {'id': '94', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '95', 'type': 'return_statement', 'children': []}; {'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': 'self'}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'sort_old'}; {'id': '101', 'type': 'list', 'children': ['102', '103'], 'value': '[index, self.header_class.sortIndicatorOrder()]'}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '103', 'type': 'call', 'children': ['104', '109']}; {'id': '104', 'type': 'attribute', 'children': ['105', '108']}; {'id': '105', 'type': 'attribute', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'header_class'}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'sortIndicatorOrder'}; {'id': '109', 'type': 'argument_list', 'children': []}
Implement a column sort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortByIndex'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '34', '48']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '18']}; {'id': '9', 'type': 'attribute', 'children': ['10', '17']}; {'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': 'table_level'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'horizontalHeader'}; {'id': '16', 'type': 'argument_list', 'children': []}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'setSortIndicatorShown'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'True', 'children': []}; {'id': '20', 'type': 'expression_statement', 'children': ['21']}; {'id': '21', 'type': 'assignment', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '23', 'type': 'call', 'children': ['24', '33']}; {'id': '24', 'type': 'attribute', 'children': ['25', '32']}; {'id': '25', 'type': 'call', 'children': ['26', '31']}; {'id': '26', 'type': 'attribute', 'children': ['27', '30']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'table_level'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'horizontalHeader'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sortIndicatorOrder'}; {'id': '33', 'type': 'argument_list', 'children': []}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '45']}; {'id': '36', 'type': 'attribute', 'children': ['37', '44']}; {'id': '37', 'type': 'call', 'children': ['38', '43']}; {'id': '38', 'type': 'attribute', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'table_index'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '43', 'type': 'argument_list', 'children': []}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '45', 'type': 'argument_list', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'sort_order'}; {'id': '48', 'type': 'expression_statement', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '53']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': '_sort_update'}; {'id': '53', 'type': 'argument_list', 'children': []}
Implement a Index sort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_file_tabs_alphabetically'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'while_statement', 'children': ['7', '14']}; {'id': '7', 'type': 'comparison_operator', 'children': ['8', '13'], 'value': 'is'}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'False', 'children': []}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '32']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '21', 'type': 'call', 'children': ['22', '31']}; {'id': '22', 'type': 'attribute', 'children': ['23', '30']}; {'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': 'tabs'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'tabBar'}; {'id': '29', 'type': 'argument_list', 'children': []}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '31', 'type': 'argument_list', 'children': []}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'if_statement', 'children': ['34', '62']}; {'id': '34', 'type': '()', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '48'], 'value': '>'}; {'id': '36', 'type': 'call', 'children': ['37', '46']}; {'id': '37', 'type': 'attribute', 'children': ['38', '45']}; {'id': '38', 'type': 'call', 'children': ['39', '44']}; {'id': '39', 'type': 'attribute', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'tabs'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'tabBar'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'tabText'}; {'id': '46', 'type': 'argument_list', 'children': ['47']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '48', 'type': 'call', 'children': ['49', '58']}; {'id': '49', 'type': 'attribute', 'children': ['50', '57']}; {'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': 'tabs'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'tabBar'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'tabText'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'binary_operator', 'children': ['60', '61'], 'value': '+'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '61', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'expression_statement', 'children': ['64']}; {'id': '64', 'type': 'call', 'children': ['65', '74']}; {'id': '65', 'type': 'attribute', 'children': ['66', '73']}; {'id': '66', 'type': 'call', 'children': ['67', '72']}; {'id': '67', 'type': 'attribute', 'children': ['68', '71']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'tabs'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'tabBar'}; {'id': '72', 'type': 'argument_list', 'children': []}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'moveTab'}; {'id': '74', 'type': 'argument_list', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '76', 'type': 'binary_operator', 'children': ['77', '78'], 'value': '+'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '78', 'type': 'integer', 'children': [], 'value': '1'}
Sort open tabs alphabetically.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_top_level_items'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '39', '56']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'save_expanded_state'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '36']}; {'id': '19', 'type': 'list_comprehension', 'children': ['20', '26']}; {'id': '20', 'type': 'call', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'takeTopLevelItem'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'topLevelItemCount'}; {'id': '35', 'type': 'argument_list', 'children': []}; {'id': '36', 'type': 'keyword_argument', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '39', 'type': 'for_statement', 'children': ['40', '43', '47']}; {'id': '40', 'type': 'pattern_list', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '43', 'type': 'call', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'items'}; {'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': 'self'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'insertTopLevelItem'}; {'id': '53', 'type': 'argument_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'index'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '56', 'type': 'expression_statement', 'children': ['57']}; {'id': '57', 'type': 'call', 'children': ['58', '61']}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'restore_expanded_state'}; {'id': '61', 'type': 'argument_list', 'children': []}
Sorting tree wrt top level items
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_sorting'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'flag'}; {'id': '6', 'type': 'block', 'children': ['7', '15']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '14']}; {'id': '9', 'type': 'subscript', 'children': ['10', '13']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sorting'}; {'id': '13', 'type': 'string', 'children': [], 'value': "'status'"}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'flag'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'call', 'children': ['17', '24']}; {'id': '17', 'type': 'attribute', 'children': ['18', '23']}; {'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': 'header'}; {'id': '22', 'type': 'argument_list', 'children': []}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'setSectionsClickable'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'comparison_operator', 'children': ['26', '27'], 'value': '=='}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'flag'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ON'}
Enable result sorting after search is complete.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_filter'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '41']}; {'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': 'pattern'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'get_search_regex'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'text'}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20', '30']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'pattern'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'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': '_parent'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'setSortingEnabled'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'False', 'children': []}; {'id': '30', 'type': 'else_clause', 'children': ['31']}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_parent'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'setSortingEnabled'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'True', 'children': []}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'invalidateFilter'}; {'id': '46', 'type': 'argument_list', 'children': []}
Set regular expression for filter.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_content_hash'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '16', '33', '56']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': '_local_config'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'relevant_content'}; {'id': '15', 'type': 'dictionary', 'children': []}; {'id': '16', 'type': 'for_statement', 'children': ['17', '18', '21']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_relevant_keys'}; {'id': '21', 'type': 'block', 'children': ['22']}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '27']}; {'id': '24', 'type': 'subscript', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'relevant_content'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'content'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'content_hash'}; {'id': '36', 'type': 'call', 'children': ['37', '55']}; {'id': '37', 'type': 'attribute', 'children': ['38', '54']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'sha256'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '53']}; {'id': '42', 'type': 'attribute', 'children': ['43', '52']}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'json'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'dumps'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'relevant_content'}; {'id': '49', 'type': 'keyword_argument', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sort_keys'}; {'id': '51', 'type': 'True', 'children': []}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'encode'}; {'id': '53', 'type': 'argument_list', 'children': []}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'hexdigest'}; {'id': '55', 'type': 'argument_list', 'children': []}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'content_hash'}
Returns the sha256 hash of the sorted content of the pyproject file.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'session_groups'}; {'id': '6', 'type': 'block', 'children': ['7', '21']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'session_groups'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '12', 'type': 'argument_list', 'children': ['13']}; {'id': '13', 'type': 'keyword_argument', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'operator'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '21', 'type': 'for_statement', 'children': ['22', '25', '42']}; {'id': '22', 'type': 'pattern_list', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'extractor'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'reversed'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '39']}; {'id': '34', 'type': 'attribute', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_request'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'col_params'}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_extractors'}; {'id': '42', 'type': 'block', 'children': ['43', '53']}; {'id': '43', 'type': 'if_statement', 'children': ['44', '51']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '48'], 'value': '=='}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'api_pb2'}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'ORDER_UNSPECIFIED'}; {'id': '51', 'type': 'block', 'children': ['52']}; {'id': '52', 'type': 'continue_statement', 'children': []}; {'id': '53', 'type': 'if_statement', 'children': ['54', '61', '80', '109']}; {'id': '54', 'type': 'comparison_operator', 'children': ['55', '58'], 'value': '=='}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '58', 'type': 'attribute', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'api_pb2'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'ORDER_ASC'}; {'id': '61', 'type': 'block', 'children': ['62']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '67']}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'session_groups'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'keyword_argument', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': '_create_key_func'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'extractor'}; {'id': '74', 'type': 'keyword_argument', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'none_is_largest'}; {'id': '76', 'type': 'not_operator', 'children': ['77']}; {'id': '77', 'type': 'attribute', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'missing_values_first'}; {'id': '80', 'type': 'elif_clause', 'children': ['81', '88']}; {'id': '81', 'type': 'comparison_operator', 'children': ['82', '85'], 'value': '=='}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '85', 'type': 'attribute', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'api_pb2'}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'ORDER_DESC'}; {'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': 'session_groups'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '94', 'type': 'argument_list', 'children': ['95', '106']}; {'id': '95', 'type': 'keyword_argument', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': '_create_key_func'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'extractor'}; {'id': '101', 'type': 'keyword_argument', 'children': ['102', '103']}; {'id': '102', 'type': 'identifier', 'children': [], 'value': 'none_is_largest'}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'col_param'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'missing_values_first'}; {'id': '106', 'type': 'keyword_argument', 'children': ['107', '108']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '108', 'type': 'True', 'children': []}; {'id': '109', 'type': 'else_clause', 'children': ['110']}; {'id': '110', 'type': 'block', 'children': ['111']}; {'id': '111', 'type': 'raise_statement', 'children': ['112']}; {'id': '112', 'type': 'call', 'children': ['113', '116']}; {'id': '113', 'type': 'attribute', 'children': ['114', '115']}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'error'}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'HParamsError'}; {'id': '116', 'type': 'argument_list', 'children': ['117']}; {'id': '117', 'type': 'binary_operator', 'children': ['118', '119'], 'value': '%'}; {'id': '118', 'type': 'string', 'children': [], 'value': "'Unknown col_param.order given: %s'"}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'col_param'}
Sorts 'session_groups' in place according to _request.col_params.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '6', 'type': 'block', 'children': ['7', '24']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '11']}; {'id': '8', 'type': 'attribute', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': '_sort'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '15', 'type': 'call', 'children': ['16', '19']}; {'id': '16', 'type': 'attribute', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'search'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'list_splat', 'children': ['21']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_sort'}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'search'}
Add sorting information to the request.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_top_targets'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'orders'}; {'id': '7', 'type': 'block', 'children': ['8', '10', '19', '61']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'string', 'children': [], 'value': "'''\n Returns the sorted high data from the merged top files\n '''"}; {'id': '10', 'type': 'expression_statement', 'children': ['11']}; {'id': '11', 'type': 'assignment', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sorted_top'}; {'id': '13', 'type': 'call', 'children': ['14', '17']}; {'id': '14', 'type': 'attribute', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'collections'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'defaultdict'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '23', '29']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'saltenv'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'iteritems'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'top'}; {'id': '29', 'type': 'block', 'children': ['30', '47']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sorted_targets'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'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': 'target'}; {'id': '42', 'type': 'subscript', 'children': ['43', '46']}; {'id': '43', 'type': 'subscript', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'orders'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'saltenv'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '47', 'type': 'for_statement', 'children': ['48', '49', '50']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorted_targets'}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '58']}; {'id': '53', 'type': 'subscript', 'children': ['54', '57']}; {'id': '54', 'type': 'subscript', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sorted_top'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'saltenv'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '58', 'type': 'subscript', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'targets'}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'target'}; {'id': '61', 'type': 'return_statement', 'children': ['62']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sorted_top'}
Returns the sorted high data from the merged top files
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_cmp_version'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'item1'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'item2'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '16', '23', '31', '38']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'''\n Compare function for package version sorting\n '''"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'vers1'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': '_LooseVersion'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'item1'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'vers2'}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': '_LooseVersion'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'item2'}; {'id': '23', 'type': 'if_statement', 'children': ['24', '27']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': '<'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'vers1'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'vers2'}; {'id': '27', 'type': 'block', 'children': ['28']}; {'id': '28', 'type': 'return_statement', 'children': ['29']}; {'id': '29', 'type': 'unary_operator', 'children': ['30'], 'value': '-'}; {'id': '30', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '31', 'type': 'if_statement', 'children': ['32', '35']}; {'id': '32', 'type': 'comparison_operator', 'children': ['33', '34'], 'value': '>'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'vers1'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'vers2'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'return_statement', 'children': ['37']}; {'id': '37', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'integer', 'children': [], 'value': '0'}
Compare function for package version sorting
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'render_value'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '30', '74']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'return_statement', 'children': ['14']}; {'id': '14', 'type': 'binary_operator', 'children': ['15', '29'], 'value': '+'}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '17'], 'value': '+'}; {'id': '16', 'type': 'string', 'children': [], 'value': "'['"}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '21', 'type': 'generator_expression', 'children': ['22', '26']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'render_value'}; {'id': '24', 'type': 'argument_list', 'children': ['25']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '26', 'type': 'for_in_clause', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '29', 'type': 'string', 'children': [], 'value': "']'"}; {'id': '30', 'type': 'elif_clause', 'children': ['31', '36']}; {'id': '31', 'type': 'call', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '33', 'type': 'argument_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': '()', 'children': ['39']}; {'id': '39', 'type': 'binary_operator', 'children': ['40', '73'], 'value': '+'}; {'id': '40', 'type': 'binary_operator', 'children': ['41', '42'], 'value': '+'}; {'id': '41', 'type': 'string', 'children': [], 'value': "'{'"}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "', '"}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '46', 'type': 'generator_expression', 'children': ['47', '61']}; {'id': '47', 'type': 'call', 'children': ['48', '51']}; {'id': '48', 'type': 'attribute', 'children': ['49', '50']}; {'id': '49', 'type': 'string', 'children': [], 'value': "'{k!r}: {v}'"}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '51', 'type': 'argument_list', 'children': ['52', '55']}; {'id': '52', 'type': 'keyword_argument', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '55', 'type': 'keyword_argument', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'render_value'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '61', 'type': 'for_in_clause', 'children': ['62', '65']}; {'id': '62', 'type': 'pattern_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'call', 'children': ['69', '72']}; {'id': '69', 'type': 'attribute', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '72', 'type': 'argument_list', 'children': []}; {'id': '73', 'type': 'string', 'children': [], 'value': "'}'"}; {'id': '74', 'type': 'else_clause', 'children': ['75']}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'call', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'repr'}; {'id': '79', 'type': 'argument_list', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'value'}
Render a value, ensuring that any nested dicts are sorted by key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_schema'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '5', 'type': 'block', 'children': ['6']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '12', '69', '117']}; {'id': '7', 'type': 'call', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '9', 'type': 'argument_list', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '12', 'type': 'block', 'children': ['13']}; {'id': '13', 'type': 'for_statement', 'children': ['14', '17', '25']}; {'id': '14', 'type': 'pattern_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'v'}; {'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', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '24', 'type': 'argument_list', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'if_statement', 'children': ['27', '32', '44', '62']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'yield', 'children': ['35']}; {'id': '35', 'type': 'expression_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '39', 'type': 'argument_list', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_sort_schema'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '44', 'type': 'elif_clause', 'children': ['45', '50']}; {'id': '45', 'type': 'call', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '50', 'type': 'block', 'children': ['51']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'yield', 'children': ['53']}; {'id': '53', 'type': 'expression_list', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '55', 'type': 'call', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '57', 'type': 'argument_list', 'children': ['58']}; {'id': '58', 'type': 'call', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': '_sort_schema'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '62', 'type': 'else_clause', 'children': ['63']}; {'id': '63', 'type': 'block', 'children': ['64']}; {'id': '64', 'type': 'expression_statement', 'children': ['65']}; {'id': '65', 'type': 'yield', 'children': ['66']}; {'id': '66', 'type': 'expression_list', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '69', 'type': 'elif_clause', 'children': ['70', '75']}; {'id': '70', 'type': 'call', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '72', 'type': 'argument_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'for_statement', 'children': ['77', '78', '79']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'schema'}; {'id': '79', 'type': 'block', 'children': ['80']}; {'id': '80', 'type': 'if_statement', 'children': ['81', '86', '96', '112']}; {'id': '81', 'type': 'call', 'children': ['82', '83']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '83', 'type': 'argument_list', 'children': ['84', '85']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '86', 'type': 'block', 'children': ['87']}; {'id': '87', 'type': 'expression_statement', 'children': ['88']}; {'id': '88', 'type': 'yield', 'children': ['89']}; {'id': '89', 'type': 'call', 'children': ['90', '91']}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '91', 'type': 'argument_list', 'children': ['92']}; {'id': '92', 'type': 'call', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': '_sort_schema'}; {'id': '94', 'type': 'argument_list', 'children': ['95']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '96', 'type': 'elif_clause', 'children': ['97', '102']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '102', 'type': 'block', 'children': ['103']}; {'id': '103', 'type': 'expression_statement', 'children': ['104']}; {'id': '104', 'type': 'yield', 'children': ['105']}; {'id': '105', 'type': 'call', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '107', 'type': 'argument_list', 'children': ['108']}; {'id': '108', 'type': 'call', 'children': ['109', '110']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': '_sort_schema'}; {'id': '110', 'type': 'argument_list', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '112', 'type': 'else_clause', 'children': ['113']}; {'id': '113', 'type': 'block', 'children': ['114']}; {'id': '114', 'type': 'expression_statement', 'children': ['115']}; {'id': '115', 'type': 'yield', 'children': ['116']}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '117', 'type': 'else_clause', 'children': ['118']}; {'id': '118', 'type': 'block', 'children': ['119']}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'yield', 'children': ['121']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'd'}
Recursively sorts a JSON schema by dict key.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'merge'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'elements'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '14', '22', '48']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "''' Merges all scraping results to a list sorted by frequency of occurrence. '''"}; {'id': '9', 'type': 'import_from_statement', 'children': ['10', '12']}; {'id': '10', 'type': 'dotted_name', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'collections'}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '14', 'type': 'import_from_statement', 'children': ['15', '18', '20']}; {'id': '15', 'type': 'dotted_name', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'lltk'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'utils'}; {'id': '18', 'type': 'dotted_name', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'list2tuple'}; {'id': '20', 'type': 'dotted_name', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'tuple2list'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'merged'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'tuple2list'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'list_comprehension', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '30', 'type': 'for_in_clause', 'children': ['31', '34']}; {'id': '31', 'type': 'pattern_list', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '34', 'type': 'call', 'children': ['35', '47']}; {'id': '35', 'type': 'attribute', 'children': ['36', '46']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'Counter'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'list2tuple'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'elements'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'most_common'}; {'id': '47', 'type': 'argument_list', 'children': []}; {'id': '48', 'type': 'return_statement', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'merged'}
Merges all scraping results to a list sorted by frequency of occurrence.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'natsorted'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'natcmp'}; {'id': '8', 'type': 'block', 'children': ['9', '11', '14', '23', '29']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': '"Returns a copy of seq, sorted by natural string sort."'}; {'id': '11', 'type': 'import_statement', 'children': ['12']}; {'id': '12', 'type': 'dotted_name', 'children': ['13']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '14', 'type': 'expression_statement', 'children': ['15']}; {'id': '15', 'type': 'assignment', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'copy'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'seq'}; {'id': '23', 'type': 'expression_statement', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'natsort'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'temp'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'cmp'}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'temp'}
Returns a copy of seq, sorted by natural string sort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort2groups'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'gpat'}; {'id': '7', 'type': 'list', 'children': ['8', '9'], 'value': "['_R1','_R2']"}; {'id': '8', 'type': 'string', 'children': [], 'value': "'_R1'"}; {'id': '9', 'type': 'string', 'children': [], 'value': "'_R2'"}; {'id': '10', 'type': 'block', 'children': ['11', '22', '26', '62']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '14', 'type': 'list_comprehension', 'children': ['15', '19']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'REGroup'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'gp'}; {'id': '19', 'type': 'for_in_clause', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'gp'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'gpat'}; {'id': '22', 'type': 'expression_statement', 'children': ['23']}; {'id': '23', 'type': 'assignment', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'unmatched'}; {'id': '25', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'array'}; {'id': '29', 'type': 'block', 'children': ['30', '34', '51']}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'matched'}; {'id': '33', 'type': 'False', 'children': []}; {'id': '34', 'type': 'for_statement', 'children': ['35', '36', '37']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'if_statement', 'children': ['39', '45']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '45', 'type': 'block', 'children': ['46', '50']}; {'id': '46', 'type': 'expression_statement', 'children': ['47']}; {'id': '47', 'type': 'assignment', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'matched'}; {'id': '49', 'type': 'True', 'children': []}; {'id': '50', 'type': 'break_statement', 'children': []}; {'id': '51', 'type': 'if_statement', 'children': ['52', '54']}; {'id': '52', 'type': 'not_operator', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'matched'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'unmatched'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '60', 'type': 'argument_list', 'children': ['61']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'item'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'expression_list', 'children': ['64', '74']}; {'id': '64', 'type': 'list_comprehension', 'children': ['65', '71']}; {'id': '65', 'type': 'call', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '67', 'type': 'argument_list', 'children': ['68']}; {'id': '68', 'type': 'attribute', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '71', 'type': 'for_in_clause', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '74', 'type': 'call', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '76', 'type': 'argument_list', 'children': ['77']}; {'id': '77', 'type': 'identifier', 'children': [], 'value': 'unmatched'}
Sort an array of strings to groups by patterns
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '12']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '9']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'typed_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '7', 'type': 'type', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'order'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'block', 'children': ['13', '21', '29', '35', '80']}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '16', 'type': 'subscript', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'header'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '26']}; {'id': '23', 'type': 'pattern_list', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'old_i'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'old_sort'}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sort_state'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'call', 'children': ['31', '34']}; {'id': '31', 'type': 'attribute', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'beginResetModel'}; {'id': '34', 'type': 'argument_list', 'children': []}; {'id': '35', 'type': 'if_statement', 'children': ['36', '39', '60']}; {'id': '36', 'type': 'comparison_operator', 'children': ['37', '38'], 'value': '=='}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'old_i'}; {'id': '39', 'type': 'block', 'children': ['40', '51']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '47']}; {'id': '42', 'type': 'attribute', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '47', 'type': 'argument_list', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '49', 'type': 'not_operator', 'children': ['50']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'old_sort'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'sort_state'}; {'id': '56', 'type': 'tuple', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '58', 'type': 'not_operator', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'old_sort'}; {'id': '60', 'type': 'else_clause', 'children': ['61']}; {'id': '61', 'type': 'block', 'children': ['62', '72']}; {'id': '62', 'type': 'expression_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '69']}; {'id': '64', 'type': 'attribute', 'children': ['65', '68']}; {'id': '65', 'type': 'attribute', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '69', 'type': 'argument_list', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'attr'}; {'id': '71', 'type': 'True', 'children': []}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'sort_state'}; {'id': '77', 'type': 'tuple', 'children': ['78', '79']}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'section'}; {'id': '79', 'type': 'True', 'children': []}; {'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': 'self'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'endResetModel'}; {'id': '85', 'type': 'argument_list', 'children': []}
Order is defined by the current state of sorting
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'set_collection'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '6', 'type': 'block', 'children': ['7', '13', '19', '28']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'beginResetModel'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '18']}; {'id': '15', 'type': 'attribute', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'collection'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '24']}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'sort_state'}; {'id': '24', 'type': 'tuple', 'children': ['25', '27']}; {'id': '25', 'type': 'unary_operator', 'children': ['26'], 'value': '-'}; {'id': '26', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '27', 'type': 'False', 'children': []}; {'id': '28', 'type': 'expression_statement', 'children': ['29']}; {'id': '29', 'type': 'call', 'children': ['30', '33']}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'endResetModel'}; {'id': '33', 'type': 'argument_list', 'children': []}
Reset sort state, set collection and emit resetModel signal
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_tags'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'c'}; {'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': 'tags_'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '32']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'tagstr'}; {'id': '12', 'type': 'call', 'children': ['13', '30']}; {'id': '13', 'type': 'attribute', 'children': ['14', '29']}; {'id': '14', 'type': 'call', 'children': ['15', '28']}; {'id': '15', 'type': 'attribute', 'children': ['16', '27']}; {'id': '16', 'type': 'attribute', 'children': ['17', '26']}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'run'}; {'id': '21', 'type': 'argument_list', 'children': ['22', '23']}; {'id': '22', 'type': 'string', 'children': [], 'value': '"git tag"'}; {'id': '23', 'type': 'keyword_argument', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'hide'}; {'id': '25', 'type': 'True', 'children': []}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'stdout'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'strip'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"\\n"'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'try_statement', 'children': ['34', '45']}; {'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': 'tags_'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '40', 'type': 'argument_list', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'Version'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'tagstr'}; {'id': '45', 'type': 'except_clause', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '47', 'type': 'block', 'children': ['48']}; {'id': '48', 'type': 'pass_statement', 'children': []}; {'id': '49', 'type': 'return_statement', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'tags_'}
Return sorted list of release-style tags as semver objects.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sortForSameExpTime'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'expTimes'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'img_paths'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '13', '43', '57']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'''\r\n return image paths sorted for same exposure time\r\n '''"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '12', 'type': 'dictionary', 'children': []}; {'id': '13', 'type': 'for_statement', 'children': ['14', '17', '22']}; {'id': '14', 'type': 'pattern_list', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '19', 'type': 'argument_list', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'expTimes'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'img_paths'}; {'id': '22', 'type': 'block', 'children': ['23', '34']}; {'id': '23', 'type': 'if_statement', 'children': ['24', '27']}; {'id': '24', 'type': 'comparison_operator', 'children': ['25', '26'], 'value': 'not'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'd'}; {'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': 'd'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '33', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '46', 'type': 'call', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'call', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '51', 'type': 'argument_list', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '56', 'type': 'argument_list', 'children': []}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'expression_list', 'children': ['59', '67']}; {'id': '59', 'type': 'call', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '61', 'type': 'argument_list', 'children': ['62']}; {'id': '62', 'type': 'call', 'children': ['63', '66']}; {'id': '63', 'type': 'attribute', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '66', 'type': 'argument_list', 'children': []}; {'id': '67', 'type': 'call', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '69', 'type': 'argument_list', 'children': ['70']}; {'id': '70', 'type': 'call', 'children': ['71', '74']}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '74', 'type': 'argument_list', 'children': []}
return image paths sorted for same exposure time
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '11']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'keys'}; {'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': 'key'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '10', 'type': 'False', 'children': []}; {'id': '11', 'type': 'block', 'children': ['12', '33']}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ks'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '27', '30']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'dict'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'keys'}; {'id': '25', 'type': 'argument_list', 'children': ['26']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '27', 'type': 'keyword_argument', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '30', 'type': 'keyword_argument', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '33', 'type': 'return_statement', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'ks'}
sort the keys before returning them
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_sort_converters'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'app_ready'}; {'id': '7', 'type': 'False', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '11', '21']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'string', 'children': [], 'value': "'''Sorts the converter functions'''"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': '_sorting_enabled'}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '20'], 'value': 'or'}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': '_sorting_enabled'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'app_ready'}; {'id': '21', 'type': 'if_statement', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_sorting_enabled'}; {'id': '25', 'type': 'block', 'children': ['26', '38']}; {'id': '26', 'type': 'for_statement', 'children': ['27', '28', '31']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'converter'}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'converters'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'call', 'children': ['34', '37']}; {'id': '34', 'type': 'attribute', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'converter'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'prepare_sort_key'}; {'id': '37', 'type': 'argument_list', 'children': []}; {'id': '38', 'type': 'expression_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '45']}; {'id': '40', 'type': 'attribute', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'cls'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'converters'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'keyword_argument', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '48', 'type': 'call', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'attrgetter'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'string', 'children': [], 'value': "'sort_key'"}
Sorts the converter functions
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_query'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '27', '45', '56']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'''\r\n Query tempalte for source Solr, sorts by id by default.\r\n '''"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '12', 'type': 'dictionary', 'children': ['13', '16', '19', '24']}; {'id': '13', 'type': 'pair', 'children': ['14', '15']}; {'id': '14', 'type': 'string', 'children': [], 'value': "'q'"}; {'id': '15', 'type': 'string', 'children': [], 'value': "'*:*'"}; {'id': '16', 'type': 'pair', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'sort'"}; {'id': '18', 'type': 'string', 'children': [], 'value': "'id desc'"}; {'id': '19', 'type': 'pair', 'children': ['20', '21']}; {'id': '20', 'type': 'string', 'children': [], 'value': "'rows'"}; {'id': '21', 'type': 'attribute', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_rows'}; {'id': '24', 'type': 'pair', 'children': ['25', '26']}; {'id': '25', 'type': 'string', 'children': [], 'value': "'cursorMark'"}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'cursor'}; {'id': '27', 'type': 'if_statement', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': '_date_field'}; {'id': '31', 'type': 'block', 'children': ['32']}; {'id': '32', 'type': 'expression_statement', 'children': ['33']}; {'id': '33', 'type': 'assignment', 'children': ['34', '37']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '36', 'type': 'string', 'children': [], 'value': "'sort'"}; {'id': '37', 'type': 'call', 'children': ['38', '41']}; {'id': '38', 'type': 'attribute', 'children': ['39', '40']}; {'id': '39', 'type': 'string', 'children': [], 'value': '"{} asc, id desc"'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': '_date_field'}; {'id': '45', 'type': 'if_statement', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': '_per_shard'}; {'id': '49', 'type': 'block', 'children': ['50']}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '55']}; {'id': '52', 'type': 'subscript', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '54', 'type': 'string', 'children': [], 'value': "'distrib'"}; {'id': '55', 'type': 'string', 'children': [], 'value': "'false'"}; {'id': '56', 'type': 'return_statement', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'query'}
Query tempalte for source Solr, sorts by id by default.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_queryset'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '8', '20', '29', '38']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'string', 'children': [], 'value': "'''Apply Datatables sort and search criterion to QuerySet'''"}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '11', 'type': 'call', 'children': ['12', '19']}; {'id': '12', 'type': 'attribute', 'children': ['13', '18']}; {'id': '13', 'type': 'call', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '15', 'type': 'argument_list', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'DatatablesView'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'get_queryset'}; {'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': 'qs'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'global_search'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '32', 'type': 'call', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'column_search'}; {'id': '36', 'type': 'argument_list', 'children': ['37']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'qs'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'order_by'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'list_splat', 'children': ['45']}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'get_orders'}; {'id': '49', 'type': 'argument_list', 'children': []}
Apply Datatables sort and search criterion to QuerySet
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'rangify'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'number_list'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '16', '24', '57', '66']}; {'id': '6', 'type': 'if_statement', 'children': ['7', '9']}; {'id': '7', 'type': 'not_operator', 'children': ['8']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'number_list'}; {'id': '9', 'type': 'block', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'number_list'}; {'id': '12', 'type': 'expression_statement', 'children': ['13']}; {'id': '13', 'type': 'assignment', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ranges'}; {'id': '15', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'assignment', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'range_start'}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'prev_num'}; {'id': '21', 'type': 'subscript', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'number_list'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'for_statement', 'children': ['25', '26', '31']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '26', 'type': 'subscript', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'number_list'}; {'id': '28', 'type': 'slice', 'children': ['29', '30']}; {'id': '29', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '30', 'type': 'colon', 'children': []}; {'id': '31', 'type': 'block', 'children': ['32', '53']}; {'id': '32', 'type': 'if_statement', 'children': ['33', '39']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': '!='}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '35', 'type': '()', 'children': ['36']}; {'id': '36', 'type': 'binary_operator', 'children': ['37', '38'], 'value': '+'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'prev_num'}; {'id': '38', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '39', 'type': 'block', 'children': ['40', '49']}; {'id': '40', 'type': 'expression_statement', 'children': ['41']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'ranges'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '45', 'type': 'argument_list', 'children': ['46']}; {'id': '46', 'type': 'tuple', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'range_start'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'prev_num'}; {'id': '49', 'type': 'expression_statement', 'children': ['50']}; {'id': '50', 'type': 'assignment', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'range_start'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'num'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'prev_num'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'num'}; {'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': 'ranges'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '62', 'type': 'argument_list', 'children': ['63']}; {'id': '63', 'type': 'tuple', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'range_start'}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'prev_num'}; {'id': '66', 'type': 'return_statement', 'children': ['67']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'ranges'}
Assumes the list is sorted.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_schemas'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'schemas'}; {'id': '5', 'type': 'block', 'children': ['6', '60']}; {'id': '6', 'type': 'function_definition', 'children': ['7', '8', '10']}; {'id': '7', 'type': 'function_name', 'children': [], 'value': 'keyfun'}; {'id': '8', 'type': 'parameters', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '10', 'type': 'block', 'children': ['11', '24']}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '14', 'type': 'call', 'children': ['15', '23']}; {'id': '15', 'type': 'attribute', 'children': ['16', '22']}; {'id': '16', 'type': 'call', 'children': ['17', '20']}; {'id': '17', 'type': 'attribute', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'SQL_SCHEMA_REGEXP'}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'match'}; {'id': '20', 'type': 'argument_list', 'children': ['21']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'groups'}; {'id': '23', 'type': 'argument_list', 'children': []}; {'id': '24', 'type': 'return_statement', 'children': ['25']}; {'id': '25', 'type': 'tuple', 'children': ['26', '32', '35', '46', '54']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'subscript', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '32', 'type': 'subscript', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '34', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '35', 'type': 'conditional_expression', 'children': ['36', '42', '45'], 'value': 'if'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'subscript', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '42', 'type': 'subscript', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '44', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '45', 'type': 'None', 'children': []}; {'id': '46', 'type': 'conditional_expression', 'children': ['47', '50', '53'], 'value': 'if'}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '50', 'type': 'subscript', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '52', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '53', 'type': 'string', 'children': [], 'value': "'zzz'"}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '59', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '60', 'type': 'return_statement', 'children': ['61']}; {'id': '61', 'type': 'call', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '63', 'type': 'argument_list', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'schemas'}; {'id': '65', 'type': 'keyword_argument', 'children': ['66', '67']}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'keyfun'}
Sort a list of SQL schemas in order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_nodes'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'dom'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'cmp_func'}; {'id': '6', 'type': 'block', 'children': ['7', '13']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'call', 'children': ['9', '12']}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'dom'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'normalize'}; {'id': '12', 'type': 'argument_list', 'children': []}; {'id': '13', 'type': 'for_statement', 'children': ['14', '15', '25']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '17', 'type': 'argument_list', 'children': ['18']}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'walk_dom'}; {'id': '20', 'type': 'argument_list', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'dom'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'elements_only'}; {'id': '24', 'type': 'True', 'children': []}; {'id': '25', 'type': 'block', 'children': ['26', '32']}; {'id': '26', 'type': 'expression_statement', 'children': ['27']}; {'id': '27', 'type': 'assignment', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'prev_sib'}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'previousSibling'}; {'id': '32', 'type': 'while_statement', 'children': ['33', '42']}; {'id': '33', 'type': 'boolean_operator', 'children': ['34', '35'], 'value': 'and'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'prev_sib'}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '41'], 'value': '=='}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'cmp_func'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'prev_sib'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '41', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '42', 'type': 'block', 'children': ['43', '53']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '50']}; {'id': '45', 'type': 'attribute', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'parentNode'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'insertBefore'}; {'id': '50', 'type': 'argument_list', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'prev_sib'}; {'id': '53', 'type': 'expression_statement', 'children': ['54']}; {'id': '54', 'type': 'assignment', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'prev_sib'}; {'id': '56', 'type': 'attribute', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'previousSibling'}
Sort the nodes of the dom in-place, based on a comparison function.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5', '15']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'toys'}; {'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': 'Tuple'}; {'id': '8', 'type': 'type_parameter', 'children': ['9', '13']}; {'id': '9', 'type': 'type', 'children': ['10']}; {'id': '10', 'type': 'attribute', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'timetools'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'TOY'}; {'id': '13', 'type': 'type', 'children': ['14']}; {'id': '14', 'type': 'ellipsis', 'children': [], 'value': '...'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '19', 'type': 'generator_expression', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'toy'}; {'id': '21', 'type': 'for_in_clause', 'children': ['22', '25']}; {'id': '22', 'type': 'tuple_pattern', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'toy'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'self'}
A sorted |tuple| of all contained |TOY| objects.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'solve_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'vars'}; {'id': '6', 'type': 'block', 'children': ['7', '24', '30', '50', '62']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'lhs_values'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'repeated'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'getvalues'}; {'id': '14', 'type': 'argument_list', 'children': ['15']}; {'id': '15', 'type': 'subscript', 'children': ['16', '23']}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': '__solve_for_repeated'}; {'id': '18', 'type': 'argument_list', 'children': ['19', '22']}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'lhs'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'vars'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'sort_expression'}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'rhs'}; {'id': '30', 'type': 'function_definition', 'children': ['31', '32', '34']}; {'id': '31', 'type': 'function_name', 'children': [], 'value': '_key_func'}; {'id': '32', 'type': 'parameters', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'attribute', 'children': ['37', '49']}; {'id': '37', 'type': 'call', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'solve'}; {'id': '39', 'type': 'argument_list', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'sort_expression'}; {'id': '41', 'type': 'call', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': '__nest_scope'}; {'id': '43', 'type': 'argument_list', 'children': ['44', '47', '48']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'expr'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'lhs'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'vars'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'value'}; {'id': '50', 'type': 'expression_statement', 'children': ['51']}; {'id': '51', 'type': 'assignment', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '53', 'type': 'call', 'children': ['54', '57']}; {'id': '54', 'type': 'attribute', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '57', 'type': 'argument_list', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'lhs_values'}; {'id': '59', 'type': 'keyword_argument', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'key_func'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_key_func'}; {'id': '62', 'type': 'return_statement', 'children': ['63']}; {'id': '63', 'type': 'call', 'children': ['64', '65']}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'Result'}; {'id': '65', 'type': 'argument_list', 'children': ['66', '73']}; {'id': '66', 'type': 'call', 'children': ['67', '70']}; {'id': '67', 'type': 'attribute', 'children': ['68', '69']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'repeated'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'meld'}; {'id': '70', 'type': 'argument_list', 'children': ['71']}; {'id': '71', 'type': 'list_splat', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '73', 'type': 'tuple', 'children': []}
Sort values on the LHS by the value they yield when passed to RHS.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'value_eq'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '6', 'type': 'block', 'children': ['7', '20', '34']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'self_sorted'}; {'id': '10', 'type': 'call', 'children': ['11', '14']}; {'id': '11', 'type': 'attribute', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'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': 'self'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'getvalues'}; {'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': 'other_sorted'}; {'id': '23', 'type': 'call', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'ordered'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '32']}; {'id': '29', 'type': 'attribute', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'repeated'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'getvalues'}; {'id': '32', 'type': 'argument_list', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'other'}; {'id': '34', 'type': 'return_statement', 'children': ['35']}; {'id': '35', 'type': 'comparison_operator', 'children': ['36', '37'], 'value': '=='}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self_sorted'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'other_sorted'}
Sorted comparison of values.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '10']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'pbar_strings'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '7', 'type': 'string', 'children': [], 'value': "''"}; {'id': '8', 'type': 'dictionary_splat_pattern', 'children': ['9']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '10', 'type': 'block', 'children': ['11']}; {'id': '11', 'type': 'return_statement', 'children': ['12']}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'tqdm'}; {'id': '14', 'type': 'argument_list', 'children': ['15', '29', '51', '54']}; {'id': '15', 'type': 'call', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '17', 'type': 'argument_list', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'files'}; {'id': '19', 'type': 'keyword_argument', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '21', 'type': 'lambda', 'children': ['22', '24']}; {'id': '22', 'type': 'lambda_parameters', 'children': ['23']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'lower'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'keyword_argument', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '31', 'type': '()', 'children': ['32']}; {'id': '32', 'type': 'binary_operator', 'children': ['33', '50'], 'value': '+'}; {'id': '33', 'type': 'binary_operator', 'children': ['34', '49'], 'value': '+'}; {'id': '34', 'type': 'binary_operator', 'children': ['35', '36'], 'value': '+'}; {'id': '35', 'type': 'string', 'children': [], 'value': "'<'"}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'call', 'children': ['40', '47']}; {'id': '40', 'type': 'attribute', 'children': ['41', '46']}; {'id': '41', 'type': 'call', 'children': ['42', '45']}; {'id': '42', 'type': 'attribute', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'datetime'}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'now'}; {'id': '45', 'type': 'argument_list', 'children': []}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'strftime'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'string', 'children': [], 'value': '"%Y-%m-%d %H:%M:%S"'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'> '"}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 'desc'}; {'id': '51', 'type': 'keyword_argument', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'dynamic_ncols'}; {'id': '53', 'type': 'True', 'children': []}; {'id': '54', 'type': 'dictionary_splat', 'children': ['55']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'kwargs'}
Wrapper for `tqdm` progress bar which also sorts list of strings
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_func'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '29', '40']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '=='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TIME'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'aaa'"}; {'id': '18', 'type': 'if_statement', 'children': ['19', '26']}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': '=='}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'DATA'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'zzy'"}; {'id': '29', 'type': 'if_statement', 'children': ['30', '37']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': '=='}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_KEYS'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'SOURCE'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'string', 'children': [], 'value': "'zzz'"}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'key'}
Logic for sorting keys in a `Spectrum` relative to one another.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_func'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '29']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '=='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'VALUE'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'aaa'"}; {'id': '18', 'type': 'if_statement', 'children': ['19', '26']}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': '=='}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'SOURCE'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'zzz'"}; {'id': '29', 'type': 'return_statement', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key'}
Sorting logic for `Quantity` objects.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_func'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '6', 'type': 'block', 'children': ['7', '18', '29', '40']}; {'id': '7', 'type': 'if_statement', 'children': ['8', '15']}; {'id': '8', 'type': 'comparison_operator', 'children': ['9', '10'], 'value': '=='}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'TIME'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'return_statement', 'children': ['17']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'aaa'"}; {'id': '18', 'type': 'if_statement', 'children': ['19', '26']}; {'id': '19', 'type': 'comparison_operator', 'children': ['20', '21'], 'value': '=='}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'key'}; {'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': '_KEYS'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'MODEL'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'return_statement', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'zzy'"}; {'id': '29', 'type': 'if_statement', 'children': ['30', '37']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32'], 'value': '=='}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '32', 'type': 'attribute', 'children': ['33', '36']}; {'id': '33', 'type': 'attribute', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': '_KEYS'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'SOURCE'}; {'id': '37', 'type': 'block', 'children': ['38']}; {'id': '38', 'type': 'return_statement', 'children': ['39']}; {'id': '39', 'type': 'string', 'children': [], 'value': "'zzz'"}; {'id': '40', 'type': 'return_statement', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'key'}
Specify order for attributes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '8']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_api_root_view'}; {'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': 'api_urls'}; {'id': '7', 'type': 'None', 'children': []}; {'id': '8', 'type': 'block', 'children': ['9', '15', '25', '47', '154']}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'api_root_dict'}; {'id': '12', 'type': 'call', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '14', 'type': 'argument_list', 'children': []}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'list_name'}; {'id': '18', 'type': 'attribute', 'children': ['19', '24']}; {'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': 'routes'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '25', 'type': 'for_statement', 'children': ['26', '30', '33']}; {'id': '26', 'type': 'pattern_list', 'children': ['27', '28', '29']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'viewset'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '30', 'type': 'attribute', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'registry'}; {'id': '33', 'type': 'block', 'children': ['34']}; {'id': '34', 'type': 'expression_statement', 'children': ['35']}; {'id': '35', 'type': 'assignment', 'children': ['36', '39']}; {'id': '36', 'type': 'subscript', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'api_root_dict'}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'prefix'}; {'id': '39', 'type': 'call', 'children': ['40', '43']}; {'id': '40', 'type': 'attribute', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'list_name'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '43', 'type': 'argument_list', 'children': ['44']}; {'id': '44', 'type': 'keyword_argument', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'basename'}; {'id': '47', 'type': 'class_definition', 'children': ['48', '49', '53']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'APIRootView'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'views'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'APIView'}; {'id': '53', 'type': 'block', 'children': ['54', '58', '62']}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'assignment', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': '_ignore_model_permissions'}; {'id': '57', 'type': 'True', 'children': []}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'exclude_from_schema'}; {'id': '61', 'type': 'True', 'children': []}; {'id': '62', 'type': 'function_definition', 'children': ['63', '64', '71']}; {'id': '63', 'type': 'function_name', 'children': [], 'value': 'get'}; {'id': '64', 'type': 'parameters', 'children': ['65', '66', '67', '69']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '67', 'type': 'list_splat_pattern', 'children': ['68']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '69', 'type': 'dictionary_splat_pattern', 'children': ['70']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '71', 'type': 'block', 'children': ['72', '78', '86', '149']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'assignment', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '75', 'type': 'call', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'OrderedDict'}; {'id': '77', 'type': 'argument_list', 'children': []}; {'id': '78', 'type': 'expression_statement', 'children': ['79']}; {'id': '79', 'type': 'assignment', 'children': ['80', '81']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '81', 'type': 'attribute', 'children': ['82', '85']}; {'id': '82', 'type': 'attribute', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'resolver_match'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '86', 'type': 'for_statement', 'children': ['87', '90', '104']}; {'id': '87', 'type': 'pattern_list', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'url_name'}; {'id': '90', 'type': 'call', 'children': ['91', '92']}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '92', 'type': 'argument_list', 'children': ['93', '98']}; {'id': '93', 'type': 'call', 'children': ['94', '97']}; {'id': '94', 'type': 'attribute', 'children': ['95', '96']}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'api_root_dict'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'items'}; {'id': '97', 'type': 'argument_list', 'children': []}; {'id': '98', 'type': 'keyword_argument', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '100', 'type': 'call', 'children': ['101', '102']}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'itemgetter'}; {'id': '102', 'type': 'argument_list', 'children': ['103']}; {'id': '103', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '104', 'type': 'block', 'children': ['105', '116']}; {'id': '105', 'type': 'if_statement', 'children': ['106', '107']}; {'id': '106', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '107', 'type': 'block', 'children': ['108']}; {'id': '108', 'type': 'expression_statement', 'children': ['109']}; {'id': '109', 'type': 'assignment', 'children': ['110', '111']}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'url_name'}; {'id': '111', 'type': 'binary_operator', 'children': ['112', '115'], 'value': '+'}; {'id': '112', 'type': 'binary_operator', 'children': ['113', '114'], 'value': '+'}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'namespace'}; {'id': '114', 'type': 'string', 'children': [], 'value': "':'"}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'url_name'}; {'id': '116', 'type': 'try_statement', 'children': ['117', '145']}; {'id': '117', 'type': 'block', 'children': ['118']}; {'id': '118', 'type': 'expression_statement', 'children': ['119']}; {'id': '119', 'type': 'assignment', 'children': ['120', '123']}; {'id': '120', 'type': 'subscript', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '122', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '123', 'type': 'call', 'children': ['124', '125']}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '125', 'type': 'argument_list', 'children': ['126', '127', '130', '133', '136']}; {'id': '126', 'type': 'identifier', 'children': [], 'value': 'url_name'}; {'id': '127', 'type': 'keyword_argument', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'args'}; {'id': '130', 'type': 'keyword_argument', 'children': ['131', '132']}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '132', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '133', 'type': 'keyword_argument', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'request'}; {'id': '136', 'type': 'keyword_argument', 'children': ['137', '138']}; {'id': '137', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '138', 'type': 'call', 'children': ['139', '142']}; {'id': '139', 'type': 'attribute', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'kwargs'}; {'id': '141', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '142', 'type': 'argument_list', 'children': ['143', '144']}; {'id': '143', 'type': 'string', 'children': [], 'value': "'format'"}; {'id': '144', 'type': 'None', 'children': []}; {'id': '145', 'type': 'except_clause', 'children': ['146', '147']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'NoReverseMatch'}; {'id': '147', 'type': 'block', 'children': ['148']}; {'id': '148', 'type': 'continue_statement', 'children': []}; {'id': '149', 'type': 'return_statement', 'children': ['150']}; {'id': '150', 'type': 'call', 'children': ['151', '152']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'Response'}; {'id': '152', 'type': 'argument_list', 'children': ['153']}; {'id': '153', 'type': 'identifier', 'children': [], 'value': 'ret'}; {'id': '154', 'type': 'return_statement', 'children': ['155']}; {'id': '155', 'type': 'call', 'children': ['156', '159']}; {'id': '156', 'type': 'attribute', 'children': ['157', '158']}; {'id': '157', 'type': 'identifier', 'children': [], 'value': 'APIRootView'}; {'id': '158', 'type': 'identifier', 'children': [], 'value': 'as_view'}; {'id': '159', 'type': 'argument_list', 'children': []}
Return a basic root view.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_default_base_name'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'viewset'}; {'id': '6', 'type': 'block', 'children': ['7', '16', '41']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'queryset'}; {'id': '10', 'type': 'call', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '12', 'type': 'argument_list', 'children': ['13', '14', '15']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'viewset'}; {'id': '14', 'type': 'string', 'children': [], 'value': "'queryset'"}; {'id': '15', 'type': 'None', 'children': []}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'is'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'queryset'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '32']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'get_url_name'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'getattr'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '30', '31']}; {'id': '27', 'type': 'attribute', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'queryset'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'model'}; {'id': '30', 'type': 'string', 'children': [], 'value': "'get_url_name'"}; {'id': '31', 'type': 'None', 'children': []}; {'id': '32', 'type': 'if_statement', 'children': ['33', '36']}; {'id': '33', 'type': 'comparison_operator', 'children': ['34', '35'], 'value': 'is'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'get_url_name'}; {'id': '35', 'type': 'None', 'children': []}; {'id': '36', 'type': 'block', 'children': ['37']}; {'id': '37', 'type': 'return_statement', 'children': ['38']}; {'id': '38', 'type': 'call', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'get_url_name'}; {'id': '40', 'type': 'argument_list', 'children': []}; {'id': '41', 'type': 'return_statement', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '50']}; {'id': '43', 'type': 'attribute', 'children': ['44', '49']}; {'id': '44', 'type': 'call', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'super'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '48']}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'SortedDefaultRouter'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'get_default_base_name'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'viewset'}
Attempt to automatically determine base name using `get_url_name`.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_compile_itemsort'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '7', '16', '27', '38', '50', '60', '79', '106']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'string', 'children': [], 'value': "'''return sort function of mappings'''"}; {'id': '7', 'type': 'function_definition', 'children': ['8', '9', '11']}; {'id': '8', 'type': 'function_name', 'children': [], 'value': 'is_extra'}; {'id': '9', 'type': 'parameters', 'children': ['10']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '11', 'type': 'block', 'children': ['12']}; {'id': '12', 'type': 'return_statement', 'children': ['13']}; {'id': '13', 'type': 'comparison_operator', 'children': ['14', '15'], 'value': 'is'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'Extra'}; {'id': '16', 'type': 'function_definition', 'children': ['17', '18', '20']}; {'id': '17', 'type': 'function_name', 'children': [], 'value': 'is_remove'}; {'id': '18', 'type': 'parameters', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'return_statement', 'children': ['22']}; {'id': '22', 'type': 'call', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '24', 'type': 'argument_list', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Remove'}; {'id': '27', 'type': 'function_definition', 'children': ['28', '29', '31']}; {'id': '28', 'type': 'function_name', 'children': [], 'value': 'is_marker'}; {'id': '29', 'type': 'parameters', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'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': 'isinstance'}; {'id': '35', 'type': 'argument_list', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'Marker'}; {'id': '38', 'type': 'function_definition', 'children': ['39', '40', '42']}; {'id': '39', 'type': 'function_name', 'children': [], 'value': 'is_type'}; {'id': '40', 'type': 'parameters', 'children': ['41']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'return_statement', 'children': ['44']}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'inspect'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'isclass'}; {'id': '48', 'type': 'argument_list', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '50', 'type': 'function_definition', 'children': ['51', '52', '54']}; {'id': '51', 'type': 'function_name', 'children': [], 'value': 'is_callable'}; {'id': '52', 'type': 'parameters', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '54', 'type': 'block', 'children': ['55']}; {'id': '55', 'type': 'return_statement', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'callable'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '60', 'type': 'expression_statement', 'children': ['61']}; {'id': '61', 'type': 'assignment', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '63', 'type': 'list', 'children': ['64', '67', '70', '73', '76'], 'value': '[(1, is_remove),\n (2, is_marker),\n (4, is_type),\n (3, is_callable),\n (5, is_extra)]'}; {'id': '64', 'type': 'tuple', 'children': ['65', '66']}; {'id': '65', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'is_remove'}; {'id': '67', 'type': 'tuple', 'children': ['68', '69']}; {'id': '68', 'type': 'integer', 'children': [], 'value': '2'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'is_marker'}; {'id': '70', 'type': 'tuple', 'children': ['71', '72']}; {'id': '71', 'type': 'integer', 'children': [], 'value': '4'}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'is_type'}; {'id': '73', 'type': 'tuple', 'children': ['74', '75']}; {'id': '74', 'type': 'integer', 'children': [], 'value': '3'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'is_callable'}; {'id': '76', 'type': 'tuple', 'children': ['77', '78']}; {'id': '77', 'type': 'integer', 'children': [], 'value': '5'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 'is_extra'}; {'id': '79', 'type': 'function_definition', 'children': ['80', '81', '83']}; {'id': '80', 'type': 'function_name', 'children': [], 'value': 'item_priority'}; {'id': '81', 'type': 'parameters', 'children': ['82']}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'item_'}; {'id': '83', 'type': 'block', 'children': ['84', '90', '104']}; {'id': '84', 'type': 'expression_statement', 'children': ['85']}; {'id': '85', 'type': 'assignment', 'children': ['86', '87']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '87', 'type': 'subscript', 'children': ['88', '89']}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'item_'}; {'id': '89', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '90', 'type': 'for_statement', 'children': ['91', '94', '95']}; {'id': '91', 'type': 'pattern_list', 'children': ['92', '93']}; {'id': '92', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'check_'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'priority'}; {'id': '95', 'type': 'block', 'children': ['96']}; {'id': '96', 'type': 'if_statement', 'children': ['97', '101']}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'check_'}; {'id': '99', 'type': 'argument_list', 'children': ['100']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'key_'}; {'id': '101', 'type': 'block', 'children': ['102']}; {'id': '102', 'type': 'return_statement', 'children': ['103']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '104', 'type': 'return_statement', 'children': ['105']}; {'id': '105', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '106', 'type': 'return_statement', 'children': ['107']}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'item_priority'}
return sort function of mappings
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'printNetwork'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'network'}; {'id': '5', 'type': 'block', 'children': ['6', '19']}; {'id': '6', 'type': 'print_statement', 'children': ['7', '8', '18']}; {'id': '7', 'type': 'string', 'children': [], 'value': '"The network has"'}; {'id': '8', 'type': 'call', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '10', 'type': 'argument_list', 'children': ['11']}; {'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': 'network'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '17', 'type': 'argument_list', 'children': []}; {'id': '18', 'type': 'string', 'children': [], 'value': '"regions"'}; {'id': '19', 'type': 'for_statement', 'children': ['20', '21', '29']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '21', 'type': 'call', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'call', 'children': ['25', '28']}; {'id': '25', 'type': 'attribute', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'network'}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'getMaxPhase'}; {'id': '28', 'type': 'argument_list', 'children': []}; {'id': '29', 'type': 'block', 'children': ['30', '33']}; {'id': '30', 'type': 'print_statement', 'children': ['31', '32']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"=== Phase"'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '33', 'type': 'for_statement', 'children': ['34', '35', '42']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '35', 'type': 'call', 'children': ['36', '41']}; {'id': '36', 'type': 'attribute', 'children': ['37', '40']}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'network'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'regions'}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'values'}; {'id': '41', 'type': 'argument_list', 'children': []}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'if_statement', 'children': ['44', '56']}; {'id': '44', 'type': 'comparison_operator', 'children': ['45', '55'], 'value': '=='}; {'id': '45', 'type': 'subscript', 'children': ['46', '54']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'network'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'getPhases'}; {'id': '50', 'type': 'argument_list', 'children': ['51']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '54', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'p'}; {'id': '56', 'type': 'block', 'children': ['57']}; {'id': '57', 'type': 'print_statement', 'children': ['58', '59']}; {'id': '58', 'type': 'string', 'children': [], 'value': '" "'}; {'id': '59', 'type': 'attribute', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'region'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'name'}
Given a network, print out regions sorted by phase
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_collapse'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'intervals'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '65']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '9', 'type': 'None', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '14', '15']}; {'id': '11', 'type': 'pattern_list', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'intervals'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'if_statement', 'children': ['17', '20', '29', '47']}; {'id': '17', 'type': 'comparison_operator', 'children': ['18', '19'], 'value': 'is'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '19', 'type': 'None', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21']}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': '_Interval'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '29', 'type': 'elif_clause', 'children': ['30', '36']}; {'id': '30', 'type': 'comparison_operator', 'children': ['31', '32', '35'], 'value': '<='}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'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': 'span'}; {'id': '40', 'type': 'call', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': '_Interval'}; {'id': '42', 'type': 'argument_list', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '47', 'type': 'elif_clause', 'children': ['48', '53']}; {'id': '48', 'type': 'comparison_operator', 'children': ['49', '50'], 'value': '>'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '50', 'type': 'attribute', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '53', 'type': 'block', 'children': ['54', '57']}; {'id': '54', 'type': 'expression_statement', 'children': ['55']}; {'id': '55', 'type': 'yield', 'children': ['56']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '57', 'type': 'expression_statement', 'children': ['58']}; {'id': '58', 'type': 'assignment', 'children': ['59', '60']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '60', 'type': 'call', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': '_Interval'}; {'id': '62', 'type': 'argument_list', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '65', 'type': 'if_statement', 'children': ['66', '69']}; {'id': '66', 'type': 'comparison_operator', 'children': ['67', '68'], 'value': 'is'}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'span'}; {'id': '68', 'type': 'None', 'children': []}; {'id': '69', 'type': 'block', 'children': ['70']}; {'id': '70', 'type': 'expression_statement', 'children': ['71']}; {'id': '71', 'type': 'yield', 'children': ['72']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'span'}
Collapse an iterable of intervals sorted by start coord.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_number_finder'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'numconv'}; {'id': '7', 'type': 'block', 'children': ['8', '17', '30', '37', '64']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '11', 'type': 'call', 'children': ['12', '15']}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'regex'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'split'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '17', 'type': 'if_statement', 'children': ['18', '24']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '23'], 'value': '=='}; {'id': '19', 'type': 'call', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '21', 'type': 'argument_list', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '23', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '24', 'type': 'block', 'children': ['25']}; {'id': '25', 'type': 'return_statement', 'children': ['26']}; {'id': '26', 'type': 'call', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'tuple'}; {'id': '28', 'type': 'argument_list', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '30', 'type': 'expression_statement', 'children': ['31']}; {'id': '31', 'type': 'assignment', 'children': ['32', '33']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '33', 'type': 'call', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'remove_empty'}; {'id': '35', 'type': 'argument_list', 'children': ['36']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '37', 'type': 'for_statement', 'children': ['38', '39', '46']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '39', 'type': 'call', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '41', 'type': 'argument_list', 'children': ['42']}; {'id': '42', 'type': 'call', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '46', 'type': 'block', 'children': ['47']}; {'id': '47', 'type': 'try_statement', 'children': ['48', '60']}; {'id': '48', 'type': 'block', 'children': ['49']}; {'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': 's'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'numconv'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'subscript', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '60', 'type': 'except_clause', 'children': ['61', '62']}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '62', 'type': 'block', 'children': ['63']}; {'id': '63', 'type': 'pass_statement', 'children': []}; {'id': '64', 'type': 'if_statement', 'children': ['65', '75', '81']}; {'id': '65', 'type': 'not_operator', 'children': ['66']}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '72']}; {'id': '69', 'type': 'subscript', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '71', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '72', 'type': 'attribute', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'six'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'string_types'}; {'id': '75', 'type': 'block', 'children': ['76']}; {'id': '76', 'type': 'return_statement', 'children': ['77']}; {'id': '77', 'type': 'binary_operator', 'children': ['78', '80'], 'value': '+'}; {'id': '78', 'type': 'list', 'children': ['79'], 'value': "['']"}; {'id': '79', 'type': 'string', 'children': [], 'value': "''"}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '81', 'type': 'else_clause', 'children': ['82']}; {'id': '82', 'type': 'block', 'children': ['83']}; {'id': '83', 'type': 'return_statement', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 's'}
Helper to split numbers
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '4']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'generate_help'}; {'id': '3', 'type': 'parameters', 'children': []}; {'id': '4', 'type': 'block', 'children': ['5', '9', '19', '57']}; {'id': '5', 'type': 'expression_statement', 'children': ['6']}; {'id': '6', 'type': 'assignment', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'help_text'}; {'id': '8', 'type': 'string', 'children': [], 'value': "'\\nAvailable recipes:\\n\\n'"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'recipes'}; {'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': 'config'}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'Config'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'get_registered_recipes'}; {'id': '18', 'type': 'argument_list', 'children': []}; {'id': '19', 'type': 'for_statement', 'children': ['20', '24', '38']}; {'id': '20', 'type': 'pattern_list', 'children': ['21', '22', '23']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '23', 'type': 'identifier', 'children': [], 'value': '_'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'recipes'}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '30', 'type': 'lambda', 'children': ['31', '33']}; {'id': '31', 'type': 'lambda_parameters', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '33', 'type': 'subscript', 'children': ['34', '37']}; {'id': '34', 'type': 'subscript', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '36', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '37', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '38', 'type': 'block', 'children': ['39']}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'augmented_assignment', 'children': ['41', '42'], 'value': '+='}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'help_text'}; {'id': '42', 'type': 'call', 'children': ['43', '46']}; {'id': '43', 'type': 'attribute', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "' {0:<35s}{1:s}\\n'"}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'format'}; {'id': '46', 'type': 'argument_list', 'children': ['47', '50']}; {'id': '47', 'type': 'subscript', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '49', 'type': 'string', 'children': [], 'value': "'name'"}; {'id': '50', 'type': 'call', 'children': ['51', '54']}; {'id': '51', 'type': 'attribute', 'children': ['52', '53']}; {'id': '52', 'type': 'identifier', 'children': [], 'value': 'contents'}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '54', 'type': 'argument_list', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': "'short_description'"}; {'id': '56', 'type': 'string', 'children': [], 'value': "'No description'"}; {'id': '57', 'type': 'return_statement', 'children': ['58']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'help_text'}
Generates help text with alphabetically sorted recipes.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_source_files'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '11', '15', '52']}; {'id': '6', 'type': 'assert_statement', 'children': ['7', '10']}; {'id': '7', 'type': 'attribute', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'final'}; {'id': '10', 'type': 'string', 'children': [], 'value': "'Call build() before using the graph.'"}; {'id': '11', 'type': 'expression_statement', 'children': ['12']}; {'id': '12', 'type': 'assignment', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '14', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '15', 'type': 'for_statement', 'children': ['16', '17', '25']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '17', 'type': 'call', 'children': ['18', '21']}; {'id': '18', 'type': 'attribute', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'nx'}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'topological_sort'}; {'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': 'graph'}; {'id': '25', 'type': 'block', 'children': ['26']}; {'id': '26', 'type': 'if_statement', 'children': ['27', '32', '42']}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '29', 'type': 'argument_list', 'children': ['30', '31']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'NodeSet'}; {'id': '32', 'type': 'block', 'children': ['33']}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'out'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'nodes'}; {'id': '42', 'type': 'else_clause', 'children': ['43']}; {'id': '43', 'type': 'block', 'children': ['44']}; {'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': 'out'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'list', 'children': ['51'], 'value': '[node]'}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'node'}; {'id': '52', 'type': 'return_statement', 'children': ['53']}; {'id': '53', 'type': 'call', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '55', 'type': 'argument_list', 'children': ['56']}; {'id': '56', 'type': 'call', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'reversed'}; {'id': '58', 'type': 'argument_list', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'out'}
Returns a list of targets in topologically sorted order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'run'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '12', '33', '39', '45', '51', '58', '78', '99', '119', '133', '162', '181', '199', '224']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '9', 'type': 'attribute', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'query'}; {'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': 'cardinality'}; {'id': '17', 'type': 'call', 'children': ['18', '32']}; {'id': '18', 'type': 'attribute', 'children': ['19', '31']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'add_columns'}; {'id': '23', 'type': 'argument_list', 'children': ['24']}; {'id': '24', 'type': 'attribute', 'children': ['25', '30']}; {'id': '25', 'type': 'subscript', 'children': ['26', '29']}; {'id': '26', 'type': 'attribute', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '29', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sqla_expr'}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'count'}; {'id': '32', 'type': 'argument_list', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'call', 'children': ['35', '38']}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': '_set_column_filter_expressions'}; {'id': '38', 'type': 'argument_list', 'children': []}; {'id': '39', 'type': 'expression_statement', 'children': ['40']}; {'id': '40', 'type': 'call', 'children': ['41', '44']}; {'id': '41', 'type': 'attribute', 'children': ['42', '43']}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': '_set_global_filter_expression'}; {'id': '44', 'type': 'argument_list', 'children': []}; {'id': '45', 'type': 'expression_statement', 'children': ['46']}; {'id': '46', 'type': 'call', 'children': ['47', '50']}; {'id': '47', 'type': 'attribute', 'children': ['48', '49']}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '49', 'type': 'identifier', 'children': [], 'value': '_set_sort_expressions'}; {'id': '50', 'type': 'argument_list', 'children': []}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'call', 'children': ['53', '56']}; {'id': '53', 'type': 'attribute', 'children': ['54', '55']}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '55', 'type': 'identifier', 'children': [], 'value': '_set_yadcf_data'}; {'id': '56', 'type': 'argument_list', 'children': ['57']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '58', 'type': 'expression_statement', 'children': ['59']}; {'id': '59', 'type': 'assignment', 'children': ['60', '61']}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '61', 'type': 'call', 'children': ['62', '65']}; {'id': '62', 'type': 'attribute', 'children': ['63', '64']}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '64', 'type': 'identifier', 'children': [], 'value': 'filter'}; {'id': '65', 'type': 'argument_list', 'children': ['66']}; {'id': '66', 'type': 'list_splat', 'children': ['67']}; {'id': '67', 'type': 'list_comprehension', 'children': ['68', '69', '74']}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '69', 'type': 'for_in_clause', 'children': ['70', '71']}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '71', 'type': 'attribute', 'children': ['72', '73']}; {'id': '72', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'filter_expressions'}; {'id': '74', 'type': 'if_clause', 'children': ['75']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'is'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '77', 'type': 'None', 'children': []}; {'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': 'self'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'cardinality_filtered'}; {'id': '83', 'type': 'call', 'children': ['84', '98']}; {'id': '84', 'type': 'attribute', 'children': ['85', '97']}; {'id': '85', 'type': 'call', 'children': ['86', '89']}; {'id': '86', 'type': 'attribute', 'children': ['87', '88']}; {'id': '87', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '88', 'type': 'identifier', 'children': [], 'value': 'add_columns'}; {'id': '89', 'type': 'argument_list', 'children': ['90']}; {'id': '90', 'type': 'attribute', 'children': ['91', '96']}; {'id': '91', 'type': 'subscript', 'children': ['92', '95']}; {'id': '92', 'type': 'attribute', 'children': ['93', '94']}; {'id': '93', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '94', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '95', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'sqla_expr'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'count'}; {'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': 'query'}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'order_by'}; {'id': '106', 'type': 'argument_list', 'children': ['107']}; {'id': '107', 'type': 'list_splat', 'children': ['108']}; {'id': '108', 'type': 'list_comprehension', 'children': ['109', '110', '115']}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '110', 'type': 'for_in_clause', 'children': ['111', '112']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '112', 'type': 'attribute', 'children': ['113', '114']}; {'id': '113', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '114', 'type': 'identifier', 'children': [], 'value': 'sort_expressions'}; {'id': '115', 'type': 'if_clause', 'children': ['116']}; {'id': '116', 'type': 'comparison_operator', 'children': ['117', '118'], 'value': 'is'}; {'id': '117', 'type': 'identifier', 'children': [], 'value': 'e'}; {'id': '118', 'type': 'None', 'children': []}; {'id': '119', 'type': 'expression_statement', 'children': ['120']}; {'id': '120', 'type': 'assignment', 'children': ['121', '122']}; {'id': '121', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '122', 'type': 'call', 'children': ['123', '124']}; {'id': '123', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '124', 'type': 'argument_list', 'children': ['125']}; {'id': '125', 'type': 'call', 'children': ['126', '131']}; {'id': '126', 'type': 'attribute', 'children': ['127', '130']}; {'id': '127', 'type': 'attribute', 'children': ['128', '129']}; {'id': '128', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '129', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '131', 'type': 'argument_list', 'children': ['132']}; {'id': '132', 'type': 'string', 'children': [], 'value': "'length'"}; {'id': '133', 'type': 'if_statement', 'children': ['134', '137', '147', '154']}; {'id': '134', 'type': 'comparison_operator', 'children': ['135', '136'], 'value': '>='}; {'id': '135', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '136', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '137', 'type': 'block', 'children': ['138']}; {'id': '138', 'type': 'expression_statement', 'children': ['139']}; {'id': '139', 'type': 'assignment', 'children': ['140', '141']}; {'id': '140', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '141', 'type': 'call', 'children': ['142', '145']}; {'id': '142', 'type': 'attribute', 'children': ['143', '144']}; {'id': '143', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '144', 'type': 'identifier', 'children': [], 'value': 'limit'}; {'id': '145', 'type': 'argument_list', 'children': ['146']}; {'id': '146', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '147', 'type': 'elif_clause', 'children': ['148', '152']}; {'id': '148', 'type': 'comparison_operator', 'children': ['149', '150'], 'value': '=='}; {'id': '149', 'type': 'identifier', 'children': [], 'value': 'length'}; {'id': '150', 'type': 'unary_operator', 'children': ['151'], 'value': '-'}; {'id': '151', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '152', 'type': 'block', 'children': ['153']}; {'id': '153', 'type': 'pass_statement', 'children': []}; {'id': '154', 'type': 'else_clause', 'children': ['155']}; {'id': '155', 'type': 'block', 'children': ['156']}; {'id': '156', 'type': 'raise_statement', 'children': ['157']}; {'id': '157', 'type': '()', 'children': ['158']}; {'id': '158', 'type': 'call', 'children': ['159', '160']}; {'id': '159', 'type': 'identifier', 'children': [], 'value': 'ValueError'}; {'id': '160', 'type': 'argument_list', 'children': ['161']}; {'id': '161', 'type': 'string', 'children': [], 'value': "'Length should be a positive integer or -1 to disable'"}; {'id': '162', 'type': 'expression_statement', 'children': ['163']}; {'id': '163', 'type': 'assignment', 'children': ['164', '165']}; {'id': '164', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '165', 'type': 'call', 'children': ['166', '169']}; {'id': '166', 'type': 'attribute', 'children': ['167', '168']}; {'id': '167', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '168', 'type': 'identifier', 'children': [], 'value': 'offset'}; {'id': '169', 'type': 'argument_list', 'children': ['170']}; {'id': '170', 'type': 'call', 'children': ['171', '172']}; {'id': '171', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '172', 'type': 'argument_list', 'children': ['173']}; {'id': '173', 'type': 'call', 'children': ['174', '179']}; {'id': '174', 'type': 'attribute', 'children': ['175', '178']}; {'id': '175', 'type': 'attribute', 'children': ['176', '177']}; {'id': '176', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '177', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '178', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '179', 'type': 'argument_list', 'children': ['180']}; {'id': '180', 'type': 'string', 'children': [], 'value': "'start'"}; {'id': '181', 'type': 'expression_statement', 'children': ['182']}; {'id': '182', 'type': 'assignment', 'children': ['183', '184']}; {'id': '183', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '184', 'type': 'call', 'children': ['185', '188']}; {'id': '185', 'type': 'attribute', 'children': ['186', '187']}; {'id': '186', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '187', 'type': 'identifier', 'children': [], 'value': 'add_columns'}; {'id': '188', 'type': 'argument_list', 'children': ['189']}; {'id': '189', 'type': 'list_splat', 'children': ['190']}; {'id': '190', 'type': 'list_comprehension', 'children': ['191', '194']}; {'id': '191', 'type': 'attribute', 'children': ['192', '193']}; {'id': '192', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '193', 'type': 'identifier', 'children': [], 'value': 'sqla_expr'}; {'id': '194', 'type': 'for_in_clause', 'children': ['195', '196']}; {'id': '195', 'type': 'identifier', 'children': [], 'value': 'c'}; {'id': '196', 'type': 'attribute', 'children': ['197', '198']}; {'id': '197', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '198', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '199', 'type': 'expression_statement', 'children': ['200']}; {'id': '200', 'type': 'assignment', 'children': ['201', '202']}; {'id': '201', 'type': 'identifier', 'children': [], 'value': 'column_names'}; {'id': '202', 'type': 'list_comprehension', 'children': ['203', '214']}; {'id': '203', 'type': 'conditional_expression', 'children': ['204', '207', '210'], 'value': 'if'}; {'id': '204', 'type': 'attribute', 'children': ['205', '206']}; {'id': '205', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '206', 'type': 'identifier', 'children': [], 'value': 'mData'}; {'id': '207', 'type': 'attribute', 'children': ['208', '209']}; {'id': '208', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '209', 'type': 'identifier', 'children': [], 'value': 'mData'}; {'id': '210', 'type': 'call', 'children': ['211', '212']}; {'id': '211', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '212', 'type': 'argument_list', 'children': ['213']}; {'id': '213', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '214', 'type': 'for_in_clause', 'children': ['215', '218']}; {'id': '215', 'type': 'pattern_list', 'children': ['216', '217']}; {'id': '216', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '217', 'type': 'identifier', 'children': [], 'value': 'col'}; {'id': '218', 'type': 'call', 'children': ['219', '220']}; {'id': '219', 'type': 'identifier', 'children': [], 'value': 'enumerate'}; {'id': '220', 'type': 'argument_list', 'children': ['221']}; {'id': '221', 'type': 'attribute', 'children': ['222', '223']}; {'id': '222', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '223', 'type': 'identifier', 'children': [], 'value': 'columns'}; {'id': '224', 'type': 'expression_statement', 'children': ['225']}; {'id': '225', 'type': 'assignment', 'children': ['226', '229']}; {'id': '226', 'type': 'attribute', 'children': ['227', '228']}; {'id': '227', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '228', 'type': 'identifier', 'children': [], 'value': 'results'}; {'id': '229', 'type': 'list_comprehension', 'children': ['230', '243']}; {'id': '230', 'type': 'dictionary_comprehension', 'children': ['231', '234']}; {'id': '231', 'type': 'pair', 'children': ['232', '233']}; {'id': '232', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '233', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '234', 'type': 'for_in_clause', 'children': ['235', '238']}; {'id': '235', 'type': 'pattern_list', 'children': ['236', '237']}; {'id': '236', 'type': 'identifier', 'children': [], 'value': 'k'}; {'id': '237', 'type': 'identifier', 'children': [], 'value': 'v'}; {'id': '238', 'type': 'call', 'children': ['239', '240']}; {'id': '239', 'type': 'identifier', 'children': [], 'value': 'zip'}; {'id': '240', 'type': 'argument_list', 'children': ['241', '242']}; {'id': '241', 'type': 'identifier', 'children': [], 'value': 'column_names'}; {'id': '242', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '243', 'type': 'for_in_clause', 'children': ['244', '245']}; {'id': '244', 'type': 'identifier', 'children': [], 'value': 'row'}; {'id': '245', 'type': 'call', 'children': ['246', '249']}; {'id': '246', 'type': 'attribute', 'children': ['247', '248']}; {'id': '247', 'type': 'identifier', 'children': [], 'value': 'query'}; {'id': '248', 'type': 'identifier', 'children': [], 'value': 'all'}; {'id': '249', 'type': 'argument_list', 'children': []}
Launch filtering, sorting and paging to output results.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sorted_proposal_list'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '31', '35', '85']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'proposals'}; {'id': '9', 'type': 'dictionary', 'children': []}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'proposals'}; {'id': '15', 'type': 'block', 'children': ['16']}; {'id': '16', 'type': 'expression_statement', 'children': ['17']}; {'id': '17', 'type': 'call', 'children': ['18', '29']}; {'id': '18', 'type': 'attribute', 'children': ['19', '28']}; {'id': '19', 'type': 'call', 'children': ['20', '23']}; {'id': '20', 'type': 'attribute', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'proposals'}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'setdefault'}; {'id': '23', 'type': 'argument_list', 'children': ['24', '27']}; {'id': '24', 'type': 'attribute', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '27', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '34', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '35', 'type': 'for_statement', 'children': ['36', '37', '40']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '37', 'type': 'attribute', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'scopepref'}; {'id': '40', 'type': 'block', 'children': ['41', '51', '67', '78']}; {'id': '41', 'type': 'expression_statement', 'children': ['42']}; {'id': '42', 'type': 'assignment', 'children': ['43', '44']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'scope_proposals'}; {'id': '44', 'type': 'call', 'children': ['45', '48']}; {'id': '45', 'type': 'attribute', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'proposals'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '48', 'type': 'argument_list', 'children': ['49', '50']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'scope'}; {'id': '50', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'scope_proposals'}; {'id': '54', 'type': 'list_comprehension', 'children': ['55', '56', '59']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '56', 'type': 'for_in_clause', 'children': ['57', '58']}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'scope_proposals'}; {'id': '59', 'type': 'if_clause', 'children': ['60']}; {'id': '60', 'type': 'comparison_operator', 'children': ['61', '64'], 'value': 'in'}; {'id': '61', 'type': 'attribute', 'children': ['62', '63']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'proposal'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'type'}; {'id': '64', 'type': 'attribute', 'children': ['65', '66']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '66', 'type': 'identifier', 'children': [], 'value': 'typerank'}; {'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': 'scope_proposals'}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '72', 'type': 'argument_list', 'children': ['73']}; {'id': '73', 'type': 'keyword_argument', 'children': ['74', '75']}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '75', 'type': 'attribute', 'children': ['76', '77']}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '77', 'type': 'identifier', 'children': [], 'value': '_proposal_key'}; {'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': 'result'}; {'id': '82', 'type': 'identifier', 'children': [], 'value': 'extend'}; {'id': '83', 'type': 'argument_list', 'children': ['84']}; {'id': '84', 'type': 'identifier', 'children': [], 'value': 'scope_proposals'}; {'id': '85', 'type': 'return_statement', 'children': ['86']}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'result'}
Return a list of `CodeAssistProposal`
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '7']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_get_sorting_key_values'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'array1'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'array2'}; {'id': '7', 'type': 'block', 'children': ['8', '19', '28']}; {'id': '8', 'type': 'expression_statement', 'children': ['9']}; {'id': '9', 'type': 'assignment', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'concat_arrays'}; {'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': 'concatenate'}; {'id': '15', 'type': 'argument_list', 'children': ['16']}; {'id': '16', 'type': 'list', 'children': ['17', '18'], 'value': '[array1, array2]'}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'array1'}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'array2'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'unique_values'}; {'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': 'unique'}; {'id': '26', 'type': 'argument_list', 'children': ['27']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'concat_arrays'}; {'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': 'numpy'}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '33', 'type': 'argument_list', 'children': ['34']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'unique_values'}
return the sorting key values as a series
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_reverse_chronologically'}; {'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': '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': 'measurements'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '13', 'type': 'argument_list', 'children': ['14', '22']}; {'id': '14', 'type': 'keyword_argument', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'key'}; {'id': '16', 'type': 'lambda', 'children': ['17', '19']}; {'id': '17', 'type': 'lambda_parameters', 'children': ['18']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '19', 'type': 'attribute', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'm'}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'timestamp'}; {'id': '22', 'type': 'keyword_argument', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'reverse'}; {'id': '24', 'type': 'True', 'children': []}
Sorts the measurements of this buffer in reverse chronological order
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_key'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'val'}; {'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': 'numpy'}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'sum'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'binary_operator', 'children': ['13', '36'], 'value': '*'}; {'id': '13', 'type': 'binary_operator', 'children': ['14', '21'], 'value': '**'}; {'id': '14', 'type': '()', 'children': ['15']}; {'id': '15', 'type': 'binary_operator', 'children': ['16', '20'], 'value': '+'}; {'id': '16', 'type': 'call', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'max'}; {'id': '18', 'type': 'argument_list', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '20', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '21', 'type': 'call', 'children': ['22', '25']}; {'id': '22', 'type': 'attribute', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'numpy'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'arange'}; {'id': '25', 'type': 'argument_list', 'children': ['26', '32', '34']}; {'id': '26', 'type': 'binary_operator', 'children': ['27', '31'], 'value': '-'}; {'id': '27', 'type': 'call', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'len'}; {'id': '29', 'type': 'argument_list', 'children': ['30']}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'val'}; {'id': '31', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '32', 'type': 'unary_operator', 'children': ['33'], 'value': '-'}; {'id': '33', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '34', 'type': 'unary_operator', 'children': ['35'], 'value': '-'}; {'id': '35', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'val'}
Sort key for sorting keys in grevlex order.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '23']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'GetCredentials'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6', '7', '8', '9', '12', '15', '18', '21']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'package_name'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'scopes'}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'client_id'}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'client_secret'}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'user_agent'}; {'id': '9', 'type': 'default_parameter', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'credentials_filename'}; {'id': '11', 'type': 'None', 'children': []}; {'id': '12', 'type': 'default_parameter', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'api_key'}; {'id': '14', 'type': 'None', 'children': []}; {'id': '15', 'type': 'default_parameter', 'children': ['16', '17']}; {'id': '16', 'type': 'identifier', 'children': [], 'value': 'client'}; {'id': '17', 'type': 'None', 'children': []}; {'id': '18', 'type': 'default_parameter', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'oauth2client_args'}; {'id': '20', 'type': 'None', 'children': []}; {'id': '21', 'type': 'dictionary_splat_pattern', 'children': ['22']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'kwds'}; {'id': '23', 'type': 'block', 'children': ['24', '33', '61', '81', '94', '105', '112']}; {'id': '24', 'type': 'expression_statement', 'children': ['25']}; {'id': '25', 'type': 'assignment', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'scopes'}; {'id': '27', 'type': 'call', 'children': ['28', '31']}; {'id': '28', 'type': 'attribute', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'util'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'NormalizeScopes'}; {'id': '31', 'type': 'argument_list', 'children': ['32']}; {'id': '32', 'type': 'identifier', 'children': [], 'value': 'scopes'}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'client_info'}; {'id': '36', 'type': 'dictionary', 'children': ['37', '40', '43', '54']}; {'id': '37', 'type': 'pair', 'children': ['38', '39']}; {'id': '38', 'type': 'string', 'children': [], 'value': "'client_id'"}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'client_id'}; {'id': '40', 'type': 'pair', 'children': ['41', '42']}; {'id': '41', 'type': 'string', 'children': [], 'value': "'client_secret'"}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'client_secret'}; {'id': '43', 'type': 'pair', 'children': ['44', '45']}; {'id': '44', 'type': 'string', 'children': [], 'value': "'scope'"}; {'id': '45', 'type': 'call', 'children': ['46', '49']}; {'id': '46', 'type': 'attribute', 'children': ['47', '48']}; {'id': '47', 'type': 'string', 'children': [], 'value': "' '"}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'id': '50', 'type': 'call', 'children': ['51', '52']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '52', 'type': 'argument_list', 'children': ['53']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'scopes'}; {'id': '54', 'type': 'pair', 'children': ['55', '56']}; {'id': '55', 'type': 'string', 'children': [], 'value': "'user_agent'"}; {'id': '56', 'type': 'boolean_operator', 'children': ['57', '58'], 'value': 'or'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'user_agent'}; {'id': '58', 'type': 'binary_operator', 'children': ['59', '60'], 'value': '%'}; {'id': '59', 'type': 'string', 'children': [], 'value': "'%s-generated/0.1'"}; {'id': '60', 'type': 'identifier', 'children': [], 'value': 'package_name'}; {'id': '61', 'type': 'for_statement', 'children': ['62', '63', '64']}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': '_CREDENTIALS_METHODS'}; {'id': '64', 'type': 'block', 'children': ['65', '74']}; {'id': '65', 'type': 'expression_statement', 'children': ['66']}; {'id': '66', 'type': 'assignment', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '68', 'type': 'call', 'children': ['69', '70']}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 'method'}; {'id': '70', 'type': 'argument_list', 'children': ['71', '72']}; {'id': '71', 'type': 'identifier', 'children': [], 'value': 'client_info'}; {'id': '72', 'type': 'dictionary_splat', 'children': ['73']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 'kwds'}; {'id': '74', 'type': 'if_statement', 'children': ['75', '78']}; {'id': '75', 'type': 'comparison_operator', 'children': ['76', '77'], 'value': 'is'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '77', 'type': 'None', 'children': []}; {'id': '78', 'type': 'block', 'children': ['79']}; {'id': '79', 'type': 'return_statement', 'children': ['80']}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '81', 'type': 'expression_statement', 'children': ['82']}; {'id': '82', 'type': 'assignment', 'children': ['83', '84']}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'credentials_filename'}; {'id': '84', 'type': 'boolean_operator', 'children': ['85', '86'], 'value': 'or'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'credentials_filename'}; {'id': '86', 'type': 'call', 'children': ['87', '92']}; {'id': '87', 'type': 'attribute', 'children': ['88', '91']}; {'id': '88', 'type': 'attribute', 'children': ['89', '90']}; {'id': '89', 'type': 'identifier', 'children': [], 'value': 'os'}; {'id': '90', 'type': 'identifier', 'children': [], 'value': 'path'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'expanduser'}; {'id': '92', 'type': 'argument_list', 'children': ['93']}; {'id': '93', 'type': 'string', 'children': [], 'value': "'~/.apitools.token'"}; {'id': '94', 'type': 'expression_statement', 'children': ['95']}; {'id': '95', 'type': 'assignment', 'children': ['96', '97']}; {'id': '96', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '97', 'type': 'call', 'children': ['98', '99']}; {'id': '98', 'type': 'identifier', 'children': [], 'value': 'CredentialsFromFile'}; {'id': '99', 'type': 'argument_list', 'children': ['100', '101', '102']}; {'id': '100', 'type': 'identifier', 'children': [], 'value': 'credentials_filename'}; {'id': '101', 'type': 'identifier', 'children': [], 'value': 'client_info'}; {'id': '102', 'type': 'keyword_argument', 'children': ['103', '104']}; {'id': '103', 'type': 'identifier', 'children': [], 'value': 'oauth2client_args'}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'oauth2client_args'}; {'id': '105', 'type': 'if_statement', 'children': ['106', '109']}; {'id': '106', 'type': 'comparison_operator', 'children': ['107', '108'], 'value': 'is'}; {'id': '107', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '108', 'type': 'None', 'children': []}; {'id': '109', 'type': 'block', 'children': ['110']}; {'id': '110', 'type': 'return_statement', 'children': ['111']}; {'id': '111', 'type': 'identifier', 'children': [], 'value': 'credentials'}; {'id': '112', 'type': 'raise_statement', 'children': ['113']}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'exceptions'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'CredentialsError'}; {'id': '117', 'type': 'argument_list', 'children': ['118']}; {'id': '118', 'type': 'string', 'children': [], 'value': "'Could not create valid credentials'"}
Attempt to get credentials, using an oauth dance as the last resort.
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '20']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'get_sorted_graph'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '8', '11', '14', '17']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'default_parameter', 'children': ['6', '7']}; {'id': '6', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '7', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '8', 'type': 'default_parameter', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '10', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '11', 'type': 'default_parameter', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'slices'}; {'id': '13', 'type': 'integer', 'children': [], 'value': '100'}; {'id': '14', 'type': 'default_parameter', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'include_inf'}; {'id': '16', 'type': 'False', 'children': []}; {'id': '17', 'type': 'default_parameter', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'exact'}; {'id': '19', 'type': 'False', 'children': []}; {'id': '20', 'type': 'block', 'children': ['21', '32', '133', '150']}; {'id': '21', 'type': 'if_statement', 'children': ['22', '26']}; {'id': '22', 'type': 'not_operator', 'children': ['23']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'is_sorted'}; {'id': '26', 'type': 'block', 'children': ['27']}; {'id': '27', 'type': 'raise_statement', 'children': ['28']}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'Exception'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'string', 'children': [], 'value': '"Not a sorted queue"'}; {'id': '32', 'type': 'with_statement', 'children': ['33', '50']}; {'id': '33', 'type': 'with_clause', 'children': ['34']}; {'id': '34', 'type': 'with_item', 'children': ['35']}; {'id': '35', 'type': 'as_pattern', 'children': ['36', '48']}; {'id': '36', 'type': 'call', 'children': ['37', '44']}; {'id': '37', 'type': 'attribute', 'children': ['38', '43']}; {'id': '38', 'type': 'attribute', 'children': ['39', '42']}; {'id': '39', 'type': 'attribute', 'children': ['40', '41']}; {'id': '40', 'type': 'identifier', 'children': [], 'value': 'context'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'connections'}; {'id': '42', 'type': 'identifier', 'children': [], 'value': 'redis'}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'pipeline'}; {'id': '44', 'type': 'argument_list', 'children': ['45']}; {'id': '45', 'type': 'keyword_argument', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'transaction'}; {'id': '47', 'type': 'identifier', 'children': [], 'value': 'exact'}; {'id': '48', 'type': 'as_pattern_target', 'children': ['49']}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '50', 'type': 'block', 'children': ['51', '64', '98', '125']}; {'id': '51', 'type': 'expression_statement', 'children': ['52']}; {'id': '52', 'type': 'assignment', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '54', 'type': 'call', 'children': ['55', '56']}; {'id': '55', 'type': 'identifier', 'children': [], 'value': 'old_div'}; {'id': '56', 'type': 'argument_list', 'children': ['57', '63']}; {'id': '57', 'type': 'call', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'float'}; {'id': '59', 'type': 'argument_list', 'children': ['60']}; {'id': '60', 'type': 'binary_operator', 'children': ['61', '62'], 'value': '-'}; {'id': '61', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '62', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '63', 'type': 'identifier', 'children': [], 'value': 'slices'}; {'id': '64', 'type': 'for_statement', 'children': ['65', '66', '71']}; {'id': '65', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '66', 'type': 'call', 'children': ['67', '68']}; {'id': '67', 'type': 'identifier', 'children': [], 'value': 'range'}; {'id': '68', 'type': 'argument_list', 'children': ['69', '70']}; {'id': '69', 'type': 'integer', 'children': [], 'value': '0'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'slices'}; {'id': '71', 'type': 'block', 'children': ['72']}; {'id': '72', 'type': 'expression_statement', 'children': ['73']}; {'id': '73', 'type': 'call', 'children': ['74', '77']}; {'id': '74', 'type': 'attribute', 'children': ['75', '76']}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '76', 'type': 'identifier', 'children': [], 'value': 'zcount'}; {'id': '77', 'type': 'argument_list', 'children': ['78', '81', '87']}; {'id': '78', 'type': 'attribute', 'children': ['79', '80']}; {'id': '79', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '80', 'type': 'identifier', 'children': [], 'value': 'redis_key'}; {'id': '81', 'type': '()', 'children': ['82']}; {'id': '82', 'type': 'binary_operator', 'children': ['83', '84'], 'value': '+'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '84', 'type': 'binary_operator', 'children': ['85', '86'], 'value': '*'}; {'id': '85', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '86', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '87', 'type': 'binary_operator', 'children': ['88', '89'], 'value': '%'}; {'id': '88', 'type': 'string', 'children': [], 'value': '"(%s"'}; {'id': '89', 'type': '()', 'children': ['90']}; {'id': '90', 'type': 'binary_operator', 'children': ['91', '92'], 'value': '+'}; {'id': '91', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '92', 'type': 'binary_operator', 'children': ['93', '97'], 'value': '*'}; {'id': '93', 'type': '()', 'children': ['94']}; {'id': '94', 'type': 'binary_operator', 'children': ['95', '96'], 'value': '+'}; {'id': '95', 'type': 'identifier', 'children': [], 'value': 'i'}; {'id': '96', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '97', 'type': 'identifier', 'children': [], 'value': 'interval'}; {'id': '98', 'type': 'if_statement', 'children': ['99', '100']}; {'id': '99', 'type': 'identifier', 'children': [], 'value': 'include_inf'}; {'id': '100', 'type': 'block', 'children': ['101', '112']}; {'id': '101', 'type': 'expression_statement', 'children': ['102']}; {'id': '102', 'type': 'call', 'children': ['103', '106']}; {'id': '103', 'type': 'attribute', 'children': ['104', '105']}; {'id': '104', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '105', 'type': 'identifier', 'children': [], 'value': 'zcount'}; {'id': '106', 'type': 'argument_list', 'children': ['107', '110', '111']}; {'id': '107', 'type': 'attribute', 'children': ['108', '109']}; {'id': '108', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '109', 'type': 'identifier', 'children': [], 'value': 'redis_key'}; {'id': '110', 'type': 'identifier', 'children': [], 'value': 'stop'}; {'id': '111', 'type': 'string', 'children': [], 'value': '"+inf"'}; {'id': '112', 'type': 'expression_statement', 'children': ['113']}; {'id': '113', 'type': 'call', 'children': ['114', '117']}; {'id': '114', 'type': 'attribute', 'children': ['115', '116']}; {'id': '115', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '116', 'type': 'identifier', 'children': [], 'value': 'zcount'}; {'id': '117', 'type': 'argument_list', 'children': ['118', '121', '122']}; {'id': '118', 'type': 'attribute', 'children': ['119', '120']}; {'id': '119', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '120', 'type': 'identifier', 'children': [], 'value': 'redis_key'}; {'id': '121', 'type': 'string', 'children': [], 'value': '"-inf"'}; {'id': '122', 'type': 'binary_operator', 'children': ['123', '124'], 'value': '%'}; {'id': '123', 'type': 'string', 'children': [], 'value': '"(%s"'}; {'id': '124', 'type': 'identifier', 'children': [], 'value': 'start'}; {'id': '125', 'type': 'expression_statement', 'children': ['126']}; {'id': '126', 'type': 'assignment', 'children': ['127', '128']}; {'id': '127', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '128', 'type': 'call', 'children': ['129', '132']}; {'id': '129', 'type': 'attribute', 'children': ['130', '131']}; {'id': '130', 'type': 'identifier', 'children': [], 'value': 'pipe'}; {'id': '131', 'type': 'identifier', 'children': [], 'value': 'execute'}; {'id': '132', 'type': 'argument_list', 'children': []}; {'id': '133', 'type': 'if_statement', 'children': ['134', '135']}; {'id': '134', 'type': 'identifier', 'children': [], 'value': 'include_inf'}; {'id': '135', 'type': 'block', 'children': ['136']}; {'id': '136', 'type': 'return_statement', 'children': ['137']}; {'id': '137', 'type': 'binary_operator', 'children': ['138', '144'], 'value': '+'}; {'id': '138', 'type': 'subscript', 'children': ['139', '140']}; {'id': '139', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '140', 'type': 'slice', 'children': ['141', '143']}; {'id': '141', 'type': 'unary_operator', 'children': ['142'], 'value': '-'}; {'id': '142', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '143', 'type': 'colon', 'children': []}; {'id': '144', 'type': 'subscript', 'children': ['145', '146']}; {'id': '145', 'type': 'identifier', 'children': [], 'value': 'data'}; {'id': '146', 'type': 'slice', 'children': ['147', '148']}; {'id': '147', 'type': 'colon', 'children': []}; {'id': '148', 'type': 'unary_operator', 'children': ['149'], 'value': '-'}; {'id': '149', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '150', 'type': 'return_statement', 'children': ['151']}; {'id': '151', 'type': 'identifier', 'children': [], 'value': 'data'}
Returns a graph of the distribution of jobs in a sorted set
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '9', '14']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': '_add_comments'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5', '6']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'comments'}; {'id': '6', 'type': 'default_parameter', 'children': ['7', '8']}; {'id': '7', 'type': 'identifier', 'children': [], 'value': 'original_string'}; {'id': '8', 'type': 'string', 'children': [], 'value': '""'}; {'id': '9', 'type': 'ERROR', 'children': ['10']}; {'id': '10', 'type': 'return_statement', 'children': ['11']}; {'id': '11', 'type': 'boolean_operator', 'children': ['12', '13'], 'value': 'and'}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'comments'}; {'id': '13', 'type': 'string', 'children': [], 'value': '"{0}\n "'}; {'id': '14', 'type': 'block', 'children': ['15']}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'boolean_operator', 'children': ['17', '21', '22'], 'value': 'or'}; {'id': '17', 'type': 'call', 'children': ['18', '19']}; {'id': '18', 'type': 'identifier', 'children': [], 'value': 'join'}; {'id': '19', 'type': 'argument_list', 'children': ['20']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'comments'}; {'id': '21', 'type': 'ERROR', 'children': []}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'original_string'}
Returns a string with comments added