nodes: 0, module; 1, function_definition; 2, function_name:_read_stepfiles_list; 3, parameters; 4, block; 5, identifier:path_prefix; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:path_suffix; 13, string:".index"; 14, identifier:min_steps; 15, integer:0; 16, comment:"""Return list of StepFiles sorted by step from files at path_prefix."""; 17, assignment; 18, identifier:filename; 19, call; 20, block; 21, call; 22, identifier:stepfiles; 23, list; 24, identifier:_try_twice_tf_glob; 25, argument_list; 26, expression_statement; 27, try_statement; 28, if_statement; 29, if_statement; 30, expression_statement; 31, identifier:sorted; 32, argument_list; 33, binary_operator:path_prefix + "*-[0-9]*" + path_suffix; 34, assignment; 35, block; 36, except_clause; 37, comparison_operator:steps < min_steps; 38, block; 39, not_operator; 40, block; 41, call; 42, identifier:stepfiles; 43, keyword_argument; 44, binary_operator:path_prefix + "*-[0-9]*"; 45, identifier:path_suffix; 46, identifier:basename; 47, conditional_expression:filename[:-len(path_suffix)] if path_suffix else filename; 48, expression_statement; 49, identifier:ValueError; 50, comment:# The -[0-9]* part is not an integer.; 51, block; 52, identifier:steps; 53, identifier:min_steps; 54, continue_statement; 55, call; 56, expression_statement; 57, continue_statement; 58, attribute; 59, argument_list; 60, identifier:key; 61, lambda; 62, identifier:path_prefix; 63, string:"*-[0-9]*"; 64, subscript; 65, identifier:path_suffix; 66, identifier:filename; 67, assignment; 68, continue_statement; 69, attribute; 70, argument_list; 71, call; 72, identifier:stepfiles; 73, identifier:append; 74, call; 75, lambda_parameters; 76, unary_operator; 77, identifier:filename; 78, slice; 79, identifier:steps; 80, call; 81, attribute; 82, identifier:exists; 83, identifier:filename; 84, attribute; 85, argument_list; 86, identifier:StepFile; 87, argument_list; 88, identifier:x; 89, attribute; 90, unary_operator; 91, identifier:int; 92, argument_list; 93, identifier:os; 94, identifier:path; 95, attribute; 96, identifier:info; 97, binary_operator:filename + " was deleted, so skipping it"; 98, identifier:basename; 99, call; 100, call; 101, identifier:steps; 102, identifier:x; 103, identifier:steps; 104, call; 105, subscript; 106, identifier:tf; 107, identifier:logging; 108, identifier:filename; 109, string:" was deleted, so skipping it"; 110, attribute; 111, argument_list; 112, attribute; 113, argument_list; 114, identifier:len; 115, argument_list; 116, call; 117, unary_operator; 118, attribute; 119, identifier:getmtime; 120, identifier:filename; 121, attribute; 122, identifier:getctime; 123, identifier:filename; 124, identifier:path_suffix; 125, attribute; 126, argument_list; 127, integer:1; 128, identifier:os; 129, identifier:path; 130, identifier:os; 131, identifier:path; 132, identifier:basename; 133, identifier:rsplit; 134, string:"-"
code: def _read_stepfiles_list(path_prefix, path_suffix=".index", min_steps=0):
    """Return list of StepFiles sorted by step from files at path_prefix."""
    stepfiles = []
    for filename in _try_twice_tf_glob(path_prefix + "*-[0-9]*" + path_suffix):
      basename = filename[:-len(path_suffix)] if path_suffix else filename
      try:
        steps = int(basename.rsplit("-")[-1])
      except ValueError:  # The -[0-9]* part is not an integer.
        continue
      if steps < min_steps:
        continue
      if not os.path.exists(filename):
        tf.logging.info(filename + " was deleted, so skipping it")
        continue
      stepfiles.append(StepFile(basename, os.path.getmtime(filename),
                                os.path.getctime(filename), steps))
    return sorted(stepfiles, key=lambda x: -x.steps)