code: def is_dataclass(obj):
      """Returns True if obj is a dataclass or an instance of a
      dataclass."""
      cls = obj if isinstance(obj, type) else type(obj)
      return hasattr(cls, _FIELDS)
  
imports: import re
  import sys
  import copy
  import types
  import inspect
  import keyword
  import builtins
  import functools
  import itertools
  import abc
  import _thread
  from types import FunctionType, GenericAlias
label_desc: Use image node_id 32 for calling a global function with example usage: is_dataclass(obj) and returns: hasattr