code: def test_status_snapshot_task(self):
      self.project_controller.init("test4", "test description")
      self.snapshot_controller = SnapshotController()
      self.task_controller = TaskController()
  
      # Create files to add
      self.snapshot_controller.file_driver.create(
          "dirpath1", directory=True
      )
      self.snapshot_controller.file_driver.create(
          "dirpath2", directory=True
      )
      self.snapshot_controller.file_driver.create("filepath1")
  
      # Create environment definition
      env_def_path = os.path.join(
          self.snapshot_controller.home, "Dockerfile"
      )
      with open(env_def_path, "wb") as f:
          f.write(to_bytes("FROM python:3.5-alpine"))
  
      environment_paths = [env_def_path]
  
      # Create config
      config_filepath = os.path.join(
          self.snapshot_controller.home, "config.json"
      )
      with open(config_filepath, "wb") as f:
          f.write(to_bytes(str("{}")))
  
      # Create stats
      stats_filepath = os.path.join(
          self.snapshot_controller.home, "stats.json"
      )
      with open(stats_filepath, "wb") as f:
          f.write(to_bytes(str("{}")))
  
      input_dict = {
          "message": "my test snapshot",
          "paths": [
              os.path.join(self.snapshot_controller.home, "dirpath1"),
              os.path.join(self.snapshot_controller.home, "dirpath2"),
              os.path.join(self.snapshot_controller.home, "filepath1"),
          ],
          "environment_paths": environment_paths,
          "config_filename": config_filepath,
          "stats_filename": stats_filepath,
      }
  
      # Create snapshot in the project, then wait, and try status
      first_snapshot = self.snapshot_controller.create(input_dict)
  
      (
          status_dict,
          current_snapshot,
          latest_snapshot_user_generated,
          latest_snapshot_auto_generated,
          unstaged_code,
          unstaged_environment,
          unstaged_files,
      ) = self.project_controller.status()
  
      assert status_dict
      assert isinstance(status_dict, dict)
      assert status_dict["name"] == "test4"
      assert status_dict["description"] == "test description"
      assert isinstance(status_dict["config"], dict)
      assert (
          not current_snapshot
      )  # snapshot was created from other environments and files (so user is not on any current snapshot)
      assert isinstance(latest_snapshot_user_generated, Snapshot)
      assert latest_snapshot_user_generated == first_snapshot
      assert not latest_snapshot_auto_generated
      assert not unstaged_code
      assert not unstaged_environment
      assert not unstaged_files
  
      # Create and run a task and test if task is shown
      first_task = self.task_controller.create()
  
      # Create task_dict
      task_command = ["sh", "-c", "echo accuracy:0.45"]
      task_dict = {"command_list": task_command}
  
      updated_first_task = self.task_controller.run(
          first_task.id, task_dict=task_dict
      )
      before_snapshot_obj = self.task_controller.dal.snapshot.get_by_id(
          updated_first_task.before_snapshot_id
      )
      after_snapshot_obj = self.task_controller.dal.snapshot.get_by_id(
          updated_first_task.after_snapshot_id
      )
      before_environment_obj = (
          self.task_controller.dal.environment.get_by_id(
              before_snapshot_obj.environment_id
          )
      )
      after_environment_obj = (
          self.task_controller.dal.environment.get_by_id(
              after_snapshot_obj.environment_id
          )
      )
      assert before_environment_obj == after_environment_obj
      self.environment_ids.append(after_environment_obj.id)
  
      (
          status_dict,
          current_snapshot,
          latest_snapshot_user_generated,
          latest_snapshot_auto_generated,
          unstaged_code,
          unstaged_environment,
          unstaged_files,
      ) = self.project_controller.status()
  
      assert status_dict
      assert isinstance(status_dict, dict)
      assert status_dict["name"] == "test4"
      assert status_dict["description"] == "test description"
      assert isinstance(status_dict["config"], dict)
      assert isinstance(current_snapshot, Snapshot)
      assert isinstance(latest_snapshot_user_generated, Snapshot)
      assert latest_snapshot_user_generated == first_snapshot
      assert isinstance(latest_snapshot_auto_generated, Snapshot)
      # current snapshot is the before snapshot for the run
      assert current_snapshot == before_snapshot_obj
      assert current_snapshot != latest_snapshot_auto_generated
      assert current_snapshot != latest_snapshot_user_generated
      # latest autogenerated snapshot is the after snapshot id
      assert latest_snapshot_auto_generated == after_snapshot_obj
      assert (
          latest_snapshot_auto_generated
          != latest_snapshot_user_generated
      )
      # user generated snapshot is not associated with any before or after snapshot
      assert latest_snapshot_user_generated != before_snapshot_obj
      assert latest_snapshot_user_generated != after_snapshot_obj
      assert not unstaged_code
      assert not unstaged_environment
      assert not unstaged_files
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import tempfile
  import platform
  import time
  import timeout_decorator
  from io import open
  from datmo.config import Config
  from datmo.core.controller.project import ProjectController
  from datmo.core.controller.snapshot import SnapshotController
  from datmo.core.controller.environment.environment import EnvironmentController
  from datmo.core.controller.task import TaskController
  from datmo.core.entity.snapshot import Snapshot
  from datmo.core.util.exceptions import ValidationFailed
  from datmo.core.util.misc_functions import check_docker_inactive, pytest_docker_environment_failed_instantiation
label_desc: Use image node_id 12 for calling the TestProjectController obj's underlying member method code with example usage: obj.test_status_snapshot_task() without return types