code: def add_entities(self, group, labels):
      # Make a copy with an "entities" field added
      group = deepcopy(group)
      spans = deepcopy(group["spans"])
      group["entities"] = spans
      if len(spans) != len(labels):
          raise ValueError(
              "Number of labels and number of spans must match!"
          )
      for span, label in zip(spans, labels):
          span["label"] = label
      return group
  
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 2 for calling the TestGroupMetricCountFunctions obj's underlying member method code with example usage: obj.add_entities(group, labels) and returns: group