class_docstr: Class which performs validation of the submission.
docstr: Validates submission.
  
  Args:
    filename: submission filename
    submission_type: type of the submission,
      one of 'attack', 'targeted_attack' or 'defense'
  
  Returns:
    whether submission is valid
docstr_tok: ["Validates","submission",".","Args",":","filename",":","submission","filename","submission_type",":","type","of","the","submission",",","one","of","'attack","'",",","'targeted_attack","'","or","'defense'","Returns",":","whether","submission","is","valid"]
code: def validate_submission(self, filename, submission_type):
      """Validates submission.
  
      Args:
        filename: submission filename
        submission_type: type of the submission,
          one of 'attack', 'targeted_attack' or 'defense'
  
      Returns:
        whether submission is valid
      """
      if submission_type not in ALLOWED_SUBMISSION_TYPES:
          logging.error("Invalid submission type: %s", submission_type)
          return False
      self._prepare_temp_dir()
      # Convert filename to be absolute path,
      # relative path might cause problems when monting directory in Docker
      filename = os.path.abspath(filename)
      # extract submission
      if not self._extract_submission(filename):
          return False
      # verify submission size
      if not self._verify_submission_size():
          return False
      # Load metadata
      metadata = self._load_and_verify_metadata(submission_type)
      if not metadata:
          return False
      # verify docker container size
      if not self._verify_docker_image_size(metadata["container_gpu"]):
          return False
      # Try to run submission on sample data
      self._prepare_sample_data(submission_type)
      if not self._run_submission(metadata):
          logging.error("Failure while running submission")
          return False
      if not self._verify_output(submission_type):
          logging.warning(
              "Some of the outputs of your submission are invalid or "
              "missing. You submission still will be evaluation "
              "but you might get lower score."
          )
      return True
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from builtins import int
  import csv
  import json
  import logging
  import os
  import re
  import subprocess
  import numpy
  from six import iteritems
  from PIL import Image
label_desc: Use image node_id 10 for calling the SubmissionValidator obj's underlying member method code with example usage: obj.validate_submission(filename, submission_type) and returns: True, False, False, False, False, False, False