code: def _check_mixed_imports(instance: object) -> None:
      old, new = "pytorch_" + "lightning", "lightning." + "pytorch"
      klass = type(instance)
      module = klass.__module__
      if module.startswith(old) and __name__.startswith(new):
          pass
      elif module.startswith(new) and __name__.startswith(old):
          old, new = new, old
      else:
          return
      raise TypeError(
          f"You passed a `{old}` object ({type(instance).__qualname__}) to a `{new}`"
          " Trainer. Please switch to a single import style."
      )
  
file_path: pytorch-lightning/src/lightning/pytorch/utilities/model_helpers.py
imports: import inspect
  import logging
  import os
  from types import MethodType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Optional, Type, TypeVar
  from lightning_utilities.core.imports import RequirementCache
  from torch import nn
  from typing_extensions import Concatenate, ParamSpec
  import lightning.pytorch
label_desc: Use image node_id 3 for calling a global function with example usage: _check_mixed_imports(instance) without return types