code: def test_safe_indexing(self):
      npt.assert_array_equal(
          safe_indexing(np.asarray([3, 2, 1]), np.asarray([1, 2])),
          np.asarray([2, 1]),
      )
      npt.assert_array_equal(
          safe_indexing(np.asarray([3, 2, 1]), [1, 2]),
          np.asarray([2, 1]),
      )
      self.assertListEqual(safe_indexing([3, 2, 1], [1, 2]), [2, 1])
  
imports: import unittest
  import numpy
  import numpy.testing
  import scipy.sparse
  from cornac.utils.common import sigmoid
  from cornac.utils.common import safe_indexing
  from cornac.utils.common import validate_format
  from cornac.utils.common import scale
  from cornac.utils.common import clip
  from cornac.utils.common import excepts
  from cornac.utils.common import intersects
  from cornac.utils.common import estimate_batches
  from cornac.utils.common import get_rng
  from cornac.utils.common import normalize
label_desc: Use image node_id 6 for calling the TestCommon obj's underlying member method code with example usage: obj.test_safe_indexing() without return types