code: def _group_by(
      values: Sequence[Tuple[Partition, _T]],
      dimensions: Sequence[str],
  ) -> Mapping[Sequence[int], Sequence[Tuple[Partition, _T]]]:
      result = collections.defaultdict(list)
      for partition, value in values:
          result[partition.partial(dimensions)].append(
              (partition, value)
          )
      return result
  
file_path: tfx/tfx/orchestration/portable/input_resolution/partition_utils.py
imports: import collections
  from typing import Callable, Mapping, Sequence, Tuple, TypeVar
label_desc: Use image node_id 1 for calling a global function with example usage: _group_by(values, dimensions) and returns: result