'Map a tag to it\'s short-hand URL.
>>> urlmap.url_tag(\'Inbox\')
\'/in/inbox/\'
>>> urlmap.url_tag(\'inbox\', output=\'json\')
\'/in/inbox/as.json\'
>>> urlmap.url_tag(\'1\')
\'/in/inbox/\'
Unknown tags raise an exception.
>>> urlmap.url_tag(\'99\')
Traceback (most recent call last):
ValueError: Unknown tag: 99'

def url_tag(self, tag_id, output=''):

    try:
        tag = self.config.tags[tag_id]
        if (tag is None):
            raise KeyError('oops')
    except (KeyError, IndexError):
        tag = [t for t in self.config.tags.values() if (t.slug == tag_id.lower())]
        tag = (tag and tag[0])
    if tag:
        return self._url(('/in/%s/' % tag.slug), output)
    raise ValueError(('Unknown    tag:    %s' % tag_id))
