human
Complete this python program:
def TestUrl(workQueue, resultQueue):
assistant
#Here is the Python code you requested.

    """Worker thread procedure.
    Test how long it takes to return the mirror index page,
    then return the results into resultQueue.
    """
    def SubthreadProc(url, result):
        'Subthread    procedure.\n\n                                Actually    get    the    mirror    index    page    in    a    subthread,    so    that    we    can    time\n                                out    using    join    rather    than    wait    for    a    very    slow    server.        Passing    in    a\n                                list    for    result    lets    us    simulate    pass-by-reference,    since    callers\n                                cannot    get    the    return    code    from    a    Python    thread.\n                                '
        startTime = time.time()
        try:
            data = urllib.urlopen(url).read()
        except Exception:
            result.append((-1))
        else:
            if (not CheckTitle(data)):
                result.append((-1))
            else:
                elapsed = int(((time.time() - startTime) * 1000))
                result.append(elapsed)
    def CheckTitle(html):
        'Check    that    the    HTML    title    is    the    expected    value.\n\n                                Check    the    HTML    returned    for    the    presence    of    a    specified\n                                title.    This    caters    for    a    situation    where    a    service    provider\n                                may    be    redirecting    DNS    resolution    failures    to    a    web    search\n                                page,    or    where    the    returned    data    is    invalid    in    some    other\n                                way.\n                                '
        titleRegex = re.compile('<title>(.+?)</title>')
        try:
            title = titleRegex.search(html).group(1)
        except Exception:
            result.append((-1))
        else:
            if (title == HTTP_TITLE):
                return True
            else:
                return False
    while 1:
        try:
            url = workQueue.get(0)
        except Queue.Empty:
     ...