def METHOD_NAME(handle, is_view, is_container):
    global _TVM_ND_CLS
    handle = ctypes.cast(handle, TVMArrayHandle)
    if is_container:
        tindex = ctypes.c_uint()
        check_call(_LIB.TVMArrayGetTypeIndex(handle, ctypes.byref(tindex)))
        cls = _TVM_ND_CLS.get(tindex.value, _CLASS_NDARRAY)
    else:
        cls = _CLASS_NDARRAY
    ret = cls.__new__(cls)
    ret.handle = handle
    ret.is_view = is_view
    return ret