nodes: 0, module; 1, function_definition; 2, function_name:read_cache; 3, parameters; 4, block; 5, identifier:cachefile; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, comment:# open file; 11, if_statement; 12, comment:# read file; 13, expression_statement; 14, comment:# sieve and sort; 15, if_statement; 16, if_statement; 17, comment:# read simple paths; 18, return_statement; 19, identifier:coltype; 20, identifier:LIGOTimeGPS; 21, identifier:sort; 22, None; 23, identifier:segment; 24, None; 25, comment:"""Read a LAL- or FFL-format cache file as a list of file paths
  
      Parameters
      ----------
      cachefile : `str`, `file`
          Input file or file path to read.
  
      coltype : `LIGOTimeGPS`, `int`, optional
          Type for GPS times.
  
      sort : `callable`, optional
          A callable key function by which to sort the output list of file paths
  
      segment : `gwpy.segments.Segment`, optional
          A GPS `[start, stop)` interval, if given only files overlapping this
          interval will be returned.
  
      Returns
      -------
      paths : `list` of `str`
          A list of file paths as read from the cache file.
      """; 26, not_operator; 27, block; 28, assignment; 29, identifier:segment; 30, block; 31, identifier:sort; 32, block; 33, identifier:cache; 34, call; 35, with_statement; 36, identifier:cache; 37, list_comprehension; 38, expression_statement; 39, expression_statement; 40, identifier:isinstance; 41, argument_list; 42, with_clause; 43, block; 44, attribute; 45, for_in_clause; 46, assignment; 47, call; 48, identifier:cachefile; 49, identifier:FILE_LIKE; 50, with_item; 51, return_statement; 52, identifier:x; 53, identifier:path; 54, identifier:x; 55, call; 56, identifier:cache; 57, call; 58, attribute; 59, argument_list; 60, as_pattern; 61, call; 62, identifier:_iter_cache; 63, argument_list; 64, identifier:sieve; 65, argument_list; 66, identifier:cache; 67, identifier:sort; 68, keyword_argument; 69, call; 70, as_pattern_target; 71, identifier:read_cache; 72, argument_list; 73, identifier:cachefile; 74, keyword_argument; 75, identifier:cache; 76, keyword_argument; 77, identifier:key; 78, identifier:sort; 79, identifier:open; 80, argument_list; 81, identifier:fobj; 82, identifier:fobj; 83, keyword_argument; 84, keyword_argument; 85, keyword_argument; 86, identifier:gpstype; 87, identifier:coltype; 88, identifier:segment; 89, identifier:segment; 90, call; 91, string; 92, identifier:coltype; 93, identifier:coltype; 94, identifier:sort; 95, identifier:sort; 96, identifier:segment; 97, identifier:segment; 98, identifier:file_path; 99, argument_list; 100, string_content:r; 101, identifier:cachefile
code: def read_cache(cachefile, coltype=LIGOTimeGPS, sort=None, segment=None):
      """Read a LAL- or FFL-format cache file as a list of file paths
  
      Parameters
      ----------
      cachefile : `str`, `file`
          Input file or file path to read.
  
      coltype : `LIGOTimeGPS`, `int`, optional
          Type for GPS times.
  
      sort : `callable`, optional
          A callable key function by which to sort the output list of file paths
  
      segment : `gwpy.segments.Segment`, optional
          A GPS `[start, stop)` interval, if given only files overlapping this
          interval will be returned.
  
      Returns
      -------
      paths : `list` of `str`
          A list of file paths as read from the cache file.
      """
      # open file
      if not isinstance(cachefile, FILE_LIKE):
          with open(file_path(cachefile), 'r') as fobj:
              return read_cache(fobj, coltype=coltype, sort=sort,
                                segment=segment)
  
      # read file
      cache = [x.path for x in _iter_cache(cachefile, gpstype=coltype)]
  
      # sieve and sort
      if segment:
          cache = sieve(cache, segment=segment)
      if sort:
          cache.sort(key=sort)
  
      # read simple paths
      return cache