code: def test_call(self):
      geo_feat_len = 24
      pooling_h, pooling_w = pooling_out_size = (2, 2)
      num_rois = 32
  
      local_graph_generator = LocalGraphs(
          (4, 4), 3, geo_feat_len, 1.0, pooling_out_size, 0.5
      )
  
      feature_maps = torch.randn((2, 3, 128, 128), dtype=torch.float)
      x = np.random.randint(4, 124, (num_rois, 1))
      y = np.random.randint(4, 124, (num_rois, 1))
      h = 4 * np.ones((num_rois, 1))
      w = 4 * np.ones((num_rois, 1))
      angle = (
          (np.random.random_sample((num_rois, 1)) * 2 - 1) * np.pi / 2
      )
      cos, sin = np.cos(angle), np.sin(angle)
      comp_labels = np.random.randint(1, 3, (num_rois, 1))
      num_rois = num_rois * np.ones((num_rois, 1))
      comp_attribs = np.hstack(
          [num_rois, x, y, h, w, cos, sin, comp_labels]
      )
      comp_attribs = comp_attribs.astype(np.float32)
      comp_attribs_ = comp_attribs.copy()
      comp_attribs = np.stack([comp_attribs, comp_attribs_])
  
      (
          node_feats,
          adjacent_matrix,
          knn_inds,
          linkage_labels,
      ) = local_graph_generator(feature_maps, comp_attribs)
      feat_len = (
          geo_feat_len + feature_maps.size()[1] * pooling_h * pooling_w
      )
  
      self.assertTrue(node_feats.dim() == adjacent_matrix.dim() == 3)
      self.assertEqual(node_feats.size()[-1], feat_len)
      self.assertEqual(knn_inds.size()[-1], 4)
      self.assertEqual(linkage_labels.size()[-1], 4)
      self.assertTrue(
          node_feats.size()[0]
          == adjacent_matrix.size()[0]
          == knn_inds.size()[0]
          == linkage_labels.size()[0]
      )
      self.assertTrue(
          node_feats.size()[1]
          == adjacent_matrix.size()[1]
          == adjacent_matrix.size()[2]
      )
  
imports: from unittest import TestCase, mock
  import numpy
  import torch
  from mmocr.models.textdet.heads.drrg_head import GCN, DRRGHead, LocalGraphs, ProposalLocalGraphs, feature_embedding, normalize_adjacent_matrix
label_desc: Use image node_id 1 for calling the TestLocalGraphs obj's underlying member method code with example usage: obj.test_call() without return types