<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_url(url: str, url_vars: Mapping[str, Any]) -> str: """Construct a URL for the GitHub API. The URL may be absolute or relative. In the latter case the appropriate domain will be added. This is to help when copying the relative URL directly from the GitHub developer documentation. The dict provided in url_vars is used in URI template formatting. """

    url = urllib.parse.urljoin(DOMAIN, url)  # Works even if 'url' is fully-qualified.
    expanded_url: str = uritemplate.expand(url, var_dict=url_vars)
    return expanded_url