code: def spectralBalancedCutClustering(
      G,
      num_clusters,
      num_eigen_vects=2,
      evs_tolerance=0.00001,
      evs_max_iter=100,
      kmean_tolerance=0.00001,
      kmean_max_iter=100,
  ):
      """
      Compute a clustering/partitioning of the given graph using the spectral
      balanced cut method.
  
      Parameters
      ----------
      G : cugraph.Graph or networkx.Graph
          Graph descriptor
  
      num_clusters : integer
          Specifies the number of clusters to find, must be greater than 1
  
      num_eigen_vects : integer, optional
          Specifies the number of eigenvectors to use. Must be lower or equal to
          num_clusters. Default is 2
  
      evs_tolerance: float, optional
          Specifies the tolerance to use in the eigensolver.
          Default is 0.00001
  
      evs_max_iter: integer, optional
          Specifies the maximum number of iterations for the eigensolver.
          Default is 100
  
      kmean_tolerance: float, optional
          Specifies the tolerance to use in the k-means solver.
          Default is 0.00001
  
      kmean_max_iter: integer, optional
          Specifies the maximum number of iterations for the k-means solver.
          Default is 100
  
      Returns
      -------
      df : cudf.DataFrame
          GPU data frame containing two cudf.Series of size V: the vertex
          identifiers and the corresponding cluster assignments.
  
          df['vertex'] : cudf.Series
              contains the vertex identifiers
          df['cluster'] : cudf.Series
              contains the cluster assignments
  
      Examples
      --------
      >>> from cugraph.datasets import karate
      >>> G = karate.get_graph(download=True)
      >>> df = cugraph.spectralBalancedCutClustering(G, 5)
  
      """
  
      # Error checking in C++ code
  
      G, isNx = ensure_cugraph_obj_for_nx(G)
      # Check if vertex type is "int32"
      if (
          G.edgelist.edgelist_df.dtypes[0] != np.int32
          or G.edgelist.edgelist_df.dtypes[1] != np.int32
      ):
          raise ValueError(
              "'spectralBalancedCutClustering' requires the input graph's vertex to be "
              "of type 'int32'"
          )
      vertex, partition = pylibcugraph_balanced_cut_clustering(
          ResourceHandle(),
          G._plc_graph,
          num_clusters,
          num_eigen_vects,
          evs_tolerance,
          evs_max_iter,
          kmean_tolerance,
          kmean_max_iter,
          do_expensive_check=False,
      )
  
      df = cudf.DataFrame()
      df["vertex"] = vertex
      df["cluster"] = partition
  
      if G.renumbered:
          df = G.unrenumber(df, "vertex")
  
      if isNx is True:
          df = df_score_to_dictionary(df, "cluster")
  
      return df
  
file_path: cugraph/python/cugraph/cugraph/community/spectral_clustering.py
imports: from cugraph.utilities import ensure_cugraph_obj_for_nx, df_score_to_dictionary
  from pylibcugraph import balanced_cut_clustering, spectral_modularity_maximization, analyze_clustering_modularity, analyze_clustering_edge_cut, analyze_clustering_ratio_cut
  from pylibcugraph import ResourceHandle
  import cudf
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: spectralBalancedCutClustering(G, num_clusters, num_eigen_vects, evs_tolerance, evs_max_iter, kmean_tolerance, kmean_max_iter) and returns: df