code: def _check_inputs_compatibility_for_scatter_gather(
      tensors, tensor_lists
  ):
      """Check the compatibility between tensor input and tensor list input."""
      if not tensors or not isinstance(tensors, list):
          raise RuntimeError(
              "The first argument 'tensors' expects a list of tensors."
          )
  
      if len(tensors) != 1:
          raise RuntimeError(
              "Gloo only accept one tensor in the first argument 'tensors'."
              " Got {} != 1.".format(len(tensors))
          )
  
      if not tensor_lists or not isinstance(tensor_lists, list):
          raise RuntimeError(
              "The second argument 'tensor_lists' expects a list of tensor list."
          )
  
      if len(tensor_lists) != 1:
          raise RuntimeError(
              "Gloo only accept one tensor list "
              "in the second argument 'tensor_lists'."
              " Got {} != 1.".format(len(tensor_lists))
          )
  
      dtype = gloo_util.get_gloo_tensor_dtype(tensors[0])
      shape = gloo_util.get_tensor_shape(tensors[0])
  
      # check all tensors in `tensor_lists` match.
      for t in tensor_lists[0]:
          # check dtype
          dt = gloo_util.get_gloo_tensor_dtype(t)
          if dt != dtype:
              raise RuntimeError(
                  "All tensor operands to scatter/gather must "
                  "have the same dtype. Got '{}' and '{}'.".format(
                      dt, dtype
                  )
              )
          s = gloo_util.get_tensor_shape(t)
          if s != shape:
              raise RuntimeError(
                  "All tensor operands to scatter/gather must "
                  "have the same shape. Got '{}' and '{}'.".format(
                      s, shape
                  )
              )
  
imports: import datetime
  import logging
  import os
  import shutil
  import time
  import numpy
  import pygloo
  import ray
  from ray._private import ray_constants
  from ray.util.collective.collective_group import gloo_util
  from ray.util.collective.collective_group.base_collective_group import BaseGroup
  from ray.util.collective.const import get_store_name
  from ray.util.collective.types import AllGatherOptions, AllReduceOptions, Backend, BarrierOptions, BroadcastOptions, RecvOptions, ReduceOptions, ReduceScatterOptions, SendOptions
label_desc: Use image node_id 3 for calling a global function with example usage: _check_inputs_compatibility_for_scatter_gather(tensors, tensor_lists) without return types