code: def test_rmat_edge_types(
      include_edge_types, min_max_edge_type_value, scramble_vertex_ids
  ):
      """
      Verifies that the edge types returned by rmat() are valid and that valid values
      are passed for 'min_edge_type_value' and 'max_edge_type_value'.
  
      """
      scale = 2
      num_edges = (2**scale) * 4
      create_using = None  # Returns the edgelist from RMAT
      min_edge_type_value, max_edge_type_value = min_max_edge_type_value
  
      if include_edge_types:
          if min_edge_type_value is None or max_edge_type_value is None:
              with pytest.raises(ValueError):
                  _call_rmat(
                      scale,
                      num_edges,
                      create_using,
                      scramble_vertex_ids=scramble_vertex_ids,
                      include_edge_types=include_edge_types,
                      min_edge_type_value=min_edge_type_value,
                      max_edge_type_value=max_edge_type_value,
                  )
          else:
              df = _call_rmat(
                  scale,
                  num_edges,
                  create_using,
                  scramble_vertex_ids=scramble_vertex_ids,
                  include_edge_types=include_edge_types,
                  min_edge_type_value=min_edge_type_value,
                  max_edge_type_value=max_edge_type_value,
              )
  
              # Check that there is an 'edge_type' column
              assert "edge_type" in df.columns
              edge_types_err1 = df.query(
                  "{} < edge_type".format(max_edge_type_value)
              )
              edge_types_err2 = df.query(
                  "{} > edge_type".format(min_edge_type_value)
              )
  
              # Check that edge weights values are between 'min_edge_type_value'
              # and 'max_edge_type_value'.
              assert len(edge_types_err1) == 0
              assert len(edge_types_err2) == 0
      else:
          df = _call_rmat(
              scale,
              num_edges,
              create_using,
              scramble_vertex_ids=scramble_vertex_ids,
              include_edge_types=include_edge_types,
              min_edge_type_value=min_edge_type_value,
              max_edge_type_value=max_edge_type_value,
          )
          assert len(df.columns) == 2
  
file_path: cugraph/python/cugraph/cugraph/tests/generators/test_rmat.py
imports: import pytest
  import cudf
  import cugraph
  from cugraph.generators import rmat
  from cupy.sparse import coo_matrix, triu, tril
  import numpy
  import cupy
label_desc: Use image node_id 4 for calling a global function with example usage: test_rmat_edge_types(include_edge_types, min_max_edge_type_value, scramble_vertex_ids) without return types