class_docstr: EnvironmentController inherits from BaseController and manages business logic related to the
  environment.
  
  Methods
  -------
  create(dictionary)
      Create an environment within the project
  build(id)
      Build the environment for use within the project
  list()
      List all environments within the project
  delete(id)
      Delete the specified environment from the project
class_docstr_tok: ["EnvironmentController","inherits","from","BaseController","and","manages","business","logic","related","to","the","environment",".","Methods","--","--","--","-","create","(","dictionary",")","Create","an","environment","within","the","project","build","(","id",")","Build","the","environment","for","use","within","the","project","list","(",")","List","all","environments","within","the","project","delete","(","id",")","Delete","the","specified","environment","from","the","project"]
docstr: Create a pre-defined supported environment and add it to the project environment directory
  
  The user can build on top of the pre-defined environment and create new ones of their own
  
  Parameters
  ----------
  options : dict
      can include the following values:
  
      name : str
          the name to be used to specify a supported environment
  save_hardware_file : bool, optional
      boolean to save hardware file along with other files
      (default is True to save the file and create distinct hashes based on software and hardware)
  
  Returns
  -------
  Environment
      returns an object representing the environment created
  
  Raises
  ------
  UnstagedChanges
      if unstaged changes exist in the environment it should fail
docstr_tok: ["Create","a","pre-defined","supported","environment","and","add","it","to","the","project","environment","directory","The","user","can","build","on","top","of","the","pre-defined","environment","and","create","new","ones","of","their","own","Parameters","--","--","--","--","--","options",":","dict","can","include","the","following","values",":","name",":","str","the","name","to","be","used","to","specify","a","supported","environment","save_hardware_file",":","bool",",","optional","boolean","to","save","hardware","file","along","with","other","files","(","default","is","True","to","save","the","file","and","create","distinct","hashes","based","on","software","and","hardware",")","Returns","--","--","--","-","Environment","returns","an","object","representing","the","environment","created","Raises","--","--","--","UnstagedChanges","if","unstaged","changes","exist","in","the","environment","it","should","fail"]
code: def setup(self, options, save_hardware_file=True):
      """Create a pre-defined supported environment and add it to the project environment directory
  
      The user can build on top of the pre-defined environment and create new ones of their own
  
      Parameters
      ----------
      options : dict
          can include the following values:
  
          name : str
              the name to be used to specify a supported environment
      save_hardware_file : bool, optional
          boolean to save hardware file along with other files
          (default is True to save the file and create distinct hashes based on software and hardware)
  
      Returns
      -------
      Environment
          returns an object representing the environment created
  
      Raises
      ------
      UnstagedChanges
          if unstaged changes exist in the environment it should fail
      """
      # Check unstaged changes before trying to setup
      try:
          self.check_unstaged_changes()
      except UnstagedChanges:
          raise UnstagedChanges(
              __(
                  "error",
                  "controller.environment.setup.unstaged",
                  self.environment_driver.environment_directory_path,
              )
          )
      try:
          _ = self.environment_driver.setup(
              options,
              definition_path=self.environment_driver.environment_directory_path,
          )
      except Exception:
          raise
      name = options.get("name", None)
      if name is None:
          environment_framework = options["environment_framework"]
          environment_type = options["environment_type"]
          environment_language = options["environment_language"]
          if environment_language:
              name = "%s:%s-%s" % (
                  environment_framework,
                  environment_type,
                  environment_language,
              )
          else:
              name = "%s:%s" % (environment_framework, environment_type)
      create_dict = {
          "name": name,
          "description": "supported environment created by datmo",
      }
      return self.create(
          create_dict, save_hardware_file=save_hardware_file
      )
  
imports: import os
  import shutil
  from datmo.core.controller.base import BaseController
  from datmo.core.controller.file.file_collection import FileCollectionController
  from datmo.core.entity.environment import Environment
  from datmo.core.util.i18n import get
  from datmo.core.util.validation import validate
  from datmo.core.util.spinner import Spinner
  from datmo.core.util.json_store import JSONStore
  from datmo.core.util.misc_functions import get_datmo_temp_path, list_all_filepaths
  from datmo.core.util.exceptions import PathDoesNotExist, RequiredArgumentMissing, TooManyArgumentsFound, EnvironmentNotInitialized, UnstagedChanges, ArgumentError, EnvironmentDoesNotExist, ProjectNotInitialized
label_desc: Use image node_id 5 for calling the EnvironmentController obj's underlying member method code with example usage: obj.setup(options, save_hardware_file) and returns: self