def common_chars(seq, k):
    """ Returns the set of characters that appear more than k times in
    the input string, along with their number of occurrences.

    Example:
    >>> common_chars("cat in a hat", 2)
    {("a", 3), (" ", 3)}
    """
    chars = set()

    for i in range(len(seq)):
        if seq.count(seq[i]) > k:
            chars.add((seq[i], seq.count(seq[i])))
    return chars