def Typecheck(arg, arg_type, msg=None):
    if (not isinstance(arg, arg_type)):
        if (msg is None):
            if isinstance(arg_type, tuple):
                msg = ('Type of arg is "%s", not one of %r' % (type(arg), arg_type))
            else:
                msg = ('Type of arg is "%s", not "%s"' % (type(arg), arg_type))
            raise exceptions.TypecheckError(msg)
    return arg
def Typecheck(arg, arg_type, msg=None):
    if (not isinstance(arg, arg_type)):
        if (msg is None):
            if isinstance(arg_type, tuple):
                msg = ('Type of arg is "%s", not one of %r' % (type(arg), arg_type))
            else:
                msg = ('Type of arg is "%s", not "%s"' % (type(arg), arg_type))
            raise exceptions.TypecheckError(msg)
    return arg