code: def _dicts_from_group(h5file, path):
      ans = {}
      for key, item in h5file[path].items():
          if isinstance(item, h5py._hl.dataset.Dataset):
              if item.attrs.__contains__("dtype"):
                  ans[key] = item[()].astype(item.attrs["dtype"])
              else:
                  ans[key] = item[()]
          elif isinstance(item, h5py._hl.group.Group):
              ans[key] = _dicts_from_group(h5file, path + key + "/")
      return ans
  
file_path: tslearn/tslearn/hdftools/hdftools.py
imports: import h5py
  import os
  import numpy
  import traceback
  from warnings import warn
label_desc: Use image node_id 4 for calling a global function with example usage: _dicts_from_group(h5file, path) and returns: ans