code: def parse_py_for_update(text, path):
      """Parses text into dict for update params."""
      with reraise(SyntaxError, PythonFileCorruptedError(path)):
          tree = ast.parse(text, filename=path)
  
      result = _ast_tree_to_dict(tree)
      result.update({_PARAMS_KEY: _ast_tree_to_dict(tree, lineno=True)})
      result.update({_PARAMS_TEXT_KEY: text})
      return result
  
file_path: dvc/dvc/utils/serialize/_py.py
imports: import ast
  from contextlib import contextmanager
  from typing import Any
  from funcy import reraise
  from ._common import ParseError, _dump_data, _load_data, _modify_data
label_desc: Use image node_id 3 for calling a global function with example usage: parse_py_for_update(text, path) and returns: result