code: def save_dict(d, filename, group, raise_type_fail=True):
      """
      Recursively save a dict to an hdf5 group in a new file.
  
      Parameters
      ----------
      d: dict
          dict to save as an hdf5 file
  
      filename : str
          Full path to save the file to. File must not already exist.
  
      group : str
          group name to save the dict to
  
      raise_type_fail : bool
          If True: raise an exception if saving a part of the dict fails.
          If False: prints a warning instead and saves the
          object's __str__() return value.
  
      Returns
      -------
      None
  
      Raises
      ------
      FileExistsError
          If the path specified by the `filename` parameter already exists.
  
      TypeError
          If a particular entry within the dict cannot be saved to hdf5 AND
          the argument `raise_type_fail` is set to `True`
      """
      if os.path.isfile(filename):
          raise FileExistsError
  
      with h5py.File(filename, "w") as h5file:
          _dicts_to_group(
              h5file,
              "{}/".format(group),
              d,
              raise_meta_fail=raise_type_fail,
          )
  
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 1 for calling a global function with example usage: save_dict(d, filename, group, raise_type_fail) without return types