code: def gen_rsp_random_indices(shape, density=0.5, force_indices=None):
      assert density >= 0 and density <= 1
      indices = set()
      if force_indices is not None:
          for val in force_indices:
              indices.add(int(val))
      if (
          not np.isclose(
              density, 0.0, rtol=1.0e-3, atol=1.0e-3, equal_nan=True
          )
          and len(shape) > 0
      ):
          row_count = shape[0]
          for i in range(row_count):
              r = random.uniform(0, 1)
              if r <= density and len(indices) < shape[0]:
                  indices.add(i)
      assert len(indices) <= shape[0]
      return list(indices)
  
imports: from mxnet.test_utils import *
  from mxnet.base import MXNetError
  import pytest
  from common import assertRaises
  import random
  import warnings
label_desc: Use image node_id 9 for calling a global function with example usage: gen_rsp_random_indices(shape, density, force_indices) and returns: list