code: def group(arr, fn):
      res = collections.defaultdict(list)
  
      for ob in arr:
          res[fn(ob)].append(ob)
  
      return list(res.values())
  
imports: import os
  import pathlib
  import re
  import collections
  import functools
  import inspect
  import sys
  from typing import List, Union
  import torch
  from omegaconf import OmegaConf
  import sacrebleu
  from rouge_score import rouge_scorer, scoring
label_desc: Use image node_id 5 for calling a global function with example usage: group(arr, fn) and returns: list