code: def write_file_list(file_or_fd, file_list):
      """Write the file list out to a file.
  
      See read_image_plane_details for the file format.
  
      file_or_fd - a path or a file like object
  
      file_list - collection of URLs to be output
  
      """
      if isinstance(file_or_fd, str):
          fd = open(file_or_fd, "w")
          needs_close = True
      else:
          fd = file_or_fd
          needs_close = False
      try:
          fd.write(
              '"%s":"%d","%s":"%d"\n'
              % (
                  "Version",
                  IMAGE_PLANE_DESCRIPTOR_VERSION,
                  H_PLANE_COUNT,
                  len(file_list),
              )
          )
          fd.write(
              '"'
              + '","'.join([H_URL, H_SERIES, H_INDEX, H_CHANNEL])
              + '"\n'
          )
          for url in file_list:
              if isinstance(url, str):
                  url = url
              # url = url.encode("string_escape").replace('"', r"\"")
              line = '"%s",,,\n' % url
              fd.write(line)
      finally:
          if needs_close:
              fd.close()
  
imports: import bisect
  import re
  import numpy
  from ...constants.pipeline import make_cell_struct_dtype
  from ...constants.pipeline import PIPELINE
  from ...constants.pipeline import IMAGE_PLANE_DESCRIPTOR_VERSION
  from ...constants.pipeline import H_PLANE_COUNT
  from ...constants.pipeline import H_URL
  from ...constants.pipeline import H_SERIES
  from ...constants.pipeline import H_INDEX
  from ...constants.pipeline import H_CHANNEL
  from ...constants.pipeline import RF_STATE_PREQUOTE
  from ...constants.pipeline import RF_STATE_FIELD
  from ...constants.pipeline import RF_STATE_BACKSLASH_ESCAPE
  from ...constants.pipeline import RF_STATE_SEPARATOR
  from ..legacy import cmp
label_desc: Use image node_id 4 for calling a global function with example usage: write_file_list(file_or_fd, file_list) without return types