code: def callable_to_reference(callable: Callable) -> str:
      """Obtains path to the callable of form <module>.<name>."""
      if not isinstance(callable, (FunctionType, type)):
          raise TypeError(
              f"Expected to encode function or class, got: {callable}."
          )
      name = f"{callable.__module__}.{callable.__qualname__}"
      try:
          assert pydoc.locate(name) is callable
          return name
      except Exception as err:
          raise TypeError(
              f"Callable {callable.__qualname__} is not properly exposed in "
              f"{callable.__module__} (exception: {err})."
          )
  
file_path: Ax/ax/utils/common/serialization.py
imports: from __future__ import annotations
  import inspect
  import pydoc
  from types import FunctionType
  from typing import Any, Callable, Dict, List, Optional, Type
label_desc: Use image node_id 3 for calling a global function with example usage: callable_to_reference(callable) and returns: name