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
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