code: def test_scipy_api_compat(connection_type):
      if connection_type == "strong":
          graph_file = DATASETS_BATCH[0]
      else:
          graph_file = DEFAULT_DATASETS[0]
  
      input_cugraph_graph = graph_file.get_graph()
  
      dataset_path = graph_file.get_path()
  
      input_coo_matrix = utils.create_obj_from_csv(
          dataset_path, cp_coo_matrix, edgevals=True
      )
  
      # connection is the only API that is accepted with cugraph objs
      retval = cugraph.connected_components(
          input_cugraph_graph, connection=connection_type
      )
      assert type(retval) is cudf.DataFrame
  
      # Ensure scipy-only options (except connection) are rejected for cugraph
      # inputs
      with pytest.raises(TypeError):
          cugraph.connected_components(
              input_cugraph_graph, directed=True
          )
      with pytest.raises(TypeError):
          cugraph.connected_components(
              input_cugraph_graph, return_labels=False
          )
      with pytest.raises(TypeError):
          cugraph.connected_components(
              input_cugraph_graph,
              connection=connection_type,
              return_labels=False,
          )
  
      # only accept weak or strong
      with pytest.raises(ValueError):
          cugraph.connected_components(
              input_cugraph_graph, connection="invalid"
          )
  
      (n_components, labels) = cugraph.connected_components(
          input_coo_matrix, directed=False, connection=connection_type
      )
      # FIXME: connection should default to "weak", need to test that
      (n_components, labels) = cugraph.connected_components(
          input_coo_matrix, directed=False
      )
      n_components = cugraph.connected_components(
          input_coo_matrix, directed=False, return_labels=False
      )
      assert type(n_components) is int
  
imports: import gc
  import time
  from collections import defaultdict
  import pytest
  import cupy
  import numpy
  import networkx
  from cupyx.scipy.sparse import coo_matrix
  from cupyx.scipy.sparse import csr_matrix
  from cupyx.scipy.sparse import csc_matrix
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from scipy.sparse import csc_matrix
  from cugraph.utilities import is_nx_graph_type
  import cudf
  import cugraph
  from cugraph.testing import utils, DEFAULT_DATASETS
  from cugraph.datasets import dolphins, netscience, email_Eu_core
label_desc: Use image node_id 17 for calling a global function with example usage: test_scipy_api_compat(connection_type) without return types