code: def _build_file_index(directory, suffix=".tr"):
      """Build an index of source files and their basenames in a given directory.
  
      Args:
          directory (string): the directory to index
          suffix (string): index files with this suffix
  
      Returns:
          list: A list of tuples of the form [(basename, absolute path), ...]
      """
  
      index = []
  
      for fname in os.listdir(directory):
          if fname.endswith(suffix):
              basename = fname[
                  : fname.rfind(suffix)
              ]  # strip the suffix
              path = os.path.join(directory, fname)
              index.append((basename, path))
  
      return index
  
label_desc: Use image node_id 1 for calling a global function with example usage: _build_file_index(directory, suffix) and returns: index