code: def test_dataset_as_bunch(self, as_frame, fetch_function):
      if (
          as_frame is False
          and fetch_function is fetch_diabetes_hospital
      ):
          msg = "fetch_diabetes_hospital will be skipped until dataset is fixed."
          pytest.skip(msg)
      dataset = fetch_function(as_frame=as_frame)
      assert dataset is not None
      assert dataset["data"].shape is not None
      assert isinstance(
          dataset["data"], pd.DataFrame if as_frame else np.ndarray
      )
      assert dataset["target"].shape is not None
      assert isinstance(
          dataset["target"], pd.Series if as_frame else np.ndarray
      )
      assert dataset["feature_names"] is not None
      assert isinstance(dataset["feature_names"], list)
      assert dataset["DESCR"] is not None
      assert isinstance(dataset["DESCR"], str)
  
imports: import pandas
  import numpy
  import pytest
  from fairlearn.datasets import fetch_adult, fetch_bank_marketing, fetch_boston, fetch_credit_card, fetch_diabetes_hospital
label_desc: Use image node_id 1 for calling the TestFairlearnDataset obj's underlying member method code with example usage: obj.test_dataset_as_bunch(as_frame, fetch_function) without return types