code: def assert_valid_corpus(corpus, name):
      __tracebackhide__ = True
      assert isinstance(corpus, Corpus), "not a Corpus object"
      assert name in DATASETS, "corpus not in manifest"
  
      assert dataset_exists(name), "corpus directory does not exist"
      assert dataset_archive(
          name, DATASETS[name]["signature"]
      ), "corpus archive does not match signature"
  
      n_contents = len(corpus.contents())
      assert n_contents > 2, "not enough files/directories in corpus"
      assert len(corpus.README) > 0, "readme contains no data"
      assert (
          corpus.citation is None or len(corpus.citation) > 0
      ), "citation.bib is empty"
  
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 2 for calling a global function with example usage: assert_valid_corpus(corpus, name) without return types