code: def _resolve_target(
      target: Union[str, type, Callable[..., Any]], full_key: str
  ) -> Union[type, Callable[..., Any]]:
      """Resolve target string, type or callable into type or callable."""
      if isinstance(target, str):
          try:
              target = _locate(target)
          except Exception as e:
              msg = f"Error locating target '{target}', set env var HYDRA_FULL_ERROR=1 to see chained exception."
              if full_key:
                  msg += f"\nfull_key: {full_key}"
              raise InstantiationException(msg) from e
      if not callable(target):
          msg = f"Expected a callable target, got '{target}' of type '{type(target).__name__}'"
          if full_key:
              msg += f"\nfull_key: {full_key}"
          raise InstantiationException(msg)
      return target
  
imports: import copy
  import functools
  from enum import Enum
  from textwrap import dedent
  from typing import Any, Callable, Dict, List, Sequence, Tuple, Union
  from omegaconf import OmegaConf, SCMode
  from omegaconf._utils import is_structured_config
  from hydra._internal.utils import _locate
  from hydra.errors import InstantiationException
  from hydra.types import ConvertMode, TargetConf
label_desc: Use image node_id 6 for calling a global function with example usage: _resolve_target(target, full_key) and returns: target