code: def process_index_entry(
      entry: str,
      targetid: str,
  ) -> list[tuple[str, str, str, str, str | None]]:
      from sphinx.domains.python import pairindextypes
  
      indexentries: list[tuple[str, str, str, str, str | None]] = []
      entry = entry.strip()
      oentry = entry
      main = ""
      if entry.startswith("!"):
          main = "main"
          entry = entry[1:].lstrip()
      for index_type in pairindextypes:
          if entry.startswith(f"{index_type}:"):
              value = entry[len(index_type) + 1 :].strip()
              value = f"{pairindextypes[index_type]}; {value}"
              # xref RemovedInSphinx90Warning
              logger.warning(
                  __(
                      "%r is deprecated for index entries (from entry %r). "
                      "Use 'pair: %s' instead."
                  ),
                  index_type,
                  entry,
                  value,
                  type="index",
              )
              indexentries.append(("pair", value, targetid, main, None))
              break
      else:
          for index_type in indextypes:
              if entry.startswith(f"{index_type}:"):
                  value = entry[len(index_type) + 1 :].strip()
                  if index_type == "double":
                      index_type = "pair"
                  indexentries.append(
                      (index_type, value, targetid, main, None)
                  )
                  break
          # shorthand notation for single entries
          else:
              for value in oentry.split(","):
                  value = value.strip()
                  main = ""
                  if value.startswith("!"):
                      main = "main"
                      value = value[1:].lstrip()
                  if not value:
                      continue
                  indexentries.append(
                      ("single", value, targetid, main, None)
                  )
      return indexentries
  
imports: from __future__ import annotations
  import contextlib
  import re
  import unicodedata
  from typing import TYPE_CHECKING, Any, Callable
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.locale import __
  from sphinx.util import logging
label_desc: Use image node_id 14 for calling a global function with example usage: process_index_entry(entry, targetid) and returns: indexentries