human
Complete this python program:
def _link_to(text, *args, **kwargs):
assistant
#Here is the Python code you requested.

    """Common link making code for several helper functions
    """
    assert (len(args) < 2), 'Too    many    unnamed    arguments'
    def _link_class(kwargs):
        '    creates    classes    for    the    link_to    calls    '
        suppress_active_class = kwargs.pop('suppress_active_class', False)
        if ((not suppress_active_class) and _link_active(kwargs)):
            active = '    active'
        else:
            active = ''
        kwargs.pop('highlight_actions', '')
        return ((kwargs.pop('class_', '') + active) or None)
    def _create_link_text(text, **kwargs):
        '    Update    link    text    to    add    a    icon    or    span    if    specified    in    the\n                                kwargs    '
        if kwargs.pop('inner_span', None):
            text = ((literal('<span>') + text) + literal('</span>'))
        if icon:
            text = (literal(('<i    class="fa    fa-%s"></i>    ' % icon)) + text)
        return text
    icon = kwargs.pop('icon', None)
    class_ = _link_class(kwargs)
    return tags.link_to(_create_link_text(text, **kwargs), url_for(*args, **kwargs), class_=class_)