code: def rmat(
      scale,
      num_edges,
      a=0.57,
      b=0.19,
      c=0.19,
      seed=42,
      clip_and_flip=False,
      scramble_vertex_ids=False,
      include_edge_weights=False,
      minimum_weight=None,
      maximum_weight=None,
      dtype=None,
      include_edge_ids=False,
      include_edge_types=False,
      min_edge_type_value=None,
      max_edge_type_value=None,
      create_using=cugraph.Graph,
      mg=False,
  ):
      """
      Generate a Graph object using a Recursive MATrix (R-MAT) graph generation
      algorithm.
  
      Parameters
      ----------
      scale : int
          Scale factor to set the number of vertices in the graph. Vertex IDs have
          values in [0, V), where V = 1 << 'scale'.
  
      num_edges : int
          Number of edges to generate
  
      a : float, optional (default=0.57)
          Probability of the edge being in the first partition
          The Graph 500 spec sets this value to 0.57.
  
      b : float, optional (default=0.19)
          Probability of the edge being in the second partition
          The Graph 500 spec sets this value to 0.19.
  
  
      c : float, optional (default=0.19)
          Probability of the edge being in the third partition
          The Graph 500 spec sets this value to 0.19.
  
      seed : int, optional (default=42)
          Seed value for the random number generator.
  
      clip_and_flip : bool, optional (default=False)
          Flag controlling whether to generate edges only in the lower triangular
          part (including the diagonal) of the graph adjacency matrix
          (if set to True) or not (if set to 'false).
  
      scramble_vertex_ids : bool, optional (default=False)
          Flag controlling whether to scramble vertex ID bits (if set to `true`)
          or not (if set to `false`); scrambling vertex ID bits breaks
          correlation between vertex ID values and vertex degrees.
  
      include_edge_weights : bool, optional (default=False)
          Flag controlling whether to generate edges with weights
          (if set to True) or not (if set to False).
  
      minimum_weight : float
          Minimum weight value to generate if 'include_edge_weights' is True
          otherwise, this parameter is ignored.
  
      maximum_weight : float
          Maximum weight value to generate if 'include_edge_weights' is True
          otherwise, this parameter is ignored.
  
      dtype : numpy.float32, numpy.float64, cupy.float32, cupy.float64,
      "float32", "float64"
          The type of weight to generate which is ignored unless
          include_weights is true.
  
      include_edge_ids : bool, optional (default=False)
          Flag controlling whether to generate edges with ids
          (if set to True) or not (if set to False).
  
      include_edge_types : bool, optional (default=False)
          Flag controlling whether to generate edges with types
          (if set to True) or not (if set to False).
  
      min_edge_type_value : int
          Minimum edge type to generate if 'include_edge_types' is True
          otherwise, this parameter is ignored.
  
      max_edge_type_value : int
          Maximum edge type to generate if 'include_edge_types' is True
          otherwise, this paramter is ignored.
  
      create_using : cugraph Graph type or None The graph type to construct
          containing the generated edges and vertices.  If None is specified, the
          edgelist cuDF DataFrame (or dask_cudf DataFrame for MG) is returned
          as-is. This is useful for benchmarking Graph construction steps that
          require raw data that includes potential self-loops, isolated vertices,
          and duplicated edges.  Default is cugraph.Graph.
  
      mg : bool, optional (default=False)
          If True, R-MAT generation occurs across multiple GPUs. If False, only a
          single GPU is used.  Default is False (single-GPU).
  
      Returns
      -------
      instance of cugraph.Graph or cudf or dask_cudf DataFrame
  
      Examples
      --------
      >>> import cugraph
      >>> from cugraph.generators import rmat
      >>> scale = 10
      >>> edgefactor = 16
      >>> df = rmat(
      ...    scale,
      ...    (2**scale)*edgefactor,
      ...    0.57,
      ...    0.19,
      ...    0.19,
      ...    seed=42,
      ...    clip_and_flip=False,
      ...    scramble_vertex_ids=True,
      ...    create_using=None,
      ...    mg=False
      ... )
  
      """
  
      _ensure_args_rmat(
          scale=scale,
          num_edges=num_edges,
          a=a,
          b=b,
          c=c,
          seed=seed,
          clip_and_flip=clip_and_flip,
          scramble_vertex_ids=scramble_vertex_ids,
          include_edge_weights=include_edge_weights,
          minimum_weight=minimum_weight,
          maximum_weight=maximum_weight,
          dtype=dtype,
          include_edge_ids=include_edge_ids,
          include_edge_types=include_edge_types,
          min_edge_type_value=min_edge_type_value,
          max_edge_type_value=max_edge_type_value,
          create_using=create_using,
          mg=mg,
      )
  
      if mg:
          return _mg_rmat(
              scale,
              num_edges,
              a,
              b,
              c,
              seed,
              clip_and_flip,
              scramble_vertex_ids,
              include_edge_weights,
              minimum_weight,
              maximum_weight,
              dtype,
              include_edge_ids,
              include_edge_types,
              min_edge_type_value,
              max_edge_type_value,
              create_using,
          )
      else:
          return _sg_rmat(
              scale,
              num_edges,
              a,
              b,
              c,
              seed,
              clip_and_flip,
              scramble_vertex_ids,
              include_edge_weights,
              minimum_weight,
              maximum_weight,
              dtype,
              include_edge_ids,
              include_edge_types,
              min_edge_type_value,
              max_edge_type_value,
              create_using,
          )
  
file_path: cugraph/python/cugraph/cugraph/generators/rmat.py
imports: from dask.distributed import default_client, wait
  import dask_cudf
  from cugraph.dask.comms import comms
  import cudf
  import numpy
  import cupy
  import cugraph
  from pylibcugraph import generate_rmat_edgelist
  from pylibcugraph import generate_rmat_edgelists
  from pylibcugraph import ResourceHandle
label_desc: Use image node_id 7 for calling a global function with example usage: rmat(scale, num_edges, a, b, c, seed, clip_and_flip, scramble_vertex_ids, include_edge_weights, minimum_weight, maximum_weight, dtype, include_edge_ids, include_edge_types, min_edge_type_value, max_edge_type_value, create_using, mg) and returns: _mg_rmat, _sg_rmat