nodes: 0, module; 1, function_definition; 2, function_name:sort_filenames; 3, parameters; 4, block; 5, identifier:filenames; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""
      sort a list of files by filename only, ignoring the directory names
      """; 11, assignment; 12, assignment; 13, list_comprehension; 14, identifier:basenames; 15, list_comprehension; 16, identifier:indexes; 17, list_comprehension; 18, subscript; 19, for_in_clause; 20, call; 21, for_in_clause; 22, subscript; 23, for_in_clause; 24, identifier:filenames; 25, identifier:x; 26, identifier:x; 27, identifier:indexes; 28, attribute; 29, argument_list; 30, identifier:x; 31, identifier:filenames; 32, identifier:i; 33, integer:0; 34, identifier:i; 35, call; 36, attribute; 37, identifier:basename; 38, identifier:x; 39, identifier:sorted; 40, argument_list; 41, identifier:os; 42, identifier:path; 43, call; 44, keyword_argument; 45, identifier:enumerate; 46, argument_list; 47, identifier:key; 48, lambda; 49, identifier:basenames; 50, lambda_parameters; 51, subscript; 52, identifier:x; 53, identifier:x; 54, integer:1
code: def sort_filenames(filenames):
      """
      sort a list of files by filename only, ignoring the directory names
      """
      basenames = [os.path.basename(x) for x in filenames]
      indexes = [i[0] for i in sorted(enumerate(basenames), key=lambda x:x[1])]
      return [filenames[x] for x in indexes]