code: def test_fetch_attack(return_X_y):
      dataset = list(np.random.choice(datasets, 1))[0]
      model = list(np.random.choice(models, 1))[0]
      attack = list(np.random.choice(attacks, 1))[0]
      try:
          data = fetch_attack(
              dataset=dataset,
              model=model,
              attack=attack,
              return_X_y=return_X_y,
          )
      except RequestException:
          pytest.skip(
              "Attack dataset URL down for dataset %s, model %s, and attack %s"
              % (dataset, model, attack)
          )
      if return_X_y:
          assert isinstance(data, tuple)
          assert (
              isinstance(data[0][0], np.ndarray)
              and isinstance(data[0][1], np.ndarray)
              and isinstance(data[1][0], np.ndarray)
              and isinstance(data[1][1], np.ndarray)
          )
      else:
          assert isinstance(data, Bunch)
          assert (
              isinstance(data.data_train, np.ndarray)
              and isinstance(data.data_test, np.ndarray)
              and isinstance(data.target_train, np.ndarray)
              and isinstance(data.target_test, np.ndarray)
          )
  
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 5 for calling a global function with example usage: test_fetch_attack(return_X_y) without return types