code: def entity_in_group(entity, group):
      """
      Returns True if entity is contained in a group span, False otherwise
      :param entity: A single entity span
      :param group: A single group
      """
      for span in group["spans"]:
          if (
              span["start"] <= entity["start"]
              and span["end"] >= entity["end"]
          ):
              return True
      return False
  
imports: from copy import deepcopy
  from collections import namedtuple
  import numpy
  from scipy.optimize import linear_sum_assignment
  from finetune.util.metrics import _convert_to_token_list, _get_unique_classes, calc_precision, calc_recall, calc_f1
label_desc: Use image node_id 18 for calling a global function with example usage: entity_in_group(entity, group) and returns: False, True