class_docstr: Click command class customized for BentoML CLI, allow specifying a default
  command for each group defined.
  
  This command groups will also introduce support for aliases for commands and groups.
  
  Example:
  
  .. code-block:: python
  
      @click.group(cls=BentoMLCommandGroup)
      def cli(): ...
  
      @click.group(name="cloud", aliases=["cloud"], cls=BentoMLCommandGroup)
      def cli(): ...
  
      @cli.command(aliases=["serve-http"])
      def serve(): ...
code: def bentoml_common_params(
      func: F[P],
  ) -> WrappedCLI[bool, bool, str | None]:
      # NOTE: update NUMBER_OF_COMMON_PARAMS when adding option.
      from bentoml._internal.configuration import DEBUG_ENV_VAR
      from bentoml._internal.configuration import QUIET_ENV_VAR
      from bentoml._internal.configuration import set_debug_mode
      from bentoml._internal.configuration import set_quiet_mode
      from bentoml._internal.log import configure_logging
      from bentoml._internal.utils.analytics import BENTOML_DO_NOT_TRACK
  
      @cog.optgroup.group("Global options")
      @cog.optgroup.option(
          "-q",
          "--quiet",
          is_flag=True,
          default=False,
          envvar=QUIET_ENV_VAR,
          help="Suppress all warnings and info logs",
      )
      @cog.optgroup.option(
          "--verbose",
          "--debug",
          "verbose",
          is_flag=True,
          default=False,
          envvar=DEBUG_ENV_VAR,
          help="Generate debug information",
      )
      @cog.optgroup.option(
          "--do-not-track",
          is_flag=True,
          default=False,
          envvar=BENTOML_DO_NOT_TRACK,
          help="Do not send usage info",
      )
      @cog.optgroup.option(
          "--context",
          "cloud_context",
          type=click.STRING,
          default=None,
          help="BentoCloud context name.",
      )
      @click.pass_context
      @functools.wraps(func)
      def wrapper(
          ctx: click.Context,
          quiet: bool,
          verbose: bool,
          cloud_context: str | None,
          *args: P.args,
          **kwargs: P.kwargs,
      ) -> t.Any:
          ctx.obj = SharedOptions(cloud_context=cloud_context)
          if quiet:
              set_quiet_mode(True)
              if verbose:
                  logger.warning(
                      "'--quiet' passed; ignoring '--verbose/--debug'"
                  )
          elif verbose:
              set_debug_mode(True)
  
          configure_logging()
  
          return func(*args, **kwargs)
  
      return wrapper
  
imports: from __future__ import annotations
  import difflib
  import functools
  import logging
  import os
  import re
  import time
  import typing
  import attr
  import click
  import click_option_group
  from click import ClickException
  from click.exceptions import UsageError
label_desc: Use image node_id 1 for calling the BentoMLCommandGroup obj's underlying member method code with example usage: obj.bentoml_common_params(func) and returns: wrapper, func