code: def get_histograms_in_list(filename: str, list_name: str = None) -> Dict[str, Any]:
      
      hists: dict = {}
      with RootOpen(filename = filename, mode = "READ") as fIn:
          if list_name is not None:
              hist_list = fIn.Get(list_name)
          else:
              hist_list = [obj.ReadObj() for obj in fIn.GetListOfKeys()]
  
          if not hist_list:
              fIn.ls()
              # Closing this file appears (but is not entirely confirmed) to be extremely important! Otherwise,
              # the memory will leak, leading to ROOT memory issues!
              fIn.Close()
              raise ValueError(f"Could not find list with name \"{list_name}\". Possible names are listed above.")
  
          # Retrieve objects in the hist list
          for obj in hist_list:
              _retrieve_object(hists, obj)
  
      return hists
docs: Get histograms from the file and make them available in a dict.
  
      Lists are recursively explored, with all lists converted to dictionaries, such that the return
      dictionaries which only contains hists and dictionaries of hists (ie there are no ROOT ``TCollection``
      derived objects).
  
      Args:
          filename: Filename of the ROOT file containing the list.
          list_name: Name of the list to retrieve.
      Returns:
          Contains hists with keys as their names. Lists are recursively added, mirroring
              the structure under which the hists were stored.
      Raises:
          ValueError: If the list could not be found in the given file.