human
Complete the below
def _doSearch():

    ''''This function performs search dorking, parses results
    and saves the testable hosts into the knowledge base.'
    '''
 Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    if (not conf.googleDork):
        return
    kb.data.onlyGETs = None
    def retrieve():
        links = search(conf.googleDork)
        if (not links):
            errMsg = 'unable    to    find    results    for    your    '
            errMsg += 'search    dork    expression'
            raise SqlmapGenericException(errMsg)
        for link in links:
            link = urldecode(link)
            if re.search('(.*?)\\?(.+)', link):
                kb.targets.add((link, conf.method, conf.data, conf.cookie, None))
            elif re.search(URI_INJECTABLE_REGEX, link, re.I):
                if ((kb.data.onlyGETs is None) and (conf.data is None) and (not conf.googleDork)):
                    message = 'do    you    want    to    scan    only    results    containing    GET    parameters?    [Y/n]    '
                    test = readInput(message, default='Y')
                    kb.data.onlyGETs = (test.lower() != 'n')
                if ((not kb.data.onlyGETs) or conf.googleDork):
                    kb.targets.add((link, conf.method, conf.data, conf.cookie, None))
        return links
    while True:
        links = retrieve()
        if kb.targets:
            infoMsg = ('sqlmap    got    %d    results    for    your    ' % len(links))
            infoMsg += 'search    dork    expression,    '
            if (len(links) == len(kb.targets)):
                infoMsg += 'all    '
            else:
                infoMsg += ('%d    ' % len(kb.targets))
            infoMsg += 'of    them    are    testable    targets'
            logger.info(infoMsg)
            break
        else:
            message = ('sqlmap    got    %d    results    ' % len(links))
            message += 'for    your    search    dork    expression,    but    none    of    them    '
            message += 'have    GET    parameters    to    test    for    SQL    injection.    '
            message += 'Do    you    want    to    skip    to    the    next    result    page?    [Y/n]'
            test = readInput(message, default='Y')
...