code: def _dump_data(
      path,
      data: Any,
      dumper: DumpersFn,
      fs: Optional["FileSystem"] = None,
      **dumper_args,
  ):
      open_fn = fs.open if fs else open
      with open_fn(path, "w+", encoding="utf-8") as fd:  # type: ignore[operator]
          dumper(data, fd, **dumper_args)
  
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 2 for calling a global function with example usage: _dump_data(path, data, dumper, fs) without return types