code: def _make_entry_point_query_mock(callback_factory):
      query_mock = Mock()
      entry_point = Mock()
      entry_point.name = "mocked"
      entry_point.load.return_value = callback_factory
      if _PYTHON_GREATER_EQUAL_3_10_0:
          query_mock.return_value = [entry_point]
          import_path = "importlib.metadata.entry_points"
      elif _PYTHON_GREATER_EQUAL_3_8_0:
          query_mock().get.return_value = [entry_point]
          import_path = "importlib.metadata.entry_points"
      else:
          query_mock.return_value = [entry_point]
          import_path = "pkg_resources.iter_entry_points"
      with mock.patch(import_path, query_mock):
          yield
  
imports: import contextlib
  import logging
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric.utilities.imports import _PYTHON_GREATER_EQUAL_3_8_0, _PYTHON_GREATER_EQUAL_3_10_0
  from lightning.pytorch import Callback, LightningModule, Trainer
  from lightning.pytorch.callbacks import EarlyStopping, GradientAccumulationScheduler, LearningRateMonitor, ModelCheckpoint, ModelSummary, ProgressBar, TQDMProgressBar
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.connectors.callback_connector import _CallbackConnector
label_desc: Use image node_id 6 for calling a global function with example usage: _make_entry_point_query_mock(callback_factory) without return types