code: def test_dataset(dataset_name):
      dataset = importlib.import_module(
          "statsmodels.datasets." + dataset_name
      )
      ds = dataset.load()
      assert isinstance(ds, Dataset)
      assert isinstance(ds.data, pd.DataFrame)
      if hasattr(ds, "exog"):
          assert isinstance(ds.exog, (pd.DataFrame, pd.Series))
      if hasattr(ds, "endog"):
          assert isinstance(ds.endog, (pd.DataFrame, pd.Series))
  
      ds = dataset.load_pandas()
      assert isinstance(ds, Dataset)
      assert isinstance(ds.data, pd.DataFrame)
      if hasattr(ds, "exog"):
          assert isinstance(ds.exog, (pd.DataFrame, pd.Series))
      if hasattr(ds, "endog"):
          assert isinstance(ds.endog, (pd.DataFrame, pd.Series))
  
imports: import importlib
  import pandas
  import pytest
  import statsmodels.datasets
  from statsmodels.datasets.utils import Dataset
label_desc: Use image node_id 1 for calling a global function with example usage: test_dataset(dataset_name) without return types