code: def _load_data(
      path: "StrPath",
      parser: ParserFn,
      fs: Optional["FileSystem"] = None,
      **kwargs,
  ):
      open_fn = fs.open if fs else open
      encoding = "utf-8"
      with open_fn(path, encoding=encoding, **kwargs) as fd:  # type: ignore[operator]
          with reraise(
              UnicodeDecodeError, EncodingError(path, encoding)
          ):
              return parser(fd.read(), path)
  
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 1 for calling a global function with example usage: _load_data(path, parser, fs) and returns: parser