code: def check_socket_affinities(socket_affinities):
      # sets of cores should be either identical or disjoint
      for i, j in itertools.product(
          socket_affinities, socket_affinities
      ):
          if not set(i) == set(j) and not set(i).isdisjoint(set(j)):
              raise RuntimeError(
                  f"Sets of cores should be either identical or disjoint, "
                  f"but got {i} and {j}."
              )
  
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 6 for calling a global function with example usage: check_socket_affinities(socket_affinities) without return types