code: def create(self, **kwargs):
      self.snapshot_controller = SnapshotController()
      self.cli_helper.echo(__("info", "cli.snapshot.create"))
      run_id = kwargs.get("run_id", None)
      # creating snapshot with task id if it exists
      if run_id is not None:
          excluded_args = [
              "environment_id",
              "environment_paths",
              "paths",
              "config_filepath",
              "config_filename",
              "stats_filepath",
              "stats_filename",
          ]
          for arg in excluded_args:
              if arg in kwargs and kwargs[arg] is not None:
                  raise SnapshotCreateFromTaskArgs(
                      "error", "cli.snapshot.create.run.args", arg
                  )
  
          message = kwargs.get("message", None)
          label = kwargs.get("label", None)
          # Create a new core snapshot object
          snapshot_task_obj = self.snapshot_controller.create_from_task(
              message, run_id, label=label
          )
          self.cli_helper.echo(
              "Created snapshot id: %s" % snapshot_task_obj.id
          )
          return snapshot_task_obj
      else:
          # creating snapshot without task id
          snapshot_dict = {"visible": True}
  
          # Environment
          if kwargs.get("environment_id", None) or kwargs.get(
              "environment_paths", None
          ):
              mutually_exclusive_args = [
                  "environment_id",
                  "environment_paths",
              ]
              mutually_exclusive(
                  mutually_exclusive_args, kwargs, snapshot_dict
              )
  
          # File
          if kwargs.get("paths", None):
              snapshot_dict["paths"] = kwargs["paths"]
  
          # Config
          if (
              kwargs.get("config_filepath", None)
              or kwargs.get("config_filename", None)
              or kwargs.get("config", None)
          ):
              mutually_exclusive_args = [
                  "config_filepath",
                  "config_filename",
                  "config",
              ]
              mutually_exclusive(
                  mutually_exclusive_args, kwargs, snapshot_dict
              )
          # parsing config
          if "config" in snapshot_dict:
              config = {}
              config_list = snapshot_dict["config"]
              for item in config_list:
                  item_parsed_dict = parse_cli_key_value(item, "config")
                  config.update(item_parsed_dict)
              snapshot_dict["config"] = config
  
          # Stats
          if (
              kwargs.get("stats_filepath", None)
              or kwargs.get("stats_filename", None)
              or kwargs.get("config", None)
          ):
              mutually_exclusive_args = [
                  "stats_filepath",
                  "stats_filename",
                  "stats",
              ]
              mutually_exclusive(
                  mutually_exclusive_args, kwargs, snapshot_dict
              )
          # parsing stats
          if "stats" in snapshot_dict:
              stats = {}
              stats_list = snapshot_dict["stats"]
              for item in stats_list:
                  item_parsed_dict = parse_cli_key_value(item, "stats")
                  stats.update(item_parsed_dict)
              snapshot_dict["stats"] = stats
  
          optional_args = ["message", "label"]
  
          for arg in optional_args:
              if arg in kwargs and kwargs[arg] is not None:
                  snapshot_dict[arg] = kwargs[arg]
  
          snapshot_obj = self.snapshot_controller.create(snapshot_dict)
          # Because snapshots may be invisible to the user, this function ensures that by the end
          # the user can monitor the snapshot on the CLI, but making it visible
          snapshot_obj = self.snapshot_controller.update(
              snapshot_obj.id, visible=True
          )
          self.cli_helper.echo(
              __("info", "cli.snapshot.create.success", snapshot_obj.id)
          )
          return snapshot_obj
  
imports: from __future__ import print_function
  import os
  from datetime import datetime
  from datmo.core.util.i18n import get
  from datmo.cli.driver.helper import Helper
  from datmo.core.util.misc_functions import mutually_exclusive, printable_object, prettify_datetime, parse_cli_key_value, format_table
  from datmo.core.util.exceptions import SnapshotCreateFromTaskArgs
  from datmo.cli.command.project import ProjectCommand
  from datmo.core.controller.snapshot import SnapshotController
label_desc: Use image node_id 4 for calling the SnapshotCommand obj's underlying member method code with example usage: obj.create() and returns: snapshot_task_obj, snapshot_obj