class_docstr: TaskController inherits from BaseController and manages business logic associated with tasks
  within the project.
  
  Attributes
  ----------
  environment : datmo.core.controller.environment.environment.EnvironmentController
      used to create environment if new definition file
  snapshot : datmo.core.controller.snapshot.SnapshotController
      used to create snapshots before and after tasks
  
  Methods
  -------
  create(dictionary)
      creates a Task object with the permanent parameters
  _run_helper(environment_id, log_filepath, options)
      helper for run to start environment and run with the appropriate parameters
  run(self, id, dictionary=None)
      runs the task and tracks the run, logs, inputs and outputs
  list(sort_key=None, sort_order=None)
      lists all tasks within the project given filters
  delete(id)
      deletes the specified task from the project
docstr: Update environment run option dictionary with data file and directory mapping and return dictionary.
  
  Parameters
  ----------
  data_file_path_map : list
      list of tuple containing source file absolute path and destination file name
  
  data_directory_path_map : list
      list of tuple containing source directory absolute path and destination directory
  
  Returns
  -------
  dict
      updated dictionary having the environment run options
docstr_tok: ["Update","environment","run","option","dictionary","with","data","file","and","directory","mapping","and","return","dictionary",".","Parameters","--","--","--","--","--","data_file_path_map",":","list","list","of","tuple","containing","source","file","absolute","path","and","destination","file","name","data_directory_path_map",":","list","list","of","tuple","containing","source","directory","absolute","path","and","destination","directory","Returns","--","--","--","-","dict","updated","dictionary","having","the","environment","run","options"]
code: def _update_environment_run_options(
      environment_run_option,
      data_file_path_map,
      data_directory_path_map,
  ):
      """Update environment run option dictionary with data file and directory mapping and return dictionary.
  
      Parameters
      ----------
      data_file_path_map : list
          list of tuple containing source file absolute path and destination file name
  
      data_directory_path_map : list
          list of tuple containing source directory absolute path and destination directory
  
      Returns
      -------
      dict
          updated dictionary having the environment run options
      """
      if data_file_path_map:
          # Mount the directory for file path
          if len(data_file_path_map) > 1:
              raise TaskRunError(
                  __("error", "cli.run.run.data.files.limit_exceeded")
              )
          # select only one tuple, the latest file
          data_tuple = data_file_path_map[-1]
          data_file_src_abs_path, data_dst_rel_path = data_tuple
          # check if the file exists
          if not os.path.isfile(data_file_src_abs_path):
              raise TaskRunError(
                  __(
                      "error",
                      "cli.run.run.data.src_file.dne",
                      data_file_src_abs_path,
                  )
              )
  
          data_file_dirname = os.path.dirname(data_file_src_abs_path)
          # check if the directory exists
          if not os.path.isdir(data_file_dirname):
              raise TaskRunError(
                  __(
                      "error",
                      "cli.run.run.data.src_dir.dne",
                      data_file_dirname,
                  )
              )
  
          data_volume = {
              os.path.dirname(data_file_src_abs_path): {
                  "bind": "/data/",
                  "mode": "rw",
              }
          }
          if environment_run_option["volumes"]:
              environment_run_option["volumes"].update(data_volume)
          else:
              environment_run_option["volumes"] = data_volume
  
      if data_directory_path_map:
          # Mount the directory for data
          for data_tuple in data_directory_path_map:
              data_src_abs_path, data_dst_rel_path = data_tuple
              if not os.path.isdir(data_src_abs_path):
                  raise TaskRunError(
                      __(
                          "error",
                          "cli.run.run.data.src_dir.dne",
                          data_src_abs_path,
                      )
                  )
              data_volume = {
                  data_src_abs_path: {
                      "bind": "/data/%s" % data_dst_rel_path,
                      "mode": "rw",
                  }
              }
              if environment_run_option["volumes"]:
                  environment_run_option["volumes"].update(data_volume)
              else:
                  environment_run_option["volumes"] = data_volume
      return environment_run_option
  
imports: import os
  import time
  import shlex
  import threading
  import webbrowser
  from datetime import datetime
  from datmo.core.controller.base import BaseController
  from datmo.core.controller.snapshot import SnapshotController
  from datmo.core.controller.environment.environment import EnvironmentController
  from datmo.core.entity.task import Task
  from datmo.core.util.validation import validate
  from datmo.core.util.spinner import Spinner
  from datmo.core.util.i18n import get
  from datmo.core.util.exceptions import TaskRunError, RequiredArgumentMissing, ProjectNotInitialized, PathDoesNotExist, TaskInteractiveDetachError, TooManyArgumentsFound, EntityNotFound, DoesNotExist, TaskNoCommandGiven
label_desc: Use image node_id 6 for calling the TaskController obj's underlying member method code with example usage: obj._update_environment_run_options(environment_run_option, data_file_path_map, data_directory_path_map) and returns: environment_run_option