code: def test_local_plugin_can_add_option(local_config):
      """A local plugin can add a CLI option."""
  
      argv = ["--config", local_config, "--anopt", "foo"]
  
      stage1_parser = stage1_arg_parser()
      stage1_args, rest = stage1_parser.parse_known_args(argv)
  
      cfg, cfg_dir = config.load_config(
          config=stage1_args.config, extra=[], isolated=False
      )
  
      opts = finder.parse_plugin_options(
          cfg,
          cfg_dir,
          enable_extensions=None,
          require_plugins=None,
      )
      plugins = finder.find_plugins(cfg, opts)
      loaded_plugins = finder.load_plugins(plugins, opts)
  
      option_manager = OptionManager(
          version="123",
          plugin_versions="",
          parents=[stage1_parser],
          formatter_names=[],
      )
      register_default_options(option_manager)
      option_manager.register_plugins(loaded_plugins)
  
      args = aggregator.aggregate_options(
          option_manager, cfg, cfg_dir, argv
      )
  
      assert args.extended_default_select == [
          "XE",
          "C90",
          "F",
          "E",
          "W",
      ]
      assert args.anopt == "foo"
  
imports: from __future__ import annotations
  import pytest
  from flake8.main.cli import main
  from flake8.main.options import register_default_options
  from flake8.main.options import stage1_arg_parser
  from flake8.options import aggregator
  from flake8.options import config
  from flake8.options.manager import OptionManager
  from flake8.plugins import finder
label_desc: Use image node_id 3 for calling a global function with example usage: test_local_plugin_can_add_option(local_config) without return types