code: def test_tokenize_type_spec(self):
      specs = (
          "str",
          "defaultdict",
          "int, float, or complex",
          "int or float or None, optional",
          "list of list of int or float, optional",
          "tuple of list of str, float, or int",
          '{"F", "C", "N"}',
          "{'F', 'C', 'N'}, default: 'F'",
          "{'F', 'C', 'N or C'}, default 'F'",
          "str, default: 'F or C'",
          "int, default: None",
          "int, default None",
          "int, default :obj:`None`",
          '"ma{icious"',
          r"'with \'quotes\''",
      )
  
      tokens = (
          ["str"],
          ["defaultdict"],
          ["int", ", ", "float", ", or ", "complex"],
          ["int", " or ", "float", " or ", "None", ", ", "optional"],
          [
              "list",
              " of ",
              "list",
              " of ",
              "int",
              " or ",
              "float",
              ", ",
              "optional",
          ],
          [
              "tuple",
              " of ",
              "list",
              " of ",
              "str",
              ", ",
              "float",
              ", or ",
              "int",
          ],
          ["{", '"F"', ", ", '"C"', ", ", '"N"', "}"],
          [
              "{",
              "'F'",
              ", ",
              "'C'",
              ", ",
              "'N'",
              "}",
              ", ",
              "default",
              ": ",
              "'F'",
          ],
          [
              "{",
              "'F'",
              ", ",
              "'C'",
              ", ",
              "'N or C'",
              "}",
              ", ",
              "default",
              " ",
              "'F'",
          ],
          ["str", ", ", "default", ": ", "'F or C'"],
          ["int", ", ", "default", ": ", "None"],
          ["int", ", ", "default", " ", "None"],
          ["int", ", ", "default", " ", ":obj:`None`"],
          ['"ma{icious"'],
          [r"'with \'quotes\''"],
      )
  
      for spec, expected in zip(specs, tokens):
          actual = _tokenize_type_spec(spec)
          assert expected == actual
  
imports: import re
  from collections import namedtuple
  from inspect import cleandoc
  from textwrap import dedent
  from unittest import mock
  import pytest
  from sphinx.ext.napoleon import Config
  from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring, _convert_numpy_type_spec, _recombine_set_tokens, _token_type, _tokenize_type_spec
  from tests.test_extensions.ext_napoleon_pep526_data_google import PEP526GoogleClass
  from tests.test_extensions.ext_napoleon_pep526_data_numpy import PEP526NumpyClass
label_desc: Use image node_id 18 for calling the TestNumpyDocstring obj's underlying member method code with example usage: obj.test_tokenize_type_spec() without return types