def tag(text, tag, values={}):
    """ Wraps text into an HTML tag. Example:
        >>> tag("Some text", "p", {"id": "id_value"})
        >>> "<p id=id_value>Some text</p>

    Args:
        text (str): The text to wrap inside tags.
        tag (str): The kind of tag.
        values (dict): Optional additional tag key-value pairs.
    """
    values = "".join(" %s=%s" % item for item in values.items())
    return "<%s%s>%s</%s>" % (tag, values, text, tag)