code: def get_init_parameters_or_fail(obj: Any):
      if is_traceable(obj):
          return obj.trace_kwargs
      raise ValueError(
          f"Object {obj} needs to be serializable but `trace_kwargs` is not available. "
          "If it is a built-in module (like Conv2d), please import it from retiarii.nn. "
          "If it is a customized module, please to decorate it with @basic_unit. "
          "For other complex objects (e.g., trainer, optimizer, dataset, dataloader), "
          "try to use @nni.trace."
      )
  
file_path: nni/nni/nas/utils/_legacy.py
imports: import inspect
  import os
  import warnings
  from typing import Any, TypeVar, Type
  from nni.common.serializer import is_traceable, is_wrapped_with_trace, trace
label_desc: Use image node_id 1 for calling a global function with example usage: get_init_parameters_or_fail(obj) and returns: obj