code: def _get_ast_name(target, only_self_params=False):
      if hasattr(target, "id") and not only_self_params:
          return target.id
      if hasattr(target, "attr") and target.value.id == "self":
          return target.attr
      raise AttributeError
  
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 9 for calling a global function with example usage: _get_ast_name(target, only__params) and returns: target, target