code: def enable_buildkit(
      *, backend: str | None = None, builder: OCIBuilder | None = None
  ) -> bool:
      # We will look for DOCKER_BUILDKIT in the environment variable.
      # as this will be our entry point to enable BuildKit.
      if "DOCKER_BUILDKIT" in os.environ:
          return bool(int(os.environ["DOCKER_BUILDKIT"]))
      # If the variable is not set, fallback to the default value
      # provided by the builder.
      if builder is not None:
          return builder.enable_buildkit
      elif backend is not None:
          return get_backend(backend).enable_buildkit
      else:
          raise ValueError(
              "Either backend or builder must be provided."
          )
  
imports: from __future__ import annotations
  import contextlib
  import importlib
  import logging
  import os
  import sys
  import types
  import typing
  from typing import TYPE_CHECKING
  import fs
  import fs.mirror
  from simple_di import Provide
  from simple_di import inject
  from ...exceptions import InvalidArgument
  from ..configuration.containers import BentoMLContainer
  from ..utils import bentoml_cattr
  from .base import OCIBuilder
  from .generate import generate_containerfile
label_desc: Use image node_id 3 for calling a global function with example usage: enable_buildkit() and returns: bool, builder, get_backend