'Get a valid link, False if not found'

def _get_link(self, cobj):

    fname_idx = None
    full_name = ((cobj['module_short'] + '.') + cobj['name'])
    if (full_name in self._searchindex['objects']):
        value = self._searchindex['objects'][full_name]
        if isinstance(value, dict):
            value = value[value.keys()[0]]
        fname_idx = value[0]
    elif (cobj['module_short'] in self._searchindex['objects']):
        value = self._searchindex['objects'][cobj['module_short']]
        if (cobj['name'] in value.keys()):
            fname_idx = value[cobj['name']][0]
    if (fname_idx is not None):
        fname = (self._searchindex['filenames'][fname_idx] + '.html')
        if self._is_windows:
            fname = fname.replace('/', '\\')
            link = os.path.join(self.doc_url, fname)
        else:
            link = posixpath.join(self.doc_url, fname)
        if (link in self._page_cache):
            html = self._page_cache[link]
        else:
            html = get_data(link)
            self._page_cache[link] = html
        comb_names = [((cobj['module_short'] + '.') + cobj['name'])]
        if (self.extra_modules_test is not None):
            for mod in self.extra_modules_test:
                comb_names.append(((mod + '.') + cobj['name']))
        url = False
        for comb_name in comb_names:
            if (html.find(comb_name) >= 0):
                url = ((link + '#') + comb_name)
        link = url
    else:
        link = False
    return link
