code: def format_context(
      context: Context, formatter: typing.Union[str, Formatter] = "full"
  ) -> str:
      
      if not context:
          return ""
  
      if callable(formatter):
          formatter_func = formatter
      else:
          if formatter in CONTEXT_FORMATTERS:
              formatter_func = CONTEXT_FORMATTERS[formatter]
          else:
              raise ValueError(f'Invalid context format: "{formatter}"')
      return formatter_func(context)
docs: Output the a context dictionary as a string.