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: Create snapshot object
  
  Parameters
  ----------
  dictionary : dict
  
      for each of the 5 key components, this function will search for
      one of the variables below starting from the top. Default functionality
      is described below for each component as well for reference if none
      of the variables are given.
  
      code :
          code_id : str, optional
              code reference associated with the snapshot; if not
              provided will look to inputs below for code creation
          commit_id : str, optional
              commit id provided by the user if already available
  
          Default
          -------
          commits will be taken and code created via the  CodeController
          and are added to the snapshot at the time of snapshot creation
  
      environment :
          environment_id : str, optional
              id for environment used to create snapshot
          workspace : str, optional
              type of workspace being used
          environment_paths : list, optional
              list of absolute or relative filepaths and/or dirpaths to collect with destination names
              (e.g. "/path/to/file>hello", "/path/to/file2", "/path/to/dir>newdir")
  
          Default
          -------
          default environment files will be searched and environment will
          be created with the EnvironmentController and added to the snapshot
          at the time of snapshot creation
  
      file_collection :
          file_collection_id : str, optional
              file collection associated with the snapshot
          paths : list, optional
              list of absolute or relative filepaths and/or dirpaths to collect with destination names
              (e.g. "/path/to/file:hello", "/path/to/file2", "/path/to/dir:newdir")
  
          Default
          -------
          paths will be considered empty ([]), and the FileCollectionController
          will create a blank FileCollection that is empty.
  
      config :
          config : dict, optional
              key, value pairs of configurations
          config_filepath : str, optional
              absolute filepath to configuration parameters file
          config_filename : str, optional
              name of file with configuration parameters
  
          Default
          -------
          config will be considered empty ({}) and saved to the snapshot
  
      stats :
          stats : dict, optional
              key, value pairs of metrics and statistics
          stats_filepath : str, optional
              absolute filepath to stats parameters file
          stats_filename : str, optional
              name of file with metrics and statistics.
  
          Default
          -------
          stats will be considered empty ({}) and saved to the snapshot
  
      for the remaining optional arguments it will search for them
      in the input dictionary
  
          message : str
              long description of snapshot
          task_id : str, optional
              task id associated with snapshot
          label : str, optional
              short description of snapshot
          visible : bool, optional
              True if visible to user via list command else False
  
  Returns
  -------
  datmo.core.entity.snapshot.Snapshot
      snapshot object with all relevant parameters
  
  Raises
  ------
  RequiredArgumentMissing
      if required arguments are not given by the user
  FileIOError
      if files are not present or there is an error in File IO
