code: def complete_multipartite_graph(*subset_sizes):
      if not subset_sizes:
          return nxcg.Graph()
      try:
          subset_sizes = [_ensure_int(size) for size in subset_sizes]
      except TypeError:
          subsets = [list(subset) for subset in subset_sizes]
          subset_sizes = [len(subset) for subset in subsets]
          nodes = list(concat(subsets))
      else:
          subsets = nodes = None
          try:
              subset_sizes = [
                  _ensure_nonnegative_int(size) for size in subset_sizes
              ]
          except nx.NetworkXError:
              if _IS_NX32_OR_LESS:
                  raise NotImplementedError(
                      "Negative number of nodes is not supported"
                  )
              raise
      L1 = []
      L2 = []
      total = 0
      for size in subset_sizes:
          all_indices = cp.indices((total, size), dtype=index_dtype)
          L1.append(all_indices[0].ravel())
          L2.append(all_indices[1].ravel() + total)
          total += size
      src_indices = cp.hstack(L1 + L2)
      dst_indices = cp.hstack(L2 + L1)
      subsets_array = cp.array(
          np.repeat(
              np.arange(
                  len(subset_sizes),
                  dtype=_get_int_dtype(len(subset_sizes) - 1),
              ),
              subset_sizes,
          )
      )
      return nxcg.Graph.from_coo(
          subsets_array.size,
          src_indices,
          dst_indices,
          node_values={"subset": subsets_array},
          id_to_key=nodes,
      )
  
imports: import itertools
  from numbers import Integral
  import cupy
  import networkx
  import numpy
  import nx_cugraph
  from ..utils import _get_int_dtype, index_dtype, networkx_algorithm
  from ._utils import _IS_NX32_OR_LESS, _common_small_graph, _complete_graph_indices, _create_using_class, _ensure_int, _ensure_nonnegative_int, _number_and_nodes
label_desc: Use image node_id 4 for calling a global function with example usage: complete_multipartite_graph() and returns: nxcg, nxcg