code: def test_stringify_type_hints_containers():
      assert (
          stringify_annotation(List, "fully-qualified-except-typing")
          == "List"
      )
      assert (
          stringify_annotation(List, "fully-qualified") == "typing.List"
      )
      assert stringify_annotation(List, "smart") == "~typing.List"
  
      assert (
          stringify_annotation(Dict, "fully-qualified-except-typing")
          == "Dict"
      )
      assert (
          stringify_annotation(Dict, "fully-qualified") == "typing.Dict"
      )
      assert stringify_annotation(Dict, "smart") == "~typing.Dict"
  
      assert (
          stringify_annotation(
              List[int], "fully-qualified-except-typing"
          )
          == "List[int]"
      )
      assert (
          stringify_annotation(List[int], "fully-qualified")
          == "typing.List[int]"
      )
      assert (
          stringify_annotation(List[int], "smart")
          == "~typing.List[int]"
      )
  
      assert (
          stringify_annotation(
              List[str], "fully-qualified-except-typing"
          )
          == "List[str]"
      )
      assert (
          stringify_annotation(List[str], "fully-qualified")
          == "typing.List[str]"
      )
      assert (
          stringify_annotation(List[str], "smart")
          == "~typing.List[str]"
      )
  
      assert (
          stringify_annotation(
              Dict[str, float], "fully-qualified-except-typing"
          )
          == "Dict[str, float]"
      )
      assert (
          stringify_annotation(Dict[str, float], "fully-qualified")
          == "typing.Dict[str, float]"
      )
      assert (
          stringify_annotation(Dict[str, float], "smart")
          == "~typing.Dict[str, float]"
      )
  
      assert (
          stringify_annotation(
              Tuple[str, str, str], "fully-qualified-except-typing"
          )
          == "Tuple[str, str, str]"
      )
      assert (
          stringify_annotation(Tuple[str, str, str], "fully-qualified")
          == "typing.Tuple[str, str, str]"
      )
      assert (
          stringify_annotation(Tuple[str, str, str], "smart")
          == "~typing.Tuple[str, str, str]"
      )
  
      assert (
          stringify_annotation(
              Tuple[str, ...], "fully-qualified-except-typing"
          )
          == "Tuple[str, ...]"
      )
      assert (
          stringify_annotation(Tuple[str, ...], "fully-qualified")
          == "typing.Tuple[str, ...]"
      )
      assert (
          stringify_annotation(Tuple[str, ...], "smart")
          == "~typing.Tuple[str, ...]"
      )
  
      if sys.version_info[:2] <= (3, 10):
          assert (
              stringify_annotation(
                  Tuple[()], "fully-qualified-except-typing"
              )
              == "Tuple[()]"
          )
          assert (
              stringify_annotation(Tuple[()], "fully-qualified")
              == "typing.Tuple[()]"
          )
          assert (
              stringify_annotation(Tuple[()], "smart")
              == "~typing.Tuple[()]"
          )
      else:
          assert (
              stringify_annotation(
                  Tuple[()], "fully-qualified-except-typing"
              )
              == "Tuple"
          )
          assert (
              stringify_annotation(Tuple[()], "fully-qualified")
              == "typing.Tuple"
          )
          assert (
              stringify_annotation(Tuple[()], "smart")
              == "~typing.Tuple"
          )
  
      assert (
          stringify_annotation(
              List[Dict[str, Tuple]], "fully-qualified-except-typing"
          )
          == "List[Dict[str, Tuple]]"
      )
      assert (
          stringify_annotation(
              List[Dict[str, Tuple]], "fully-qualified"
          )
          == "typing.List[typing.Dict[str, typing.Tuple]]"
      )
      assert (
          stringify_annotation(List[Dict[str, Tuple]], "smart")
          == "~typing.List[~typing.Dict[str, ~typing.Tuple]]"
      )
  
      assert (
          stringify_annotation(
              MyList[Tuple[int, int]], "fully-qualified-except-typing"
          )
          == "tests.test_util.test_util_typing.MyList[Tuple[int, int]]"
      )
      assert (
          stringify_annotation(
              MyList[Tuple[int, int]], "fully-qualified"
          )
          == "tests.test_util.test_util_typing.MyList[typing.Tuple[int, int]]"
      )
      assert (
          stringify_annotation(MyList[Tuple[int, int]], "smart")
          == "~tests.test_util.test_util_typing.MyList[~typing.Tuple[int, int]]"
      )
  
      assert (
          stringify_annotation(
              Generator[None, None, None],
              "fully-qualified-except-typing",
          )
          == "Generator[None, None, None]"
      )
      assert (
          stringify_annotation(
              Generator[None, None, None], "fully-qualified"
          )
          == "typing.Generator[None, None, None]"
      )
      assert (
          stringify_annotation(Generator[None, None, None], "smart")
          == "~typing.Generator[None, None, None]"
      )
  
imports: import sys
  from contextvars import Context, ContextVar, Token
  from enum import Enum
  from numbers import Integral
  from struct import Struct
  from types import AsyncGeneratorType, BuiltinFunctionType, BuiltinMethodType, CellType, ClassMethodDescriptorType, CodeType, CoroutineType, FrameType, FunctionType, GeneratorType, GetSetDescriptorType, LambdaType, MappingProxyType, MemberDescriptorType, MethodDescriptorType, MethodType, MethodWrapperType, ModuleType, TracebackType, WrapperDescriptorType
  from typing import Any, Callable, Dict, Generator, List, NewType, Optional, Tuple, TypeVar, Union
  import pytest
  from sphinx.ext.autodoc import mock
  from sphinx.util.typing import _INVALID_BUILTIN_CLASSES, restify, stringify_annotation
label_desc: Use image node_id 16 for calling a global function with example usage: test_stringify_type_hints_containers() without return types