class_docstr: Create a hook that will add the given keys/values in the state dict metadata of the module it is registered on
  Args:
      extra_metadata: the extra state dict to be added to the state dict
      allow_overwrite: If True, do not raise if any of the keys are already in the state dict
        and would be overwritten by the new state
code: def __init__(
      self,
      extra_metadata: Mapping[str, Any],
      allow_overwrite: bool = False,
  ):
      self.extra_metadata = extra_metadata
      self.allow_overwrite = allow_overwrite
  
file_path: coremltools/coremltools/optimize/torch/_utils/state_dict_utils.py
imports: from typing import Any, Dict, Mapping, NamedTuple
  import torch
label_desc: Use image node_id 1 to create a new AddMetadataStateDictHook object  with example: obj = AddMetadataStateDictHook(extra_metadata, allow_overwrite)