def check_writeable(arr: ndarray | tuple[ndarray, ...] | None) -> None:
    """
    Check if the current array is writeable
    This check needs to be manually inserted
    with consideration on the behavior of the corresponding method
    """
    if arr is None:
        return
    check_list = (arr,) if not isinstance(arr, tuple) else arr
    if any(not arr.flags.writeable for arr in check_list):
        raise ValueError("array is not writeable")

    Check if the current array is writeable
    This check needs to be manually inserted
    with consideration on the behavior of the corresponding method
    
cupynumeric/_array/util.py