code: def add_context(
      context: CloudClientContext, *, ignore_warning: bool = False
  ) -> None:
      config = CloudClientConfig.get_config()
      for idx, ctx in enumerate(config.contexts):
          if ctx.name == context.name:
              if not ignore_warning:
                  logger.warning(
                      "Overriding existing cloud context config: %s",
                      ctx.name,
                  )
              config.contexts[idx] = context
              break
      else:
          config.contexts.append(context)
      config.to_yaml_file()
  
imports: from __future__ import annotations
  import logging
  import typing
  import attr
  import yaml
  from simple_di import Provide
  from simple_di import inject
  from ...exceptions import CloudRESTApiClientError
  from ..configuration.containers import BentoMLContainer
  from ..utils import bentoml_cattr
  from .client import RestApiClient
label_desc: Use image node_id 1 for calling a global function with example usage: add_context(context) without return types