class_docstr: Swap entities with other entities of the same category.
class_docstr_tok: ["Swap","entities","with","other","entities","of","the","same","category","."]
docstr: Random generate entities of given categories
  
  :param list categories:
  :param int n:
  :return list rand_entities: indices and random entities respectively
docstr_tok: ["Random","generate","entities","of","given","categories",":","param","list","categories",":",":","param","int","n",":",":","return","list","rand_entities",":","indices","and","random","entities","respectively"]
code: def _get_random_entities(self, categories, n):
      r"""
      Random generate entities of given categories
  
      :param list categories:
      :param int n:
      :return list rand_entities: indices and random entities respectively
  
      """
      rand_entities = []
  
      for i in range(len(categories)):
          if categories[i] not in self.entities_dic:
              rand_entities.append([])
          else:
              rand_entities.append(
                  self.sample_num(self.entities_dic[categories[i]], n)
              )
  
      return rand_entities
  
file_path: textflint/textflint/generation/transformation/UT/swap_named_ent.py
imports: from ..transformation import Transformation
  from ....common.settings import ENTITIES_PATH, CORENLP_ENTITY_MAP
  from ....common.utils.load import json_loader
  from ....common.utils.list_op import trade_off_sub_words
  from ....common.utils.install import download_if_needed
label_desc: Use image node_id 5 for calling the SwapNamedEnt obj's underlying member method code with example usage: obj._get_random_entities(categories, n) and returns: rand_entities