from pathlib import Path


def _expand_home(path):
  """
  pathlib doesn't interpret ~/ as $HOME
  This doesnt deal with other user's homes e.g. ~another/dir is not changed
  """
  return Path(str(path).replace("~/", str(Path.home()) + "/"))