code: def test_checkout(self):
      self.project_controller.init("test9", "test description")
  
      # Create the files in the project files directory
      paths = self.__setup()
  
      # Create a file collection to checkout to with paths
      file_collection_obj = self.file_collection_controller.create(
          paths
      )
  
      # Checkout success when there are no unstaged changes
      result = self.file_collection_controller.checkout(
          file_collection_obj.id
      )
      assert result
      current_hash = (
          self.file_collection_controller._calculate_project_files_hash()
      )
      assert current_hash == "74be16979710d4c4e7c6647856088456"
      assert file_collection_obj.filehash == current_hash
      # Check the filenames as well because the hash does not take this into account
      assert os.path.isfile(paths[0])
  
      # Change file contents to make it unstaged
      with open(paths[0], "wb") as f:
          f.write(to_bytes("hello"))
  
      # Checkout failure when there are unstaged changes
      failed = False
      try:
          _ = self.file_collection_controller.checkout(
              file_collection_obj.id
          )
      except UnstagedChanges:
          failed = True
      assert failed
  
      # Create a new file collection with paths
      file_collection_obj_1 = self.file_collection_controller.create(
          paths
      )
  
      # Checkout success back when there are no unstaged changes
      result = self.file_collection_controller.checkout(
          file_collection_obj.id
      )
      assert result
      current_hash = (
          self.file_collection_controller._calculate_project_files_hash()
      )
      assert current_hash == "74be16979710d4c4e7c6647856088456"
      assert file_collection_obj.filehash == current_hash
      assert file_collection_obj_1.filehash != current_hash
      # Check the filenames as well because the hash does not take this into account
      assert os.path.isfile(paths[0])
  
imports: import os
  import shutil
  import tempfile
  import platform
  from io import open
  from datmo.config import Config
  from datmo.core.controller.project import ProjectController
  from datmo.core.controller.file.file_collection import FileCollectionController
  from datmo.core.util.exceptions import EntityNotFound, UnstagedChanges
label_desc: Use image node_id 12 for calling the TestFileCollectionController obj's underlying member method code with example usage: obj.test_checkout() without return types