code: def generate_tokens(readline):
      """wrap generate_tokens to catch EOF errors"""
      try:
          for token in tokenize2.generate_tokens(readline):
              yield token
      except tokenize2.TokenError:
          # catch EOF error
          return
  
file_path: catboost/contrib/python/ipython/py2/IPython/utils/tokenutil.py
imports: from __future__ import absolute_import, print_function
  from collections import namedtuple
  from io import StringIO
  from keyword import iskeyword
  from .None import tokenize2
  from .py3compat import cast_unicode_py2
label_desc: Use image node_id 1 for calling a global function with example usage: generate_tokens(readline) without return types