code: def get_grouped_socket_affinities(
      nproc_per_node, exclude_unavailable_cores=True
  ):
      socket_affinities = get_socket_affinities(
          nproc_per_node, exclude_unavailable_cores
      )
      grouped_socket_affinities = group_affinity_by_siblings(
          socket_affinities
      )
      return grouped_socket_affinities
  
imports: import collections
  import itertools
  import os
  import pathlib
  import re
  import pynvml
  from typing import Union
  from enum import Enum, auto
label_desc: Use image node_id 8 for calling a global function with example usage: get_grouped_socket_affinities(nproc_per_node, exclude_unavailable_cores) and returns: grouped_socket_affinities