def _hook_internal_link(self, parser, space, name):
        text = False
        title = name

        # Split on pipe -- [[href|name]]
        if '|' in name:
            title, text = title.split('|', 1)

        hash = ''
        if '#' in title:
            title, hash = title.split('#', 1)

        # Sections use _, page names use +
        if hash != '':
            hash = '#' + hash.replace(' ', '_')

        # Links to this page can just contain href="#hash"
        if title == '' and hash != '':
            if not text:
                text = hash.replace('_', ' ')
            return u'<a href="%s">%s</a>' % (hash, text)

        link = _get_wiki_link(title, self.locale)
        extra_a_attr = ''
        if not link['found']:
            extra_a_attr += (u' class="new" title="{tooltip}"'
                             .format(tooltip=_('Page does not exist.')))
        if not text:
            text = link['text']
        return u'<a href="{url}{hash}"{extra}>{text}</a>'.format(
            url=link['url'], hash=hash, extra=extra_a_attr, text=text)
gp - underlying Gaussian process
dataset/ETHPy150Open mozilla/kitsune/kitsune/sumo/parser.py/WikiParser._hook_internal_link--crossover with--dataset/ETHPy150Open karlnapf/kameleon-mcmc/kameleon_mcmc/gp/inference/LaplaceApproximation.py/LaplaceApproximation.__init__