code: def test_contrib_intgemm_take_weight(indices, api):
      if "intgemm_take_weight" not in dir(mx.nd.contrib):
          return
      contrib, top = api
      m = top.array(
          [random.randint(-127, 127) for i in range(16 * 64)],
          dtype="int8",
      )
      m = m.reshape((16, 64))
      indices = top.array(indices, dtype="int32")
      # Prepare weight then take.
      test = contrib.intgemm_prepare_weight(m, already_quantized=True)
      test = contrib.intgemm_take_weight(test, indices)
      # Take then prepare.
      ref = m.take(indices, axis=0)
      ref = contrib.intgemm_prepare_weight(ref, already_quantized=True)
      assert same(test, ref)
  
file_path: mxnet/tests/python/unittest/test_contrib_intgemm.py
imports: import mxnet
  from mxnet import np, npx
  from mxnet.test_utils import same, use_np, assert_almost_equal
  import random
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_contrib_intgemm_take_weight(indices, api) without return types