docstr: Parameters
  ----------
  global_label: NDArray
      Global label (after gathers label from all rank)
  Returns
  -------
  index: ndarray(numpy)
      Local index for memory bank to sample, start from 0 to num_local, length is num_sample.
  global_label: ndarray(numpy)
      Global label after sort and unique.
code: def sample(self, global_label):
      """
      Parameters
      ----------
      global_label: NDArray
          Global label (after gathers label from all rank)
      Returns
      -------
      index: ndarray(numpy)
          Local index for memory bank to sample, start from 0 to num_local, length is num_sample.
      global_label: ndarray(numpy)
          Global label after sort and unique.
      """
      assert isinstance(global_label, nd.NDArray)
      global_label = global_label.asnumpy()
      global_label = np.unique(global_label)
      global_label.sort()
      index = self.weight_index_sampler(global_label)
      index.sort()
      return index, global_label
  
file_path: insightface/recognition/partial_fc/mxnet/memory_bank.py
imports: import os
  import numpy
  from mxnet import nd
  import mxnet
  from memory_samplers import WeightIndexSampler
label_desc: Use image node_id 2 for calling the MemoryBank obj's underlying member method code with example usage: obj.sample(global_label) and returns: index,  global_label