sequence
stringlengths 1.37k
35.1k
| docstring
stringlengths 17
102
|
---|---|
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '20', '34']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sort_annotations'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'typed_parameter', 'children': ['5', '6']}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'annotations'}; {'id': '6', 'type': 'type', 'children': ['7']}; {'id': '7', 'type': 'generic_type', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '9', 'type': 'type_parameter', 'children': ['10']}; {'id': '10', 'type': 'type', 'children': ['11']}; {'id': '11', 'type': 'generic_type', 'children': ['12', '13']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '13', 'type': 'type_parameter', 'children': ['14', '16', '18']}; {'id': '14', 'type': 'type', 'children': ['15']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '16', 'type': 'type', 'children': ['17']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '18', 'type': 'type', 'children': ['19']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '20', 'type': 'type', 'children': ['21']}; {'id': '21', 'type': 'generic_type', 'children': ['22', '23']}; {'id': '22', 'type': 'identifier', 'children': [], 'value': 'List'}; {'id': '23', 'type': 'type_parameter', 'children': ['24']}; {'id': '24', 'type': 'type', 'children': ['25']}; {'id': '25', 'type': 'generic_type', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'Tuple'}; {'id': '27', 'type': 'type_parameter', 'children': ['28', '30', '32']}; {'id': '28', 'type': 'type', 'children': ['29']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '30', 'type': 'type', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'int'}; {'id': '32', 'type': 'type', 'children': ['33']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'str'}; {'id': '34', 'type': 'block', 'children': ['35']}; {'id': '35', 'type': 'return_statement', 'children': ['36']}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '38', 'type': 'argument_list', 'children': ['39', '40']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'annotations'}; {'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': 'subscript', 'children': ['46', '47']}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'x'}; {'id': '47', 'type': 'integer', 'children': [], 'value': '0'} | Sorts the annotations by their start_time. |
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'extract_sort'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '6', 'type': 'block', 'children': ['7', '9', '19', '31', '55']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'string', 'children': [], 'value': "'''Extract and build sort query from parameters'''"}; {'id': '9', 'type': 'expression_statement', 'children': ['10']}; {'id': '10', 'type': 'assignment', 'children': ['11', '12']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '12', 'type': 'call', 'children': ['13', '16']}; {'id': '13', 'type': 'attribute', 'children': ['14', '15']}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'params'}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'pop'}; {'id': '16', 'type': 'argument_list', 'children': ['17', '18']}; {'id': '17', 'type': 'string', 'children': [], 'value': "'sort'"}; {'id': '18', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '19', 'type': 'expression_statement', 'children': ['20']}; {'id': '20', 'type': 'assignment', 'children': ['21', '22']}; {'id': '21', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '22', 'type': 'conditional_expression', 'children': ['23', '25', '30'], 'value': 'if'}; {'id': '23', 'type': 'list', 'children': ['24'], 'value': '[sorts]'}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '25', 'type': 'call', 'children': ['26', '27']}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'isinstance'}; {'id': '27', 'type': 'argument_list', 'children': ['28', '29']}; {'id': '28', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'basestring'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '31', 'type': 'expression_statement', 'children': ['32']}; {'id': '32', 'type': 'assignment', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '34', 'type': 'list_comprehension', 'children': ['35', '52']}; {'id': '35', 'type': 'conditional_expression', 'children': ['36', '43', '49'], 'value': 'if'}; {'id': '36', 'type': 'tuple', 'children': ['37', '42']}; {'id': '37', 'type': 'subscript', 'children': ['38', '39']}; {'id': '38', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '39', 'type': 'slice', 'children': ['40', '41']}; {'id': '40', 'type': 'integer', 'children': [], 'value': '1'}; {'id': '41', 'type': 'colon', 'children': []}; {'id': '42', 'type': 'string', 'children': [], 'value': "'desc'"}; {'id': '43', 'type': 'call', 'children': ['44', '47']}; {'id': '44', 'type': 'attribute', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '46', 'type': 'identifier', 'children': [], 'value': 'startswith'}; {'id': '47', 'type': 'argument_list', 'children': ['48']}; {'id': '48', 'type': 'string', 'children': [], 'value': "'-'"}; {'id': '49', 'type': 'tuple', 'children': ['50', '51']}; {'id': '50', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '51', 'type': 'string', 'children': [], 'value': "'asc'"}; {'id': '52', 'type': 'for_in_clause', 'children': ['53', '54']}; {'id': '53', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '54', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '55', 'type': 'expression_statement', 'children': ['56']}; {'id': '56', 'type': 'assignment', 'children': ['57', '60']}; {'id': '57', 'type': 'attribute', 'children': ['58', '59']}; {'id': '58', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '60', 'type': 'list_comprehension', 'children': ['61', '71', '76']}; {'id': '61', 'type': 'dictionary', 'children': ['62']}; {'id': '62', 'type': 'pair', 'children': ['63', '70']}; {'id': '63', 'type': 'subscript', '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': 'adapter'}; {'id': '68', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '69', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '70', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '71', 'type': 'for_in_clause', 'children': ['72', '75']}; {'id': '72', 'type': 'pattern_list', 'children': ['73', '74']}; {'id': '73', 'type': 'identifier', 'children': [], 'value': 's'}; {'id': '74', 'type': 'identifier', 'children': [], 'value': 'd'}; {'id': '75', 'type': 'identifier', 'children': [], 'value': 'sorts'}; {'id': '76', 'type': 'if_clause', 'children': ['77']}; {'id': '77', 'type': 'comparison_operator', 'children': ['78', '79'], 'value': 'in'}; {'id': '78', 'type': 'identifier', 'children': [], 'value': 's'}; {'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': 'adapter'}; {'id': '83', 'type': 'identifier', 'children': [], 'value': 'sorts'} | Extract and build sort query from parameters |
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'ancestors_objects'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'block', 'children': ['6', '10', '44', '58']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'ancestors_objects'}; {'id': '9', 'type': 'list', 'children': [], 'value': '[]'}; {'id': '10', 'type': 'for_statement', 'children': ['11', '12', '15']}; {'id': '11', 'type': 'identifier', 'children': [], 'value': 'ancestor'}; {'id': '12', 'type': 'attribute', 'children': ['13', '14']}; {'id': '13', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'ancestors'}; {'id': '15', 'type': 'block', 'children': ['16', '37']}; {'id': '16', 'type': 'try_statement', 'children': ['17', '31']}; {'id': '17', 'type': 'block', 'children': ['18']}; {'id': '18', 'type': 'expression_statement', 'children': ['19']}; {'id': '19', 'type': 'assignment', 'children': ['20', '21']}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'ancestor_object'}; {'id': '21', 'type': 'call', 'children': ['22', '27']}; {'id': '22', 'type': 'attribute', 'children': ['23', '26']}; {'id': '23', 'type': 'attribute', 'children': ['24', '25']}; {'id': '24', 'type': 'identifier', 'children': [], 'value': 'GeoZone'}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'objects'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'get'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'keyword_argument', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'id'}; {'id': '30', 'type': 'identifier', 'children': [], 'value': 'ancestor'}; {'id': '31', 'type': 'except_clause', 'children': ['32', '35']}; {'id': '32', 'type': 'attribute', 'children': ['33', '34']}; {'id': '33', 'type': 'identifier', 'children': [], 'value': 'GeoZone'}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'DoesNotExist'}; {'id': '35', 'type': 'block', 'children': ['36']}; {'id': '36', 'type': 'continue_statement', 'children': []}; {'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': 'ancestors_objects'}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'append'}; {'id': '42', 'type': 'argument_list', 'children': ['43']}; {'id': '43', 'type': 'identifier', 'children': [], 'value': 'ancestor_object'}; {'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': 'ancestors_objects'}; {'id': '48', 'type': 'identifier', 'children': [], 'value': 'sort'}; {'id': '49', 'type': 'argument_list', 'children': ['50']}; {'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': 'a'}; {'id': '55', 'type': 'attribute', 'children': ['56', '57']}; {'id': '56', 'type': 'identifier', 'children': [], 'value': 'a'}; {'id': '57', 'type': 'identifier', 'children': [], 'value': 'name'}; {'id': '58', 'type': 'return_statement', 'children': ['59']}; {'id': '59', 'type': 'identifier', 'children': [], 'value': 'ancestors_objects'} | Ancestors objects sorted by name. |
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '5']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'sorted_names'}; {'id': '3', 'type': 'parameters', 'children': ['4']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '5', 'type': 'block', 'children': ['6', '13', '17', '33', '40', '50']}; {'id': '6', 'type': 'expression_statement', 'children': ['7']}; {'id': '7', 'type': 'assignment', 'children': ['8', '9']}; {'id': '8', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '9', 'type': 'call', 'children': ['10', '11']}; {'id': '10', 'type': 'identifier', 'children': [], 'value': 'list'}; {'id': '11', 'type': 'argument_list', 'children': ['12']}; {'id': '12', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '13', 'type': 'expression_statement', 'children': ['14']}; {'id': '14', 'type': 'assignment', 'children': ['15', '16']}; {'id': '15', 'type': 'identifier', 'children': [], 'value': 'have_default'}; {'id': '16', 'type': 'False', 'children': []}; {'id': '17', 'type': 'if_statement', 'children': ['18', '21']}; {'id': '18', 'type': 'comparison_operator', 'children': ['19', '20'], 'value': 'in'}; {'id': '19', 'type': 'string', 'children': [], 'value': "'default'"}; {'id': '20', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '21', 'type': 'block', 'children': ['22', '29']}; {'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': 'names'}; {'id': '26', 'type': 'identifier', 'children': [], 'value': 'remove'}; {'id': '27', 'type': 'argument_list', 'children': ['28']}; {'id': '28', 'type': 'string', 'children': [], 'value': "'default'"}; {'id': '29', 'type': 'expression_statement', 'children': ['30']}; {'id': '30', 'type': 'assignment', 'children': ['31', '32']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'have_default'}; {'id': '32', 'type': 'True', 'children': []}; {'id': '33', 'type': 'expression_statement', 'children': ['34']}; {'id': '34', 'type': 'assignment', 'children': ['35', '36']}; {'id': '35', 'type': 'identifier', 'children': [], 'value': 'sorted_names'}; {'id': '36', 'type': 'call', 'children': ['37', '38']}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'sorted'}; {'id': '38', 'type': 'argument_list', 'children': ['39']}; {'id': '39', 'type': 'identifier', 'children': [], 'value': 'names'}; {'id': '40', 'type': 'if_statement', 'children': ['41', '42']}; {'id': '41', 'type': 'identifier', 'children': [], 'value': 'have_default'}; {'id': '42', 'type': 'block', 'children': ['43']}; {'id': '43', 'type': 'expression_statement', 'children': ['44']}; {'id': '44', 'type': 'assignment', 'children': ['45', '46']}; {'id': '45', 'type': 'identifier', 'children': [], 'value': 'sorted_names'}; {'id': '46', 'type': 'binary_operator', 'children': ['47', '49'], 'value': '+'}; {'id': '47', 'type': 'list', 'children': ['48'], 'value': "['default']"}; {'id': '48', 'type': 'string', 'children': [], 'value': "'default'"}; {'id': '49', 'type': 'identifier', 'children': [], 'value': 'sorted_names'}; {'id': '50', 'type': 'return_statement', 'children': ['51']}; {'id': '51', 'type': 'identifier', 'children': [], 'value': 'sorted_names'} | Sort a list of names but keep the word 'default' first if it's there. |
{'id': '0', 'type': 'module', 'children': ['1']}; {'id': '1', 'type': 'function_definition', 'children': ['2', '3', '6']}; {'id': '2', 'type': 'function_name', 'children': [], 'value': 'getOverlaySortOrder'}; {'id': '3', 'type': 'parameters', 'children': ['4', '5']}; {'id': '4', 'type': 'identifier', 'children': [], 'value': 'self'}; {'id': '5', 'type': 'identifier', 'children': [], 'value': 'ulOverlayHandle'}; {'id': '6', 'type': 'block', 'children': ['7', '15', '21', '32']}; {'id': '7', 'type': 'expression_statement', 'children': ['8']}; {'id': '8', 'type': 'assignment', 'children': ['9', '10']}; {'id': '9', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'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': 'function_table'}; {'id': '14', 'type': 'identifier', 'children': [], 'value': 'getOverlaySortOrder'}; {'id': '15', 'type': 'expression_statement', 'children': ['16']}; {'id': '16', 'type': 'assignment', 'children': ['17', '18']}; {'id': '17', 'type': 'identifier', 'children': [], 'value': 'punSortOrder'}; {'id': '18', 'type': 'call', 'children': ['19', '20']}; {'id': '19', 'type': 'identifier', 'children': [], 'value': 'c_uint32'}; {'id': '20', 'type': 'argument_list', 'children': []}; {'id': '21', 'type': 'expression_statement', 'children': ['22']}; {'id': '22', 'type': 'assignment', 'children': ['23', '24']}; {'id': '23', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '24', 'type': 'call', 'children': ['25', '26']}; {'id': '25', 'type': 'identifier', 'children': [], 'value': 'fn'}; {'id': '26', 'type': 'argument_list', 'children': ['27', '28']}; {'id': '27', 'type': 'identifier', 'children': [], 'value': 'ulOverlayHandle'}; {'id': '28', 'type': 'call', 'children': ['29', '30']}; {'id': '29', 'type': 'identifier', 'children': [], 'value': 'byref'}; {'id': '30', 'type': 'argument_list', 'children': ['31']}; {'id': '31', 'type': 'identifier', 'children': [], 'value': 'punSortOrder'}; {'id': '32', 'type': 'return_statement', 'children': ['33']}; {'id': '33', 'type': 'expression_list', 'children': ['34', '35']}; {'id': '34', 'type': 'identifier', 'children': [], 'value': 'result'}; {'id': '35', 'type': 'attribute', 'children': ['36', '37']}; {'id': '36', 'type': 'identifier', 'children': [], 'value': 'punSortOrder'}; {'id': '37', 'type': 'identifier', 'children': [], 'value': 'value'} | Gets the sort order of the overlay. See SetOverlaySortOrder for how this works. |
Subsets and Splits