class_docstr: Class which performs validation of the submission.
class_docstr_tok: ["Class","which","performs","validation","of","the","submission","."]
docstr: Runs submission inside Docker container.
  
  Args:
    metadata: dictionary with submission metadata
  
  Returns:
    True if status code of Docker command was success (i.e. zero),
    False otherwise.
docstr_tok: ["Runs","submission","inside","Docker","container",".","Args",":","metadata",":","dictionary","with","submission","metadata","Returns",":","True","if","status","code","of","Docker","command","was","success","(","i.e",".","zero",")",",","False","otherwise","."]
code: def _run_submission(self, metadata):
      """Runs submission inside Docker container.
  
      Args:
        metadata: dictionary with submission metadata
  
      Returns:
        True if status code of Docker command was success (i.e. zero),
        False otherwise.
      """
      container_name = (
          metadata["container_gpu"]
          if self._use_gpu
          else metadata["container"]
      )
      if metadata["type"] == "defense":
          cmd = [
              "--network=none",
              "-m=24g",
              "-v",
              "{0}:/input_images:ro".format(self._sample_input_dir),
              "-v",
              "{0}:/output_data".format(self._sample_output_dir),
              "-v",
              "{0}:/code".format(self._extracted_submission_dir),
              "-w",
              "/code",
              container_name,
              "./" + metadata["entry_point"],
              "/input_images",
              "/output_data/result.csv",
          ]
      else:
          epsilon = np.random.choice(ALLOWED_EPS)
          cmd = [
              "--network=none",
              "-m=24g",
              "-v",
              "{0}:/input_images:ro".format(self._sample_input_dir),
              "-v",
              "{0}:/output_images".format(self._sample_output_dir),
              "-v",
              "{0}:/code".format(self._extracted_submission_dir),
              "-w",
              "/code",
              container_name,
              "./" + metadata["entry_point"],
              "/input_images",
              "/output_images",
              str(epsilon),
          ]
      if self._use_gpu:
          cmd = ["docker", "run", "--runtime=nvidia"] + cmd
      else:
          cmd = ["docker", "run"] + cmd
      logging.info("Command to run submission: %s", " ".join(cmd))
      result = shell_call(cmd)
      make_directory_writable(self._extracted_submission_dir)
      make_directory_writable(self._sample_output_dir)
      return result
  
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 sys
  import numpy
  from PIL import Image
  from six import iteritems
label_desc: Use image node_id 8 for calling the SubmissionValidator obj's underlying member method code with example usage: obj._run_submission(metadata) and returns: result