def tag_kind(tag, default=consts.TAG_KIND_UNKNOWN):
    """\
    Returns the TAG kind.

    `tag`
        A string.
    `default`
        A value to return if the TAG kind is unknown
        (set to ``constants.TAG_KIND_UNKNOWN`` by default)
    """
    if len(tag) == 2:
        return consts.TAG_KIND_GEO
    if u',' in tag:
        return consts.TAG_KIND_PERSON
    if tag[0] in u'Kk' and len(tag) == 4:
        return consts.TAG_KIND_PROGRAM
    t = tag.upper()
    if t in _TAGS_SUBJECT:
        return consts.TAG_KIND_SUBJECT
    if t in _TAGS_ORG:
        return consts.TAG_KIND_ORG
    return default
\
    Returns the TAG kind.

    `tag`
        A string.
    `default`
        A value to return if the TAG kind is unknown
        (set to ``constants.TAG_KIND_UNKNOWN`` by default)