code: def mock_file_checker_with_plugin(plugin_target):
      """Get a mock FileChecker class with plugin_target registered.
  
      Useful as a starting point for mocking reports/results.
      """
      to_load = [
          finder.Plugin(
              "flake-package",
              "9001",
              importlib.metadata.EntryPoint(
                  "Q",
                  f"{plugin_target.__module__}:{plugin_target.__name__}",
                  "flake8.extension",
              ),
          ),
      ]
      opts = finder.PluginOptions.blank()
      plugins = finder.load_plugins(to_load, opts)
  
      # Prevent it from reading lines from stdin or somewhere else
      with mock.patch(
          "flake8.processor.FileProcessor.read_lines",
          return_value=["Line 1"],
      ):
          file_checker = checker.FileChecker(
              filename="-",
              plugins=plugins.checkers,
              options=mock.MagicMock(),
          )
      return file_checker
  
imports: from __future__ import annotations
  import importlib.metadata
  import sys
  from unittest import mock
  import pytest
  from flake8 import checker
  from flake8.plugins import finder
  from flake8.processor import FileProcessor
label_desc: Use image node_id 10 for calling a global function with example usage: mock_file_checker_with_plugin(plugin_target) and returns: file_checker