def set_challenge_for_url(url, challenge):
    """ Caches the challenge for the specified URL.
    :param url: the URL for which to cache the challenge
    :param challenge: the challenge to cache """
    if not url:
        raise ValueError('URL cannot be empty')

    if not challenge:
        raise ValueError('Challenge cannot be empty')

    src_url = parse.urlparse(url)
    if src_url.netloc != challenge.source_authority:
        raise ValueError('Source URL and Challenge URL do not match')

    _lock.acquire()

    _cache[src_url.netloc] = challenge

    _lock.release()
def set_challenge_for_url(url, challenge):
    """ Caches the challenge for the specified URL.
    :param url: the URL for which to cache the challenge
    :param challenge: the challenge to cache """
    if not url:
        raise ValueError('URL cannot be empty')

    if not challenge:
        raise ValueError('Challenge cannot be empty')

    src_url = parse.urlparse(url)
    if src_url.netloc != challenge.source_authority:
        raise ValueError('Source URL and Challenge URL do not match')

    _lock.acquire()

    _cache[src_url.netloc] = challenge

    _lock.release()
def set_challenge_for_url ( url , challenge ) : if not url : raise ValueError ( 'URL cannot be empty' ) if not challenge : raise ValueError ( 'Challenge cannot be empty' ) src_url = parse . urlparse ( url ) if src_url . netloc != challenge . source_authority : raise ValueError ( 'Source URL and Challenge URL do not match' ) _lock . acquire ( ) _cache [ src_url . netloc ] = challenge _lock . release ( )
Caches the challenge for the specified URL.
    :param url: the URL for which to cache the challenge
    :param challenge: the challenge to cache
Caches the challenge for the specified URL . : param url : the URL for which to cache the challenge : param challenge : the challenge to cache