code: def is_overridden(
      method_name: str,
      instance: Optional[object] = None,
      parent: Optional[Type[object]] = None,
  ) -> bool:
      if instance is None:
          # if `self.lightning_module` was passed as instance, it can be `None`
          return False
      if parent is None:
          if isinstance(instance, pl.LightningModule):
              parent = pl.LightningModule
          elif isinstance(instance, pl.LightningDataModule):
              parent = pl.LightningDataModule
          elif isinstance(instance, pl.Callback):
              parent = pl.Callback
          if parent is None:
              _check_mixed_imports(instance)
              raise ValueError("Expected a parent")
  
      from lightning_utilities.core.overrides import (
          is_overridden as _is_overridden,
      )
  
      return _is_overridden(method_name, instance, parent)
  
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 1 for calling a global function with example usage: is_overridden(method_name, instance, parent) and returns: _is_overridden, False