code: def with_read_hdf5(func):
      
      @wraps(func)
      def decorated_func(fobj, *args, **kwargs):
          # pylint: disable=missing-docstring
          if not isinstance(fobj, h5py.HLObject):
              if isinstance(fobj, FILE_LIKE):
                  fobj = fobj.name
              with h5py.File(fobj, 'r') as h5f:
                  return func(h5f, *args, **kwargs)
          return func(fobj, *args, **kwargs)
  
      return decorated_func
docs: Decorate an HDF5-reading function to open a filepath if needed
  
      ``func`` should be written to presume an `h5py.Group` as the first
      positional argument.