code: def validate(self) -> None:
      logging.info("Validate the migrated documents")
  
      check_documents(DocCls=CachedResponseDocument, sample_size=10)
  
      db = get_db(db_name)
      try:
          splits_responses_count = db[
              splitsResponseCollection
          ].count_documents({})
      except InvalidName:
          splits_responses_count = 0
      try:
          first_rows_responses_count = db[
              firstRowsResponseCollection
          ].count_documents({})
      except InvalidName:
          first_rows_responses_count = 0
      cached_responses_count = CachedResponseDocument.objects.count()
      if (
          splits_responses_count + first_rows_responses_count
          > cached_responses_count
      ):
          raise ValueError(
              f"Some documents are missing in the new collection: splitsResponse ({splits_responses_count}),"
              f" firstRowsResponse ({first_rows_responses_count}), cachedResponseBlue ({cached_responses_count})"
          )
  
file_path: datasets-server/jobs/mongodb_migration/src/mongodb_migration/migrations/_20221117223000_cache_generic_response.py
imports: import contextlib
  import logging
  from libcommon.simple_cache import CachedResponseDocument
  from mongoengine.connection import get_db
  from pymongo.errors import InvalidName
  from mongodb_migration.check import check_documents
  from mongodb_migration.migration import Migration
label_desc: Use image node_id 3 for calling the MigrationMoveToGenericCachedResponse obj's underlying member method code with example usage: obj.validate() without return types