code: def fill_h5(root, contents, attr_processor=default_attr_processor):
      """Fill hdf5 file with the given contents.
  
      Args:
          root: hdf5 file rott
          contents: Contents to be written into the file
          attr_processor: A method for modifying attributes before they are
            written to the file.
      """
      for key, val in contents.items():
          if key in ["value", "attrs"]:
              continue
          if "value" in val:
              root[key] = val["value"]
          else:
              grp = root.create_group(key)
              fill_h5(grp, contents[key])
          if "attrs" in val:
              for attr_name, attr_val in val["attrs"].items():
                  root[key].attrs[attr_name] = attr_processor(
                      root, attr_val
                  )
  
imports: import inspect
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: fill_h5(root, contents, attr_processor) without return types