def set_np_compat(active):
    """
    Turns on/off NumPy compatibility. NumPy-compatibility is turned off by default in backend.

    Parameters
    ----------
    active : bool
        Indicates whether to turn on/off NumPy compatibility.

    Returns
    -------
        A bool value indicating the previous state of NumPy compatibility.
    """
    prev = ctypes.c_int()
    check_call(_LIB.MXSetIsNumpyCompatible(ctypes.c_int(active), ctypes.byref(prev)))
    return bool(prev.value)