code: def generate_token_definitions(tokens: IO[str]) -> TokenDefinitions:
      all_tokens = {}
      exact_tokens = {}
      non_exact_tokens = set()
      numbers = itertools.count(0)
  
      for line in tokens:
          line = line.strip()
  
          if not line or line.startswith("#"):
              continue
  
          pieces = line.split()
          index = next(numbers)
  
          if len(pieces) == 1:
              (token,) = pieces
              non_exact_tokens.add(token)
              all_tokens[index] = token
          elif len(pieces) == 2:
              token, op = pieces
              exact_tokens[op.strip("'")] = index
              all_tokens[index] = token
          else:
              raise ValueError(
                  f"Unexpected line found in Tokens file: {line}"
              )
  
      return all_tokens, exact_tokens, non_exact_tokens
  
imports: import itertools
  import logging
  import os
  import pathlib
  import sys
  import sysconfig
  import tempfile
  import tokenize
  from typing import IO, Any, Dict, List, Optional, Set, Tuple
  from pegen.c_generator import CParserGenerator
  from pegen.grammar import Grammar
  from pegen.grammar_parser import GeneratedParser
  from pegen.parser import Parser
  from pegen.parser_generator import ParserGenerator
  from pegen.python_generator import PythonParserGenerator
  from pegen.tokenizer import Tokenizer
label_desc: Use image node_id 5 for calling a global function with example usage: generate_token_definitions(tokens) and returns: all_tokens,  exact_tokens,  non_exact_tokens