code: def _adapt_path(change: "Change") -> str:
      isdir = False
      if change.new and change.new.meta:
          isdir = change.new.meta.isdir
      elif change.old and change.old.meta:
          isdir = change.old.meta.isdir
      key = change.key
      if isdir:
          key = (*key, "")
      return os.path.sep.join(key)
  
file_path: dvc/dvc/repo/data.py
imports: import os
  import posixpath
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, TypedDict, Union
  from dvc.fs.callbacks import DEFAULT_CALLBACK
  from dvc.ui import ui
label_desc: Use image node_id 3 for calling a global function with example usage: _adapt_path(change) and returns: os