code: def test_mangle_signature():
      TEST = """
      () :: ()
      (a, b, c, d, e) :: (a, b, c, d, e)
      (a, b, c=1, d=2, e=3) :: (a, b[, c, d, e])
      (a, b, aaa=1, bbb=1, ccc=1, eee=1, fff=1, ggg=1, hhh=1, iii=1, jjj=1)\
      :: (a, b[, aaa, bbb, ccc, ...])
      (a, b, c=(), d=<foo>) :: (a, b[, c, d])
      (a, b, c='foobar()', d=123) :: (a, b[, c, d])
      (a, b[, c]) :: (a, b[, c])
      (a, b[, cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]) :: (a, b[, ...)
      (a, b='c=d, e=f, g=h', c=3) :: (a[, b, c])
      (a, b="c=d, e=f, g=h", c=3) :: (a[, b, c])
      (a, b='c=d, \\'e=f,\\' g=h', c=3) :: (a[, b, c])
      (a, b='c=d, ', e='\\\\' g=h, c=3) :: (a[, b, e, c])
      (a, b={'c=d, ': 3, '\\\\': 3}) :: (a[, b])
      (a=1, b=2, c=3) :: ([a, b, c])
      (a=1, b=<SomeClass: a, b, c>, c=3) :: ([a, b, c])
      (a=1, b=T(a=1, b=2), c=3) :: ([a, b, c])
      (a: Tuple[int, str], b: int) -> str :: (a, b)
      """
  
      TEST = [
          [y.strip() for y in x.split("::")]
          for x in TEST.split("\n")
          if "::" in x
      ]
      for inp, outp in TEST:
          res = mangle_signature(inp).strip().replace("\u00a0", " ")
          assert res == outp, f"'{inp}' -> '{res}' != '{outp}'"
  
imports: import sys
  from io import StringIO
  from pathlib import Path
  from unittest.mock import Mock, patch
  import pytest
  from docutils import nodes
  from sphinx import addnodes
  from sphinx.ext.autosummary import autosummary_table, autosummary_toc, extract_summary, import_by_name, mangle_signature
  from sphinx.ext.autosummary.generate import AutosummaryEntry, generate_autosummary_content, generate_autosummary_docs
  from sphinx.ext.autosummary.generate import main
  from sphinx.testing.util import assert_node, etree_parse
  from sphinx.util.docutils import new_document
label_desc: Use image node_id 2 for calling a global function with example usage: test_mangle_signature() without return types