def dict_contains(subdict, maindict):
    """
    return True if the subdict is present with the sames values in dict.
    can be recursive. if maindict contains some key not in subdict it's ok.
    but if subdict has a key not in maindict or the value are not the same, it's a failure.

    >>> dict_contains(dict(a=1, b=2), dict(a=1, c=2, b=2))
    True

    >>> dict_contains(dict(a=dict(aa=1)), dict(a=dict(aa=1, bb=2), b=2))
    True

    >>> dict_contains(dict(a=dict(aa=1, bb=2)), dict(a=dict(aa=2)))
    False

    >>> dict_contains(dict(a=dict(aa=1)), dict(a=[]))
    False

    >>> dict_contains(dict(a=1), dict())
    False

    >>> dict_contains(dict(a=[1, 2, 3]), dict(a=[1, 2, 3]))
    True

    >>> dict_contains(dict(a=[1, 3, 2]), dict(a=[1, 2, 3]))
    False

    >>> dict_contains(dict(a=[1, 3]), dict(a=[1, 2, 3]))
    False

    >>> dict_contains(dict(a=[1, 3, 2]), dict(a={1, 2, 3}))
    True

    :param subdict: the smaller dict that should be present in the big one
    :param maindict: the dict
    :return: True if subdict is included in maindict
    :rtype: bool
    """
    try:
        for k, v in subdict.items():
            mainv = maindict[k]
            if isinstance(mainv, dict) and isinstance(v, dict):
                if not dict_contains(v, mainv):
                    return False
            elif isinstance(mainv, (set, frozenset)):
                return set(v) == mainv
            elif mainv != v:
                return False
    except KeyError:
        return False
    return True