code: def is_overridden(
      method_name: str, instance: object, parent: object
  ) -> bool:
      """Check if a method has been overridden by an instance compared to its parent class."""
      instance_attr = getattr(instance, method_name, None)
      if instance_attr is None:
          return False
      # `functools.wraps()` support
      if hasattr(instance_attr, "__wrapped__"):
          instance_attr = instance_attr.__wrapped__
      # `Mock(wraps=...)` support
      if isinstance(instance_attr, Mock):
          # access the wrapped function
          instance_attr = instance_attr._mock_wraps
      # `partial` support
      elif isinstance(instance_attr, partial):
          instance_attr = instance_attr.func
      if instance_attr is None:
          return False
  
      parent_attr = getattr(parent, method_name, None)
      if parent_attr is None:
          raise ValueError("The parent should define the method")
  
      return instance_attr.__code__ != parent_attr.__code__
  
imports: import logging
  import multiprocessing
  import os
  from functools import partial
  from time import perf_counter
  from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, no_type_check
  from unittest.mock import Mock
  import torch
  from torch import Tensor
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.data import select_topk, to_onehot
  from torchmetrics.utilities.enums import DataType
label_desc: Use image node_id 18 for calling a global function with example usage: is_overridden(method_name, instance, parent) and returns: unknown, False, False