def METHOD_NAME(url_text, replacement):
    "Replace the host portion of a URL"
    url = list(urllib.parse.urlparse(url_text))
    if replacement is not None:
        url[1] = __host_per_rfc_2732(replacement)
    return urllib.parse.urlunparse(url)