def ret(*types, **kargs):
    if ((len(types) is 1) and (not isinstance(types[0], type)) and callable(types[0])):
        raise ValueError("You should not pass a function to TypeError.ret, maybe you did not write as '@TypeError.ret()...'")

    def decorator(func):

        def modified(*args, **kargs):
            ret = func(*args, **kargs)
            if (not isinstance(ret, types)):
                raise TypeError(('The function %s is returning an abnormal value, expected %s but got %s' % (func, types, type(ret))))
            return ret
        return modified
    return decorator
def ret(*types, **kargs):
    if ((len(types) is 1) and (not isinstance(types[0], type)) and callable(types[0])):
        raise ValueError("You should not pass a function to TypeError.ret, maybe you did not write as '@TypeError.ret()...'")

    def decorator(func):

        def modified(*args, **kargs):
            ret = func(*args, **kargs)
            if (not isinstance(ret, types)):
                raise TypeError(('The function %s is returning an abnormal value, expected %s but got %s' % (func, types, type(ret))))
            return ret
        return modified
    return decorator