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: Get list of file objects for task id. It will look in the following areas in the following order
  
  1) look in the after snapshot for file collection
  2) look in the running task file collection
  3) look in the before snapshot for file collection
  
  Parameters
  ----------
  task_id : str
      id for the task you would like to get file objects for
  mode : str
      file open mode
      (default is "r" to open file for read)
  
  Returns
  -------
  list
      list of python file objects
  
  Raises
  ------
  DoesNotExist
      task object does not exist
  PathDoesNotExist
      no file objects exist for the task
docstr_tok: ["Get","list","of","file","objects","for","task","id",".","It","will","look","in","the","following","areas","in","the","following","order","1",")","look","in","the","after","snapshot","for","file","collection","2",")","look","in","the","running","task","file","collection","3",")","look","in","the","before","snapshot","for","file","collection","Parameters","--","--","--","--","--","task_id",":","str","id","for","the","task","you","would","like","to","get","file","objects","for","mode",":","str","file","open","mode","(","default","is","``","r","''","to","open","file","for","read",")","Returns","--","--","--","-","list","list","of","python","file","objects","Raises","--","--","--","DoesNotExist","task","object","does","not","exist","PathDoesNotExist","no","file","objects","exist","for","the","task"]
code: def get_files(self, task_id, mode="r"):
      """Get list of file objects for task id. It will look in the following areas in the following order
  
      1) look in the after snapshot for file collection
      2) look in the running task file collection
      3) look in the before snapshot for file collection
  
      Parameters
      ----------
      task_id : str
          id for the task you would like to get file objects for
      mode : str
          file open mode
          (default is "r" to open file for read)
  
      Returns
      -------
      list
          list of python file objects
  
      Raises
      ------
      DoesNotExist
          task object does not exist
      PathDoesNotExist
          no file objects exist for the task
      """
      try:
          task_obj = self.dal.task.get_by_id(task_id)
      except EntityNotFound:
          raise DoesNotExist()
      if task_obj.after_snapshot_id:
          # perform number 1) and return file list
          return self.snapshot.get_files(
              task_obj.after_snapshot_id, mode=mode
          )
      elif task_obj.task_dirpath:
          # perform number 2) and return file list
          return self.file_driver.get(
              task_obj.task_dirpath, mode=mode, directory=True
          )
      elif task_obj.before_snapshot_id:
          # perform number 3) and return file list
          return self.snapshot.get_files(
              task_obj.before_snapshot_id, mode=mode
          )
      else:
          # Error because the task does not have any files associated with it
          raise PathDoesNotExist()
  
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 10 for calling the TaskController obj's underlying member method code with example usage: obj.get_files(task_id, mode) and returns: self, self, self