code: def color_option(f):
      def callback(ctx, param, value):
          state = ctx.ensure_object(State)
          if value is False or (
              value is None
              and (
                  not sys.stdout.isatty()
                  or os.environ.get("NO_COLOR")
                  or os.environ.get("TERM") == "dumb"
              )
          ):
              state.stream.setFormatter(
                  logging.Formatter("%(levelname)-8s-  %(message)s")
              )
  
      return click.option(
          "--color/--no-color",
          is_flag=True,
          default=None,
          expose_value=False,
          help="Force enable or disable color and wrapping for the output. Default is auto-detect.",
          callback=callback,
      )(f)
  
imports: from __future__ import annotations
  import logging
  import os
  import shutil
  import sys
  import textwrap
  import traceback
  import warnings
  import click
  from mkdocs import __version__, config, utils
label_desc: Use image node_id 6 for calling a global function with example usage: color_option(f) and returns: click