code: def read_py_file(filename, skip_encoding_cookie=True):
      """Read a Python file, using the encoding declared inside the file.
  
      Parameters
      ----------
      filename : str
          The path to the file to read.
      skip_encoding_cookie : bool
          If True (the default), and the encoding declaration is found in the first
          two lines, that line will be excluded from the output.
  
      Returns
      -------
      A unicode string containing the contents of the file.
      """
      filepath = Path(filename)
      with open(
          filepath
      ) as f:  # the open function defined in this module.
          if skip_encoding_cookie:
              return "".join(strip_encoding_cookie(f))
          else:
              return f.read()
  
file_path: catboost/contrib/python/ipython/py3/IPython/utils/openpy.py
imports: import io
  from io import TextIOWrapper, BytesIO
  from pathlib import Path
  import re
  from tokenize import open, detect_encoding
label_desc: Use image node_id 3 for calling a global function with example usage: read_py_file(filename, skip_encoding_cookie) and returns: str, f