code: def _group_str(names: List[str]) -> str:
      """
      Turn "common1", "common2", "common3" into "common{1,2,3}"
      """
      lcp = _longest_common_prefix_str(names)
      rest = [x[len(lcp) :] for x in names]
      rest = "{" + ",".join(rest) + "}"
      ret = lcp + rest
  
      # add some simplification for BN specifically
      ret = ret.replace(
          "bn_{beta,running_mean,running_var,gamma}", "bn_*"
      )
      ret = ret.replace(
          "bn_beta,bn_running_mean,bn_running_var,bn_gamma", "bn_*"
      )
      return ret
  
file_path: detectron2/detectron2/checkpoint/c2_model_loading.py
imports: import copy
  import logging
  import re
  from typing import Dict, List
  import torch
  from tabulate import tabulate
label_desc: Use image node_id 7 for calling a global function with example usage: _group_str(names) and returns: ret