import pathlib


def _detect_home_location() -> pathlib.Path:
    """Detects the location of the root directory"""

    # path/to/home/backend/core/config_loader.py
    path_to_self = pathlib.Path(__file__).absolute()

    # path/to/home/backend/core/
    path_to_core_module = path_to_self.parent

    # path/to/home/backend/
    path_to_backend_module = path_to_core_module.parent

    # path/to/home/
    path_to_home = path_to_backend_module.parent

    return path_to_home