code: def _execute(kernel, args: tuple, kwargs: dict):
      for arg in chain(args, kwargs.values()):
          if not isinstance(arg, _array.DistributedArray):
              raise RuntimeError(
                  "Mixing a distributed array with a non-distributed one is"
                  " not supported"
              )
  
      # TODO: check if all distributed
      needs_peer_access = _is_peer_access_needed(args, kwargs)
      # if peer_access is not enabled in the current setup, we need to do a copy
      if needs_peer_access:
          return _execute_peer_access(kernel, args, kwargs)
      else:
          return _execute_kernel(kernel, args, kwargs)
  
imports: import typing
  from typing import Sequence
  from itertools import chain
  import cupy
  import cupy._creation.basic
  from cupy._core.core import ndarray
  from cupy.cuda.device import Device
  from cupy.cuda.stream import Stream
  from cupy.cuda.stream import get_current_stream
  from cupyx.distributed.array import _array
  from cupyx.distributed.array import _chunk
  from cupyx.distributed.array import _data_transfer
  from cupyx.distributed.array import _index_arith
  from cupyx.distributed.array import _modes
label_desc: Use image node_id 7 for calling a global function with example usage: _execute(kernel, args, kwargs) and returns: _execute_peer_access, _execute_kernel