code: def test_update_index_variable():
      x_np = np.random.rand(20)
      i_np = np.random.choice(np.arange(20), 10)
      x_nn = nn.Variable.from_numpy_array(x_np)
      i_nn = nn.Variable.from_numpy_array(i_np)
      y_nn = x_nn[i_nn]
      y_nn.forward()
      assert_allclose(y_nn.d, x_np[i_np])
      i_np = np.random.choice(np.arange(20), 10)
      i_nn.d = i_np
      y_nn.forward()
      assert_allclose(y_nn.d, x_np[i_np])
  
file_path: nnabla/python/test/test_indexing.py
imports: import pytest
  import numpy
  import nnabla
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 6 for calling a global function with example usage: test_update_index_variable() without return types