code: def imread_collection(load_pattern, conserve_memory=True):
      """Load a collection of images from one or more FITS files
  
      Parameters
      ----------
      load_pattern : str or list
          List of extensions to load. Filename globbing is currently
          unsupported.
      conserve_memory : bool
          If True, never keep more than one in memory at a specific
          time. Otherwise, images will be cached once they are loaded.
  
      Returns
      -------
      ic : ImageCollection
          Collection of images.
  
      """
  
      intype = type(load_pattern)
      if intype is not list and intype is not str:
          raise TypeError(
              "Input must be a filename or list of filenames"
          )
  
      # Ensure we have a list, otherwise we'll end up iterating over the string:
      if intype is not list:
          load_pattern = [load_pattern]
  
      # Generate a list of filename/extension pairs by opening the list of
      # files and finding the image extensions in each one:
      ext_list = []
      for filename in load_pattern:
          with fits.open(filename) as hdulist:
              for n, hdu in zip(range(len(hdulist)), hdulist):
                  if isinstance(hdu, fits.ImageHDU) or isinstance(
                      hdu, fits.PrimaryHDU
                  ):
                      # Ignore (primary) header units with no data (use '.size'
                      # rather than '.data' to avoid actually loading the image):
                      try:
                          data_size = (
                              hdu.size
                          )  # size is int in Astropy 3.1.2
                      except TypeError:
                          data_size = hdu.size()
                      if data_size > 0:
                          ext_list.append((filename, n))
  
      return io.ImageCollection(
          ext_list,
          load_func=FITSFactory,
          conserve_memory=conserve_memory,
      )
  
label_desc: Use image node_id 2 for calling a global function with example usage: imread_collection(load_pattern, conserve_memory) and returns: io