code: def _init_param(param, mode):
      if isinstance(param, str):
          param = resolve(param)
      elif isinstance(param, (list, tuple)):
          param = [_init_param(p, mode) for p in param]
      elif isinstance(param, dict):
          if {"ref", "class_name", "config_path"}.intersection(
              param.keys()
          ):
              param = from_params(param, mode=mode)
          else:
              param = {
                  k: _init_param(v, mode) for k, v in param.items()
              }
      return param
  
file_path: DeepPavlov/deeppavlov/core/common/params.py
imports: import inspect
  from logging import getLogger
  from types import FunctionType
  from typing import Any, Dict, Union
  from deeppavlov.core.commands.utils import expand_path, parse_config
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import get_model
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling a global function with example usage: _init_param(param, mode) and returns: param