code: def validate(source):
      
      _assert_virtualenv_is_installed()
  
      logger.info('Validating %s', source)
      processed_source = get_source(source)
      metadata = _get_metadata(processed_source)
  
      wheels_path = os.path.join(processed_source, DEFAULT_WHEELS_PATH)
      validation_errors = []
  
      logger.debug('Verifying that all required files exist...')
      for wheel in metadata['wheels']:
          if not os.path.isfile(os.path.join(wheels_path, wheel)):
              validation_errors.append(
                  '{0} is missing from the archive'.format(wheel))
  
      logger.debug('Testing package installation...')
      tmpenv = _make_virtualenv()
      try:
          install(source=processed_source, venv=tmpenv)
          if not _check_installed(metadata['package_name'], tmpenv):
              validation_errors.append(
                  '{0} failed to install (Reason unknown)'.format(
                      metadata['package_name']))
      finally:
          shutil.rmtree(tmpenv)
  
      if validation_errors:
          logger.info('Validation failed!')
          for error in validation_errors:
              logger.info(error)
          logger.info('Source can be found at: %s', processed_source)
      else:
          logger.info('Validation Passed!')
          if processed_source != source:
              shutil.rmtree(processed_source)
      return validation_errors
docs: Validate a Wagon archive. Return True if succeeds, False otherwise.
      It also prints a list of all validation errors.
  
      This will test that some of the metadata is solid, that
      the required wheels are present within the archives and that
      the package is installable.
  
      Note that if the metadata file is corrupted, validation
      of the required wheels will be corrupted as well, since validation
      checks that the required wheels exist vs. the list of wheels
      supplied in the `wheels` key.