def METHOD_NAME(p: Union[str, pathlib.Path],
                   base: Optional[Union[str, pathlib.Path]] = None) -> pathlib.Path:
    """Turn path into absolute path resolving any `../` and `.`
       If path is relative pre-pend `base` path to it, `base` if set should be
       an absolute path. If not set, current working directory (as seen by the
       user launching the process, including any possible symlinks) will be
       used.
    """
    assert isinstance(p, (str, pathlib.Path))
    assert isinstance(base, (str, pathlib.Path, type(None)))
    def norm(p):
        return pathlib.Path(os.path.normpath(str(p)))
    if isinstance(p, str):
        p = pathlib.Path(p)
    if isinstance(base, str):
        base = pathlib.Path(base)
    if p.is_absolute():
        return norm(p)
    if base is None:
        base = default_base_dir()
    elif not base.is_absolute():
        raise ValueError("Expect base to be an absolute path")
    return norm(base / p)