code: def __iter__(self):
      if self.ark_or_scp == "scp":
          hdf5_dict = {}
          with open(self.filepath, "r", encoding="utf-8") as f:
              for line in f:
                  key, value = line.rstrip().split(None, 1)
  
                  if ":" not in value:
                      raise RuntimeError(
                          "scp file for hdf5 should be like: "
                          '"uttid filepath.h5:key": {}({})'.format(
                              line, self.filepath
                          )
                      )
                  path, h5_key = value.split(":", 1)
  
                  hdf5_file = hdf5_dict.get(path)
                  if hdf5_file is None:
                      try:
                          hdf5_file = h5py.File(path, "r")
                      except Exception:
                          logging.error(
                              "Error when loading {}".format(path)
                          )
                          raise
                      hdf5_dict[path] = hdf5_file
  
                  try:
                      data = hdf5_file[h5_key]
                  except Exception:
                      logging.error(
                          "Error when loading {} with key={}".format(
                              path, h5_key
                          )
                      )
                      raise
  
                  if self.return_shape:
                      yield key, data.shape
                  else:
                      yield key, data[()]
  
          # Closing all files
          for k in hdf5_dict:
              try:
                  hdf5_dict[k].close()
              except Exception:
                  pass
  
      else:
          if self.filepath == "-":
              # Required h5py>=2.9
              filepath = io.BytesIO(sys.stdin.buffer.read())
          else:
              filepath = self.filepath
          with h5py.File(filepath, "r") as f:
              for key in f:
                  if self.return_shape:
                      yield key, f[key].shape
                  else:
                      yield key, f[key][()]
  
file_path: espnet/espnet/utils/cli_readers.py
imports: import io
  import logging
  import sys
  import h5py
  import kaldiio
  import soundfile
  from espnet.utils.io_utils import SoundHDF5File
label_desc: Use image node_id 2 for calling the HDF5Reader obj's underlying member method code with example usage: obj.__iter__() without return types