def set_challenge_for_url(url, challenge):
if not url:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not challenge:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>src_url = parse.urlparse(url)<EOL>if src_url.netloc != challenge.source_authority:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>_lock.acquire()<EOL>_cache[src_url.netloc] = challenge<EOL>_lock.release()<EOL>
Caches the challenge for the specified URL.
    :param url: the URL for which to cache the challenge
    :param challenge: the challenge to cache