def is_type(x, types, full=False):
    """
    Returns true if x is of type in types tuple
    :param x:
    :param types:
    :param full:
    :return:
    """
    types = types if isinstance(types, tuple) else (types,)
    ins = isinstance(x, types)
    sub = False
    try:
        sub = issubclass(x, types)
    except Exception:
        pass
    res = ins or sub
    return res if not full else (res, ins)
