code: def _token_to_transition(grammar, type_, value):
      # Map from token to label
      if type_.value.contains_syntax:
          # Check for reserved words (keywords)
          try:
              return grammar.reserved_syntax_strings[value]
          except KeyError:
              pass
  
      return type_
  
imports: from typing import Dict, Type
  from parso import tree
  from parso.pgen2.generator import ReservedString
label_desc: Use image node_id 1 for calling a global function with example usage: _token_to_transition(grammar, type_, value) and returns: type_, grammar