class_docstr: SnapshotController inherits from BaseController and manages business logic related to snapshots
  
  Attributes
  ----------
  code : datmo.core.controller.code.code.CodeController
  file_collection : datmo.core.controller.file.file_collection.FileCollectionController
  environment : datmo.core.controller.environment.environment.EnvironmentController
  
  Methods
  -------
  create(dictionary)
      Create a snapshot within the project
  checkout(id)
      Checkout to a specific snapshot within the project
  list(visible=None, sort_key=None, sort_order=None)
      List all snapshots present within the project based on given filters
  delete(id)
      Delete the snapshot specified from the project
docstr: Fills in snapshot stats by having one of the following:
      1. stats = JSON object
      2. stats_filepath = some location where a json file exists
      3. stats_filename = just the file name
  
  Parameters
  ----------
  incoming_dictionary : dict
      dictionary for the create function defined above
  create_dict : dict
      dictionary for creating the Snapshot entity
  
  Raises
  ------
  FileIOError
docstr_tok: ["Fills","in","snapshot","stats","by","having","one","of","the","following",":","1.","stats","=","JSON","object","2.","stats_filepath","=","some","location","where","a","json","file","exists","3.","stats_filename","=","just","the","file","name","Parameters","--","--","--","--","--","incoming_dictionary",":","dict","dictionary","for","the","create","function","defined","above","create_dict",":","dict","dictionary","for","creating","the","Snapshot","entity","Raises","--","--","--","FileIOError"]
code: def _stats_setup(self, incoming_dictionary, create_dict):
      """Fills in snapshot stats by having one of the following:
          1. stats = JSON object
          2. stats_filepath = some location where a json file exists
          3. stats_filename = just the file name
  
      Parameters
      ----------
      incoming_dictionary : dict
          dictionary for the create function defined above
      create_dict : dict
          dictionary for creating the Snapshot entity
  
      Raises
      ------
      FileIOError
      """
  
      if "stats" in incoming_dictionary:
          create_dict["stats"] = incoming_dictionary["stats"]
      elif "stats_filepath" in incoming_dictionary:
          if not os.path.isfile(incoming_dictionary["stats_filepath"]):
              raise FileIOError(
                  __("error", "controller.snapshot.create.file_stat")
              )
          # If path exists transform file to config dict
          stats_json_driver = JSONStore(
              incoming_dictionary["stats_filepath"]
          )
          create_dict["stats"] = stats_json_driver.to_dict()
      elif "stats_filename" in incoming_dictionary:
          stats_filename = incoming_dictionary["stats_filename"]
          create_dict["stats"] = self._find_in_filecollection(
              stats_filename, create_dict["file_collection_id"]
          )
      else:
          stats_filename = "stats.json"
          create_dict["stats"] = self._find_in_filecollection(
              stats_filename, create_dict["file_collection_id"]
          )
  
imports: import os
  from datmo.core.controller.base import BaseController
  from datmo.core.controller.code.code import CodeController
  from datmo.core.controller.file.file_collection import FileCollectionController
  from datmo.core.controller.environment.environment import EnvironmentController
  from datmo.core.entity.snapshot import Snapshot
  from datmo.core.util.i18n import get
  from datmo.core.util.validation import validate
  from datmo.core.util.json_store import JSONStore
  from datmo.core.util.exceptions import FileIOError, RequiredArgumentMissing, ProjectNotInitialized, EntityNotFound, TaskNotComplete, DoesNotExist, UnstagedChanges
label_desc: Use image node_id 16 for calling the SnapshotController obj's underlying member method code with example usage: obj._stats_setup(incoming_dictionary, create_dict) without return types