class_docstr: Unit tests for the NNModifier class. 
class_docstr_tok: ["Unit","tests","for","the","NNModifier","class","."]
docstr: Test for the get_primitives_grouped_by_type method. 
docstr_tok: ["Test","for","the","get_primitives_grouped_by_type","method","."]
code: def test_get_primitives(self):
      """Test for the get_primitives_grouped_by_type method."""
      self.report("Testing get_primitives_grouped_by_type")
      test_nns = self.cnns + self.mlps
      primitives, _ = self.cnn_modifier.get_primitives_grouped_by_type(
          self.cnns[0]
      )
      self.report(
          "Types of primitives: %s" % (primitives.keys()), "test_result"
      )
      for idx, nn in enumerate(test_nns):
          nn_copy = deepcopy(nn)
          modifier, _ = self._get_modifier_and_cc(nn)
          primitives, _ = modifier.get_primitives_grouped_by_type(nn)
          report_str = "%d (%s n=%d,m=%d):: " % (
              idx,
              nn.nn_class,
              nn.num_layers,
              nn.get_total_num_edges(),
          )
          total_num_primitives = 0
          for _, list_or_prims in primitives.items():
              report_str += "%d, " % (len(list_or_prims))
              total_num_primitives += len(list_or_prims)
          report_str += "tot=%d" % (total_num_primitives)
          self.report(report_str, "test_result")
          assert networks_are_equal_are_equal(nn_copy, nn)
  
imports: from copy import deepcopy
  import numpy
  import os
  from shutil import rmtree
  import unittest
  from .None import nn_domains
  from .None import nn_modifiers
  from .neural_network import NeuralNetwork
  from .nn_visualise import visualise_nn
  from .unittest_neural_network import generate_cnn_architectures, generate_mlp_architectures
  from ..utils.base_test_class import BaseTestClass, execute_tests
label_desc: Use image node_id 3 for calling the NNModifierTestCase obj's underlying member method code with example usage: obj.test_get_primitives() without return types