class_docstr: Helper class to run one defense submission.
class_docstr_tok: ["Helper","class","to","run","one","defense","submission","."]
docstr: Runs defense inside Docker.
  
  Args:
    input_dir: directory with input (adversarial images).
    output_file_path: path of the output file.
  
  Returns:
    how long it took to run submission in seconds
docstr_tok: ["Runs","defense","inside","Docker",".","Args",":","input_dir",":","directory","with","input","(","adversarial","images",")",".","output_file_path",":","path","of","the","output","file",".","Returns",":","how","long","it","took","to","run","submission","in","seconds"]
code: def run(self, input_dir, output_file_path):
      """Runs defense inside Docker.
  
      Args:
        input_dir: directory with input (adversarial images).
        output_file_path: path of the output file.
  
      Returns:
        how long it took to run submission in seconds
      """
      logging.info("Running defense %s", self.submission_id)
      tmp_run_dir = self.temp_copy_extracted_submission()
      output_dir = os.path.dirname(output_file_path)
      output_filename = os.path.basename(output_file_path)
      cmd = [
          "--network=none",
          "-m=24g",
          "--cpus=3.75",
          "-v",
          "{0}:/input_images:ro".format(input_dir),
          "-v",
          "{0}:/output_data".format(output_dir),
          "-v",
          "{0}:/code".format(tmp_run_dir),
          "-w",
          "/code",
          self.container_name,
          "./" + self.entry_point,
          "/input_images",
          "/output_data/" + output_filename,
      ]
      elapsed_time_sec = self.run_with_time_limit(cmd)
      sudo_remove_dirtree(tmp_run_dir)
      return elapsed_time_sec
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from builtins import int
  import argparse
  import json
  import logging
  import os
  import random
  import shutil
  import subprocess
  import time
  import uuid
  from six import iteritems
  import eval_lib
  from cleverhans.utils import shell_call
label_desc: Use image node_id 2 for calling the DefenseSubmission obj's underlying member method code with example usage: obj.run(input_dir, output_file_path) and returns: elapsed_time_sec