def METHOD_NAME(ndim):
    shape = (5,) * ndim
    np_arr = mk_seq_array(np, shape)
    num_arr = mk_seq_array(num, shape)
    np_mask = (np_arr % 2).astype(bool)
    num_mask = (num_arr % 2).astype(bool)
    # scalar_val
    np.putmask(np_arr, np_mask, -10)
    num.putmask(num_arr, num_mask, -10)
    assert np.array_equal(np_arr, num_arr)
    # val is the same shape:
    np_val = np_arr * 10
    num_val = num_arr * 10
    np.putmask(np_arr, np_mask, np_val)
    num.putmask(num_arr, num_mask, num_val)
    assert np.array_equal(np_arr, num_arr)
    # val is different shape, but the same size
    shape_val = (np_arr.size,)
    np_values = mk_seq_array(np, shape_val) * 10
    num_values = mk_seq_array(num, shape_val) * 10
    np.putmask(np_arr, np_mask, np_values)
    num.putmask(num_arr, num_mask, num_values)
    assert np.array_equal(np_arr, num_arr)
    # val is different shape and smaller size for vals and array
    shape_val = (2,) * ndim
    np_values = mk_seq_array(np, shape_val) * 10
    num_values = mk_seq_array(num, shape_val) * 10
    np.putmask(np_arr, np_mask, np_values)
    num.putmask(num_arr, num_mask, num_values)
    assert np.array_equal(np_arr, num_arr)
    # val is different shape and bigger size for vals and array
    shape_val = (10,) * ndim
    np_values = mk_seq_array(np, shape_val) * 10
    num_values = mk_seq_array(num, shape_val) * 10
    np.putmask(np_arr, np_mask, np_values)
    num.putmask(num_arr, num_mask, num_values)
    assert np.array_equal(np_arr, num_arr)