code: def assert_valid_pandas(data):
      __tracebackhide__ = True
      # Get raw data frame
      df = data.to_dataframe()
      assert isinstance(df, pd.DataFrame), "raw dataframe is wrong type"
  
      # Get pandas data
      X, y = data.to_pandas()
      assert isinstance(X, pd.DataFrame), "X is not a DataFrame"
      assert isinstance(y, pd.Series), "y is not a Series"
  
      # Assert pandas is returned from to_data()
      X, y = data.to_data()
      assert isinstance(
          X, pd.DataFrame
      ), "to_data does not return pandas"
      assert isinstance(y, pd.Series), "to_data does not return pandas"
  
imports: import pytest
  import numpy
  from unittest.mock import patch
  from yellowbrick.datasets.loaders import *
  from yellowbrick.datasets.loaders import DATASETS
  from yellowbrick.datasets.base import Dataset, Corpus
  from yellowbrick.datasets.path import dataset_exists, dataset_archive
  from yellowbrick.datasets.path import find_dataset_path
  from yellowbrick.exceptions import DatasetsError
label_desc: Use image node_id 3 for calling a global function with example usage: assert_valid_pandas(data) without return types