code: def assert_valid_dataset(data, name):
      __tracebackhide__ = True
      assert isinstance(data, Dataset), "not a Dataset object"
      assert name in DATASETS, "dataset not in manifest"
  
      assert dataset_exists(name), "dataset directory does not exist"
      assert dataset_archive(
          name, DATASETS[name]["signature"]
      ), "dataset archive does not match signature"
      assert (
          find_dataset_path(name, ext=".csv.gz", raises=False)
          is not None
      ), "no .csv.tgz in dataset"
      assert (
          find_dataset_path(name, ext=".npz", raises=False) is not None
      ), "no .npz in dataset"
  
      n_files = len(data.contents())
      assert n_files == 4 or n_files == 5, "not enough files in dataset"
      assert len(data.README) > 0, "readme contains no data"
      assert len(data.meta) > 0, "metadata is empty"
  
      if n_files == 5:
          assert len(data.citation) > 0, "citation.bib is empty"
  
      assert "features" in data.meta, "no features in metadata"
      assert "target" in data.meta, "no target in metadata"
  
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 1 for calling a global function with example usage: assert_valid_dataset(data, name) without return types