code: def from_options(
      cls, docker: DockerOptions, conda: CondaOptions
  ) -> DistroSpec:
      if not docker.distro:
          raise BentoMLException(
              "Distro is required, got None instead."
          )
  
      if docker.distro not in CONTAINER_METADATA:
          raise BentoMLException(
              f"{docker.distro} is not supported. Supported distros are: {', '.join(CONTAINER_METADATA.keys())}."
          )
  
      if docker.cuda_version is not None:
          release_type = "cuda"
      elif not conda.is_empty():
          release_type = "miniconda"
      else:
          release_type = "python"
  
      meta = CONTAINER_METADATA[docker.distro]
  
      return cls(
          **meta[release_type],
          name=docker.distro,
          supported_python_versions=meta["supported_python_versions"],
          supported_cuda_versions=meta["supported_cuda_versions"],
      )
  
file_path: BentoML/src/bentoml/_internal/container/frontend/dockerfile/__init__.py
imports: from __future__ import annotations
  import logging
  import typing
  from typing import TYPE_CHECKING
  import attr
  from .....exceptions import BentoMLException
  from .....exceptions import InvalidArgument
label_desc: Use image node_id 1 for calling the DistroSpec obj's underlying member method code with example usage: obj.from_options(cls, docker, conda) and returns: cls