code: def _has_original_dunder_external(
      value,
      module_name: str,
      access_path: Sequence[str],
      method_name: str,
  ):
      if module_name not in sys.modules:
          # LBYLB as it is faster
          return False
      try:
          member_type = _get_external(module_name, access_path)
          value_type = type(value)
          if type(value) == member_type:
              return True
          if method_name == "__getattribute__":
              # we have to short-circuit here due to an unresolved issue in
              # `isinstance` implementation: https://bugs.python.org/issue32683
              return False
          if isinstance(value, member_type):
              method = getattr(value_type, method_name, None)
              member_method = getattr(member_type, method_name, None)
              if member_method == method:
                  return True
      except (AttributeError, KeyError):
          return False
  
imports: from inspect import signature, Signature
  from typing import Any, Callable, Dict, Set, Sequence, Tuple, NamedTuple, Type, Literal, Union, TYPE_CHECKING
  import ast
  import builtins
  import collections
  import operator
  import sys
  from functools import cached_property
  from dataclasses import dataclass, field
  from types import MethodDescriptorType, ModuleType
  from IPython.utils.docs import GENERATING_DOCUMENTATION
  from IPython.utils.decorators import undoc
label_desc: Use image node_id 3 for calling a global function with example usage: _has_original_dunder_external(value, module_name, access_path, method_name) and returns: False, True, False, False, True