code: def create_translator(
      self, builder: Builder, *args: Any
  ) -> nodes.NodeVisitor:
      translator_class = self.get_translator_class(builder)
      translator = translator_class(*args)
  
      # transplant handlers for custom nodes to translator instance
      handlers = self.translation_handlers.get(builder.name, None)
      if handlers is None:
          # retry with builder.format
          handlers = self.translation_handlers.get(builder.format, {})
  
      for name, (visit, depart) in handlers.items():
          setattr(
              translator, "visit_" + name, MethodType(visit, translator)
          )
          if depart:
              setattr(
                  translator,
                  "depart_" + name,
                  MethodType(depart, translator),
              )
  
      return translator
  
imports: from __future__ import annotations
  import sys
  import traceback
  from importlib import import_module
  from types import MethodType
  from typing import TYPE_CHECKING, Any, Callable
  from sphinx.domains import Domain, Index, ObjType
  from sphinx.domains.std import GenericObject, Target
  from sphinx.errors import ExtensionError, SphinxError, VersionRequirementError
  from sphinx.extension import Extension
  from sphinx.io import create_publisher
  from sphinx.locale import __
  from sphinx.parsers import Parser
  from sphinx.roles import XRefRole
  from sphinx.util import logging
  from sphinx.util.logging import prefixed_warnings
label_desc: Use image node_id 21 for calling the SphinxComponentRegistry obj's underlying member method code with example usage: obj.create_translator(builder) and returns: translator