import pathlib


def create_reach_workspace() -> pathlib.Path:
  """Create the ~reach_workspace folder and return the path to it."""
  home_dir = pathlib.Path.home()
  if not home_dir.is_dir():
    raise RuntimeError(
        "Operating system home directory %s is not a home directory" % home_dir)
  working_directory = home_dir / "reach_workspace"
  if not working_directory.is_dir():
    working_directory.mkdir()
  return working_directory