code: def setUp(self):
      # Each line is 7 tokens, (x, percent, (, i, %, ), \n)
      text = (
          "five percent (5%) \n "
          + "fifty percent (50%) \n "
          + "two percent (2%) \n "
          + "nine percent (9%) \n "
          + "three percent (3%) \n "
      )
      group_a = {
          "spans": [
              {
                  "start": 0,
                  "end": 39,
                  "text": "five percent (5%) \n fifty percent (50%)",
              },
              {"start": 61, "end": 78, "text": "nine percent (9%)"},
          ],
          "label": "class1",
      }
      group_b = {
          "spans": [
              {"start": 42, "end": 58, "text": "two percent (2%)"},
              {"start": 81, "end": 99, "text": "three percent (3%)"},
          ],
          "label": "class1",
      }
      group_overlap = {
          "spans": [
              {
                  "start": 20,
                  "end": 58,
                  "text": "fifty percent (50%) \n two percent (2%)",
              },
              # Non overlapping span for joint metric tests
              {"start": 42, "end": 58, "text": "two percent (2%)"},
              {
                  "start": 66,
                  "end": 99,
                  "text": "percent (9%) \n three percent (3%)",
              },
          ],
          "label": "class1",
      }
      group_superset = {
          "spans": [
              {"start": 0, "end": 53, "text": text[0:53]},
              # Non superset span for joint metric tests
              {"start": 42, "end": 58, "text": "two percent (2%)"},
              {"start": 46, "end": 86, "text": text[46:86]},
          ],
          "label": "class1",
      }
      group_tokens = {
          "spans": [
              {"start": 0, "end": 4, "text": "five"},
              {"start": 54, "end": 58, "text": "(3%)"},
              {"start": 74, "end": 78, "text": "(9%)"},
          ],
          "label": "class1",
      }
      group_all = {
          "spans": [
              {"start": 0, "end": 102, "text": text},
          ],
          "label": "class1",
      }
      # Associate groups with keys so we can do set operations
      self.groups = {
          "group_a": group_a,
          "group_b": group_b,
          "group_overlap": group_overlap,
          "group_superset": group_superset,
          "group_tokens": group_tokens,
          "group_all": group_all,
      }
  
      # Make versions of all groups with no group label
      # Used to check label mismatch behavior
      no_label_groups = {}
      for name, group in self.groups.items():
          group = deepcopy(group)
          group["label"] = None
          no_label_groups[name + "_nl"] = group
      self.groups.update(no_label_groups)
  
      # Make versions with entities by assigning different labels
      # Used to check joint metrics
      self.joint_groups = {}
      # Labels to be assigned to spans in groups
      correct_labels = ["a", "a", "a", "a"]
      incorrect_labels = ["b", "b", "b", "b"]
      mix_labels = ["a", "b", "a", "b"]
      mix_inv_labels = mix_labels[::-1]
      for name, group in self.groups.items():
          name = name.replace("group", "joint")
          num_spans = len(group["spans"])
          # All correct labels
          self.joint_groups[name + "_cl"] = self.add_entities(
              group, correct_labels[:num_spans]
          )
          # All wrong labels
          self.joint_groups[name + "_icl"] = self.add_entities(
              group, incorrect_labels[:num_spans]
          )
          # Mixed labels, doesn't apply to groups with only 1 span
          if num_spans >= 2:
              self.joint_groups[name + "_ml"] = self.add_entities(
                  group, mix_labels[:num_spans]
              )
              self.joint_groups[name + "_mil"] = self.add_entities(
                  group, mix_inv_labels[:num_spans]
              )
  
imports: import unittest
  from copy import deepcopy
  from finetune.util.group_metrics import get_count_fn, calc_group_assignment, create_joint_groups, get_metrics, group_metrics, joint_metrics
label_desc: Use image node_id 1 for calling the TestGroupMetricCountFunctions obj's underlying member method code with example usage: obj.setUp() without return types