class_docstr: 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.
      """
      if self._use_gpu:
          docker_binary = "nvidia-docker"
          container_name = metadata["container_gpu"]
      else:
          docker_binary = "docker"
          container_name = metadata["container"]
      if metadata["type"] == "defense":
          cmd = [
              docker_binary,
              "run",
              "--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 = [
              docker_binary,
              "run",
              "--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),
          ]
      logging.info("Command to run submission: %s", " ".join(cmd))
      return shell_call(cmd)
  
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 8 for calling the SubmissionValidator obj's underlying member method code with example usage: obj._run_submission(metadata) and returns: shell_call