code: def _sphinx_type_link(obj: Instance[Any]) -> str:
      # Sphinx links may be generated during docstring processing which means
      # we can't necessarily evaluate pure function (e.g. lambda) Instance
      # initializers, since they may contain circular references to the (not
      # yet fully defined at this point) Model
      if isinstance(obj._instance_type, types.FunctionType):
          return f"{property_link(obj)}"
      if isinstance(obj._instance_type, str):
          return f"{property_link(obj)}({obj._instance_type!r})"
  
      model = obj.instance_type
      model_name = f"{model.__module__}.{model.__name__}"
      return f"{property_link(obj)}({model_link(model_name)})"
  
imports: from __future__ import annotations
  import logging
  import types
  from importlib import import_module
  from typing import Any, Callable, Generic, TypeVar
  from ..has_props import HasProps
  from ..serialization import Serializable
  from ._sphinx import model_link, property_link, register_type_link
  from .bases import Init, Property
  from .singletons import Undefined
label_desc: Use image node_id 1 for calling a global function with example usage: _sphinx_type_link(obj) and returns: property_link, str, model_link, str, property_link, property_link, str, obj, str