code: def is_head(key):
      valid_head_list = [
          "bbox_head",
          "mask_head",
          "semantic_head",
          "grid_head",
          "mask_iou_head",
      ]
  
      return any(key.startswith(h) for h in valid_head_list)
  
file_path: mmdetection/tools/model_converters/upgrade_model_version.py
imports: import argparse
  import re
  import tempfile
  from collections import OrderedDict
  import torch
  from mmengine import Config
label_desc: Use image node_id 1 for calling a global function with example usage: is_head(key) and returns: any