code: def _modify_data(
      path: "StrPath",
      parser: ParserFn,
      dumper: DumpersFn,
      fs: Optional["FileSystem"] = None,
  ):
      file_exists = (
          fs.exists(os.fspath(path)) if fs else os.path.exists(path)
      )
      data = (
          _load_data(path, parser=parser, fs=fs) if file_exists else {}
      )
      yield data
      _dump_data(path, data, dumper=dumper, fs=fs)
  
imports: import os
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Callable, ContextManager, Dict, Optional, Protocol, TextIO, Union
  from funcy import reraise
  from dvc.exceptions import DvcException
label_desc: Use image node_id 3 for calling a global function with example usage: _modify_data(path, parser, dumper, fs) without return types