import pathlib


def process_path(path, parent, default):
    """Convert a path to an absolute path based on its current value.

    Arguments
    ---------
    path : PathLike
        The path to be processed.
    parent : PathLike
        The parent path that `path` will be appended to if `path` is a relative path.
    default : PathLike
        If the content of `path` is None, substitute `path` with this value.

    Returns
    -------
    If `path` is None and `default` is a relative path, return `parent/default`.
    If `path` is None and `default` is an absolute path, return `default`.
    If `path` is a relative path, return `parent/path`.
    If `path` is an absolute path, return `path`.

    The type of the retuen is `pathlib.Path`.
    """
    path = pathlib.Path(default) if path is None else pathlib.Path(path)

    if path.is_absolute():
        return path

    return pathlib.Path(parent).joinpath(path)