docstr_tok: ["Create","snapshot","object","Parameters","--","--","--","--","--","dictionary",":","dict","for","each","of","the","5","key","components",",","this","function","will","search","for","one","of","the","variables","below","starting","from","the","top",".","Default","functionality","is","described","below","for","each","component","as","well","for","reference","if","none","of","the","variables","are","given",".","code",":","code_id",":","str",",","optional","code","reference","associated","with","the","snapshot",";","if","not","provided","will","look","to","inputs","below","for","code","creation","commit_id",":","str",",","optional","commit","id","provided","by","the","user","if","already","available","Default","--","--","--","-","commits","will","be","taken","and","code","created","via","the","CodeController","and","are","added","to","the","snapshot","at","the","time","of","snapshot","creation","environment",":","environment_id",":","str",",","optional","id","for","environment","used","to","create","snapshot","workspace",":","str",",","optional","type","of","workspace","being","used","environment_paths",":","list",",","optional","list","of","absolute","or","relative","filepaths","and\/or","dirpaths","to","collect","with","destination","names","(","e.g",".","``","\/path\/to\/file",">","hello","''",",","``","\/path\/to\/file2","''",",","``","\/path\/to\/dir",">","newdir","''",")","Default","--","--","--","-","default","environment","files","will","be","searched","and","environment","will","be","created","with","the","EnvironmentController","and","added","to","the","snapshot","at","the","time","of","snapshot","creation","file_collection",":","file_collection_id",":","str",",","optional","file","collection","associated","with","the","snapshot","paths",":","list",",","optional","list","of","absolute","or","relative","filepaths","and\/or","dirpaths","to","collect","with","destination","names","(","e.g",".","``","\/path\/to\/file",":","hello","''",",","``","\/path\/to\/file2","''",",","``","\/path\/to\/dir",":","newdir","''",")","Default","--","--","--","-","paths","will","be","considered","empty","(","[","]",")",",","and","the","FileCollectionController","will","create","a","blank","FileCollection","that","is","empty",".","config",":","config",":","dict",",","optional","key",",","value","pairs","of","configurations","config_filepath",":","str",",","optional","absolute","filepath","to","configuration","parameters","file","config_filename",":","str",",","optional","name","of","file","with","configuration","parameters","Default","--","--","--","-","config","will","be","considered","empty","(","{","}",")","and","saved","to","the","snapshot","stats",":","stats",":","dict",",","optional","key",",","value","pairs","of","metrics","and","statistics","stats_filepath",":","str",",","optional","absolute","filepath","to","stats","parameters","file","stats_filename",":","str",",","optional","name","of","file","with","metrics","and","statistics",".","Default","--","--","--","-","stats","will","be","considered","empty","(","{","}",")","and","saved","to","the","snapshot","for","the","remaining","optional","arguments","it","will","search","for","them","in","the","input","dictionary","message",":","str","long","description","of","snapshot","task_id",":","str",",","optional","task","id","associated","with","snapshot","label",":","str",",","optional","short","description","of","snapshot","visible",":","bool",",","optional","True","if","visible","to","user","via","list","command","else","False","Returns","--","--","--","-","datmo.core.entity.snapshot.Snapshot","snapshot","object","with","all","relevant","parameters","Raises","--","--","--","RequiredArgumentMissing","if","required","arguments","are","not","given","by","the","user","FileIOError","if","files","are","not","present","or","there","is","an","error","in","File","IO"]
code: def create(self, dictionary):
      """Create snapshot object
  
      Parameters
      ----------
      dictionary : dict
  
          for each of the 5 key components, this function will search for
          one of the variables below starting from the top. Default functionality
          is described below for each component as well for reference if none
          of the variables are given.
  
          code :
              code_id : str, optional
                  code reference associated with the snapshot; if not
                  provided will look to inputs below for code creation
              commit_id : str, optional
                  commit id provided by the user if already available
  
              Default
              -------
              commits will be taken and code created via the  CodeController
              and are added to the snapshot at the time of snapshot creation
  
          environment :
              environment_id : str, optional
                  id for environment used to create snapshot
              workspace : str, optional
                  type of workspace being used
              environment_paths : list, optional
                  list of absolute or relative filepaths and/or dirpaths to collect with destination names
                  (e.g. "/path/to/file>hello", "/path/to/file2", "/path/to/dir>newdir")
  
              Default
              -------
              default environment files will be searched and environment will
              be created with the EnvironmentController and added to the snapshot
              at the time of snapshot creation
  
          file_collection :
              file_collection_id : str, optional
                  file collection associated with the snapshot
              paths : list, optional
                  list of absolute or relative filepaths and/or dirpaths to collect with destination names
                  (e.g. "/path/to/file:hello", "/path/to/file2", "/path/to/dir:newdir")
  
              Default
              -------
              paths will be considered empty ([]), and the FileCollectionController
              will create a blank FileCollection that is empty.
  
          config :
              config : dict, optional
                  key, value pairs of configurations
              config_filepath : str, optional
                  absolute filepath to configuration parameters file
              config_filename : str, optional
                  name of file with configuration parameters
  
              Default
              -------
              config will be considered empty ({}) and saved to the snapshot
  
          stats :
              stats : dict, optional
                  key, value pairs of metrics and statistics
              stats_filepath : str, optional
                  absolute filepath to stats parameters file
              stats_filename : str, optional
                  name of file with metrics and statistics.
  
              Default
              -------
              stats will be considered empty ({}) and saved to the snapshot
  
          for the remaining optional arguments it will search for them
          in the input dictionary
  
              message : str
                  long description of snapshot
              task_id : str, optional
                  task id associated with snapshot
              label : str, optional
                  short description of snapshot
              visible : bool, optional
                  True if visible to user via list command else False
  
      Returns
      -------
      datmo.core.entity.snapshot.Snapshot
          snapshot object with all relevant parameters
  
      Raises
      ------
      RequiredArgumentMissing
          if required arguments are not given by the user
      FileIOError
          if files are not present or there is an error in File IO
      """
      # Validate Inputs
      create_dict = {
          "model_id": self.model.id,
      }
  
      validate("create_snapshot", dictionary)
  
      # Message must be present
      if "message" in dictionary:
          create_dict["message"] = dictionary["message"]
      else:
          raise RequiredArgumentMissing(
              __("error", "controller.snapshot.create.arg", "message")
          )
  
      # Code setup
      self._code_setup(dictionary, create_dict)
  
      # Environment setup
      self._env_setup(dictionary, create_dict)
  
      # File setup
      self._file_setup(dictionary, create_dict)
  
      # Config setup
      self._config_setup(dictionary, create_dict)
  
      # Stats setup
      self._stats_setup(dictionary, create_dict)
  
      # If snapshot object with required args already exists, return it
      # DO NOT create a new snapshot with the same required arguments
      results = self.dal.snapshot.query(
          {
              "model_id": create_dict["model_id"],
              "code_id": create_dict["code_id"],
              "environment_id": create_dict["environment_id"],
              "file_collection_id": create_dict["file_collection_id"],
              "config": create_dict["config"],
              "stats": create_dict["stats"],
          }
      )
      if results:
          return results[0]
  
      # Optional args for Snapshot entity
      optional_args = ["task_id", "label", "visible"]
      for optional_arg in optional_args:
          if optional_arg in dictionary:
              create_dict[optional_arg] = dictionary[optional_arg]
  
      # Create snapshot and return
      return self.dal.snapshot.create(Snapshot(create_dict))
  
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 3 for calling the SnapshotController obj's underlying member method code with example usage: obj.create(dictionary) and returns: self, results