code: def test_fetch_kdd(return_X_y):
      target = np.random.choice(target_list, 2, replace=False)
      keep_cols = np.random.choice(keep_cols_list, 5, replace=False)
      try:
          data = fetch_kdd(
              target=target,
              keep_cols=keep_cols,
              percent10=True,
              return_X_y=return_X_y,
          )
      except URLError:
          pytest.skip("KDD dataset URL down")
      if return_X_y:
          assert isinstance(data, tuple)
          assert isinstance(data[0], np.ndarray) and isinstance(
              data[1], np.ndarray
          )
      else:
          assert isinstance(data, Bunch)
          assert isinstance(data.data, np.ndarray) and isinstance(
              data.target, np.ndarray
          )
          assert list(data.feature_names) == list(keep_cols)
  
file_path: alibi-detect/alibi_detect/tests/test_datasets.py
imports: import numpy
  import pandas
  import pytest
  from requests import RequestException
  from urllib.error import URLError
  from alibi_detect.datasets import fetch_kdd, fetch_ecg, corruption_types_cifar10c, fetch_cifar10c, fetch_attack, fetch_nab, get_list_nab
  from alibi_detect.utils.data import Bunch
label_desc: Use image node_id 1 for calling a global function with example usage: test_fetch_kdd(return_X_y) without return types