code: def test_boolean_index_assign():
      # test boolean indexing assign
      shape = (3, 2, 3)
      mx_data = np.random.uniform(size=shape)
      mx_mask = np.array(
          [[False, True], [True, False], [True, False]], dtype=np.bool
      )
      np_data = mx_data.asnumpy()
      np_mask = mx_mask.asnumpy()
  
      np_data[np_data > 0.5] = 0
      mx_data[mx_data > 0.5] = 0
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
      np_data[np_mask] = 1
      mx_data[mx_mask] = 1
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
      np_data[np_mask, 1] = 2
      mx_data[mx_mask, 1] = 2
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
      np_data[np_mask, :] = 3
      mx_data[mx_mask, :] = 3
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
      mx_mask = np.array(
          [[False, True, True], [False, True, False]], dtype=np.bool
      )
      np_mask = mx_mask.asnumpy()
  
      np_data[0, np_mask] = 5
      mx_data[0, mx_mask] = 5
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
      np_data[:, np_mask] = 6
      mx_data[:, mx_mask] = 6
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
      np_data[0, True, True, np_mask] = 7
      mx_data[0, True, True, mx_mask] = 7
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
      np_data[False, 1] = 8
      mx_data[False, 1] = 8
      assert_almost_equal(
          mx_data.asnumpy(),
          np_data,
          rtol=1e-3,
          atol=1e-5,
          use_broadcast=False,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  import itertools
  import os
  import pytest
  import operator
  import numpy
  import mxnet
  from mxnet import np, npx, autograd
  from mxnet.gluon import HybridBlock
  from mxnet.test_utils import same, assert_almost_equal, rand_shape_nd, rand_ndarray, use_np
  from common import retry, TemporaryDirectory, xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_exception, is_op_runnable, collapse_sum_like
  from mxnet.ndarray.ndarray import py_slice
  from mxnet.base import integer_types
label_desc: Use image node_id 22 for calling a global function with example usage: test_boolean_index_assign() without return types