code: def save_h5py(path: str, value: Any):
      """Saves a nested value to h5 using a lossy encoding."""
      # Need to go via a buffer for some filesystems...
      buf = io.BytesIO()
      h5 = h5py.File(buf, "w")
      for p, v in tree.flatten_with_path(value):
          if v is not None:
              h5.create_dataset("/".join(map(str, p)), data=np.array(v))
      h5.close()
  
      with epath.Path(path).open("wb") as f:
          f.write(buf.getvalue())
  
imports: import contextlib
  import io
  from typing import Any, Dict, Iterator
  from absl import flags
  from etils import epath
  import gin
  import h5py
  import jax
  import numpy
  import tree
  import yaml
label_desc: Use image node_id 1 for calling a global function with example usage: save_h5py(path, value) without return types