code: def write_to_bento(self, bento_fs: FS, build_ctx: str) -> None:
      if self.is_empty():
          return
  
      conda_folder = fs.path.join("env", "conda")
      bento_fs.makedirs(conda_folder, recreate=True)
  
      if self.environment_yml is not None:
          environment_yml_file = resolve_user_filepath(
              self.environment_yml, build_ctx
          )
          copy_file_to_fs_folder(
              environment_yml_file,
              bento_fs,
              conda_folder,
              dst_filename=CONDA_ENV_YAML_FILE_NAME,
          )
      else:
          deps_list: DependencyType = []
          if self.dependencies is not None:
              deps_list.extend(self.dependencies)
          if self.pip is not None:
              if any(isinstance(x, dict) for x in deps_list):
                  raise BentoMLException(
                      "Cannot not have both 'conda.dependencies.pip' and 'conda.pip'"
                  )
              deps_list.append({"pip": self.pip})
  
          if not deps_list:
              return
  
          yaml_content: CondaYamlDict = {"dependencies": deps_list}
          assert self.channels is not None
          yaml_content["channels"] = self.channels
          with bento_fs.open(
              fs.path.combine(conda_folder, CONDA_ENV_YAML_FILE_NAME),
              "w",
          ) as f:
              yaml.dump(yaml_content, f)
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import subprocess
  import sys
  import typing
  from shlex import quote
  from sys import version_info
  import attr
  import fs
  import fs.copy
  import psutil
  import yaml
  from pathspec import PathSpec
  from ...exceptions import BentoMLException
  from ...exceptions import InvalidArgument
  from ..configuration import BENTOML_VERSION
  from ..configuration import clean_bentoml_version
  from ..configuration import get_quiet_mode
  from ..container import generate_containerfile
  from ..container.frontend.dockerfile import ALLOWED_CUDA_VERSION_ARGS
  from ..container.frontend.dockerfile import CONTAINER_SUPPORTED_DISTROS
  from ..container.frontend.dockerfile import SUPPORTED_CUDA_VERSIONS
  from ..container.frontend.dockerfile import DistroSpec
  from ..container.frontend.dockerfile import get_supported_spec
  from ..container.generate import BENTO_PATH
  from ..utils import bentoml_cattr
  from ..utils import copy_file_to_fs_folder
  from ..utils import resolve_user_filepath
  from ..utils.dotenv import parse_dotenv
  from .build_dev_bentoml_whl import build_bentoml_editable_wheel
label_desc: Use image node_id 2 for calling the CondaOptions obj's underlying member method code with example usage: obj.write_to_bento(bento_fs, build_ctx) without return types