code: def create(
      message,
      label=None,
      run_id=None,
      environment_id=None,
      env=None,
      paths=None,
      config=None,
      stats=None,
  ):
      """Create a snapshot within a project
  
      The project must be created before this is implemented. You can do that by using
      the following command::
  
          $ datmo init
  
  
      Parameters
      ----------
  
      message : str
          a description of the snapshot for later reference
      label : str, optional
          a short description of the snapshot for later reference
          (default is None, which means a blank label is stored)
      run_id : str, optional
          run object id to use to create snapshot
          if run id is passed then subsequent parameters would be ignored.
          when using run id, it will overwrite the following inputs
  
          *environment_id*: used to run the task,
  
          *paths*: this is the set of all files saved during the task
  
          *config*: nothing is passed into this variable. the user may add
          something to the config by passing in a dict for the config
  
          *stats*:  the task.results are added into the stats variable of the
          snapshot.
  
      environment_id : str, optional
          provide the environment object id to use with this snapshot
          (default is None, which means it creates a default environment)
      env : str or list, optional
          the absolute file path for the environment definition path. env is not used if environment_id is also passed.
          this can be either a string or list
          (default is None, environment_id is also not passed, which will defer to the environment to find a
          default environment or will fail if not found)
      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")
      config : dict, optional
          provide the dictionary of configurations
          (default is None, which means it is empty)
      stats : dict, optional
          provide the dictionary of relevant statistics or metrics
          (default is None, which means it is empty)
  
      Returns
      -------
      Snapshot
          returns a Snapshot entity as defined above
  
      Examples
      --------
      You can use this function within a project repository to save snapshots
      for later use. Once you have created this, you will be able to view the
      snapshot with the `datmo snapshot ls` cli command
  
      >>> import datmo
      >>> datmo.snapshot.create(message="my first snapshot", paths=["/path/to/a/large/file"], config={"test": 0.4, "test2": "string"}, stats={"accuracy": 0.94})
  
      You can also use the result of a task run in order to create a snapshot
  
      >>> datmo.snapshot.create(message="my first snapshot from task", task_id="1jfkshg049")
      """
  
      snapshot_controller = SnapshotController()
  
      if run_id is not None:
          excluded_args = ["environment_id", "paths"]
          for arg in excluded_args:
              if eval(arg) is not None:
                  raise SnapshotCreateFromTaskArgs(
                      "error", "sdk.snapshot.create.run.args", arg
                  )
  
          # Create a new core snapshot object
          core_snapshot_obj = snapshot_controller.create_from_task(
              message, run_id, label=label, config=config, stats=stats
          )
  
          # Create a new snapshot object
          client_snapshot_obj = Snapshot(core_snapshot_obj)
  
          return client_snapshot_obj
      else:
          snapshot_create_dict = {"message": message}
  
          # add arguments if they are not None
          if label:
              snapshot_create_dict["label"] = label
          if environment_id:
              snapshot_create_dict["environment_id"] = environment_id
          elif isinstance(env, list):
              snapshot_create_dict["environment_paths"] = env
          elif env:
              snapshot_create_dict["environment_paths"] = [env]
          if paths:
              snapshot_create_dict["paths"] = paths
          if config:
              snapshot_create_dict["config"] = config
          if stats:
              snapshot_create_dict["stats"] = stats
          if label:
              snapshot_create_dict["label"] = label
  
          # Create a new core snapshot object
          core_snapshot_obj = snapshot_controller.create(
              snapshot_create_dict
          )
          core_snapshot_obj = snapshot_controller.update(
              core_snapshot_obj.id, visible=True
          )
  
          # Create a new snapshot object
          client_snapshot_obj = Snapshot(core_snapshot_obj)
  
          return client_snapshot_obj
  
file_path: datmo/datmo/snapshot.py
imports: import os
  from datmo.core.controller.snapshot import SnapshotController
  from datmo.core.entity.snapshot import Snapshot
  from datmo.core.util.exceptions import InvalidArgumentType, SnapshotCreateFromTaskArgs
  from datmo.core.util.misc_functions import prettify_datetime, format_table
label_desc: Use image node_id 1 for calling a global function with example usage: create(message, label, run_id, environment_id, env, paths, config, stats) and returns: client_snapshot_obj, client_snapshot_obj