code: def force_colors():
      forcecolor = os.environ.get("FORCE_COLOR", None)
  
      try:
          os.environ["FORCE_COLOR"] = "1"
          yield
      finally:
          if forcecolor is None:
              os.environ.pop("FORCE_COLOR", None)
          else:
              os.environ["FORCE_COLOR"] = forcecolor
  
file_path: sphinx/tests/test_builders/test_build.py
imports: import os
  import shutil
  from contextlib import contextmanager
  from unittest import mock
  import pytest
  from docutils import nodes
  from sphinx.cmd.build import build_main
  from sphinx.errors import SphinxError
  from tests.utils import TESTS_ROOT
label_desc: Use image node_id 8 for calling a global function with example usage: force_colors() without return types