<commit_before><%def name="nav_link(href, text, class_, id_='', title='')">
<li class="${class_ or ''}" id="${id_}">
    <a href="${href}" title="${title}">${text}</a>
</li>
</%def>


<%def name="global_nav(active)">

<% 
   active_nav = {}
   active_nav[active] = 'current'

%>
<!-- begin: main navi -->
<nav>
    <div id="nav">
        <!-- skiplink anchor: navigation -->
        <a id="navigation" name="navigation"></a>
        <!-- main navigation: horizontal list -->
        <div class="menu hlist">
            <ul>
                <li class="${active_nav.get('home', '')}">
                <a href="${h.base_url(None, path='/')}">${_("Home")}</a></li>

                %if g.single_instance is None:
                <li class="${active_nav.get('instances', '')}"><a class="ttip" 
                       href="${h.base_url(None, path='/instance')}"
                       title="${_('All instances')}">${_("Instances")}</a></li>
                %endif

                %if c.user:
                <li class="${active_nav.get('watchlist', '')}"><a class="ttip"
                       href="${h.entity_url(c.user, member='watchlist')}" 
                       title="${_('All instances')}">${_("Watchlist")}</a></li>
                %endif
                <!-- FIXME: implemente About -->
                <li class="${active_nav.get('about', '')}"><a href="#" 
                       >${_('About')}</a></li>

                <li  class="${active_nav.get('help', '')}"
                     id="nav_help"><a class="" 
                                      href="${h.base_url(None, path='/static/help.html')}">${_("Help")}</a></li>

                <!-- FIXME: implemente personal drop down menu -->
                %if c.user:
                <li class="${active_nav.get('user', '')}">
                    <a title="${_('Your profile')}" href="${h.entity_url(c.user)}">
                        <!-- FIXME: User image <img width="16" height="16" 
                             src="${h.user.icon_url(c.user, size=16)|n}" /> --> 
                        ${c.user.name}
                    </a>
                </li>
                %else:
                <li class="${active_nav.get('login', '')}">
                    <a href="/login">${_("Login")}</a> 
                    <!-- FIXME: <a href="/register">${_("Register")}</a> -->

                </li>
                %endif<commit_msg>use the nav_link %def in global_nav()<commit_after><%def name="nav_link(href, text, class_, id_='', title='')">
<li class="${class_ or ''}" id="${id_}">
    <a href="${href}" title="${title}">${text}</a>
</li>
</%def>


<%def name="global_nav(active)">

<% 
   active_nav = {}
   active_nav[active] = 'current'

   def _class(identifier):
       return active_nav.get(identifier, '')
%>

<!-- begin: main navi -->
<nav>
    <div id="nav">
        <!-- skiplink anchor: navigation -->
        <a id="navigation" name="navigation"></a>
        <!-- main navigation: horizontal list -->
        <div class="menu hlist">
            <ul>
                ${nav_link(href=h.base_url(None, path='/'),
                           text=_("Home"), class_=_class('home'))}

                %if g.single_instance is None:
                ${nav_link(href=h.base_url(None, path='/instance'),
                           class_=_class('instances'),
                           title=_('All instances'),
                           text=_("Instances"))}
                %endif

                %if c.user:
                ${nav_link(href=h.entity_url(c.user, member='watchlist'),
                           title=_('All instances'),
                           class_=_class('watchlist'),
                           text=_("Watchlist"))}
                %endif
                <!-- FIXME: implemente About -->
                ${nav_link(href="#",
                           text=_('About'),
                           class_=_class('about'),
                           title="")}

                ${nav_link(href=h.base_url(None, path='/static/help.html'),
                           text=_("Help"),
                           class_=_class('help'),
                           id_="nav_help")}

                <!-- FIXME: implemente personal drop down menu -->
                %if c.user:
                ${nav_link(href=h.entity_url(c.user),
                           text=c.user.name,
                           title=_('Your profile'),
                           class_=_class('user'))}
                        <!-- FIXME: User image <img width="16" height="16" 
                             src="${h.user.icon_url(c.user, size=16)|n}" /> -->
                %else:
                ${nav_link(href="/login",
                           text=_("Login"),
                           class_=_class('login'))}
                <!-- FIXME: <a href="/register">${_("Register")}</a> -->
                %endif
{'fraction_non_alphanumeric': 0.20004103405826837, 'fraction_numerical': 0.0024620434961017644, 'mean_word_length': 1.421758569299553, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4992782', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1358, 'n_words': 231}