code: def _make_transition(token_namespace, reserved_syntax_strings, label):
      """
      Creates a reserved string ("if", "for", "*", ...) or returns the token type
      (NUMBER, STRING, ...) for a given grammar terminal.
      """
      if label[0].isalpha():
          # A named token (e.g. NAME, NUMBER, STRING)
          return getattr(token_namespace, label)
      else:
          # Either a keyword or an operator
          assert label[0] in ('"', "'"), label
          assert not label.startswith('"""') and not label.startswith(
              "'''"
          )
          value = literal_eval(label)
          try:
              return reserved_syntax_strings[value]
          except KeyError:
              r = reserved_syntax_strings[value] = ReservedString(value)
              return r
  
imports: from ast import literal_eval
  from typing import TypeVar, Generic, Mapping, Sequence, Set, Union
  from parso.pgen2.grammar_parser import GrammarParser, NFAState
label_desc: Use image node_id 6 for calling a global function with example usage: _make_transition(token_namespace, reserved_syntax_strings, label) and returns: getattr, reserved_syntax_strings, r