def METHOD_NAME(page_url, url):
    """Resolve a URL relative to a page"""
    # full URL, nothing to resolve
    if "://" in url:
        return url
    parsed = urlparse(page_url)
    if url.startswith("/"):
        # absolute path
        return f"{parsed.scheme}://{parsed.netloc}{url}"
    # relative path URL
    if page_url.endswith("/"):
        # URL is a directory, resolve relative to dir
        path = parsed.path
    else:
        # URL is not a directory, resolve relative to parent
        path = parsed.path.rsplit("/", 1)[0] + "/"
    return f"{parsed.scheme}://{parsed.netloc}{path}{url}"