code: def _class_getstate(obj):
      clsdict = _extract_class_dict(obj)
      clsdict.pop("__weakref__", None)
  
      if issubclass(type(obj), abc.ABCMeta):
          # If obj is an instance of an ABCMeta subclass, don't pickle the
          # cache/negative caches populated during isinstance/issubclass
          # checks, but pickle the list of registered subclasses of obj.
          clsdict.pop("_abc_cache", None)
          clsdict.pop("_abc_negative_cache", None)
          clsdict.pop("_abc_negative_cache_version", None)
          registry = clsdict.pop("_abc_registry", None)
          if registry is None:
              if hasattr(abc, "_get_dump"):
                  # in Python3.7+, the abc caches and registered subclasses of a
                  # class are bundled into the single _abc_impl attribute
                  clsdict.pop("_abc_impl", None)
                  (registry, _, _, _) = abc._get_dump(obj)
  
                  clsdict["_abc_impl"] = [
                      subclass_weakref()
                      for subclass_weakref in registry
                  ]
              else:
                  # FIXME(suquark): The upstream cloudpickle cannot work in Ray
                  # because sometimes both '_abc_registry' and '_get_dump' does
                  # not exist. Some strange typing objects may cause this issue.
                  # Here the workaround just set "_abc_impl" to None.
                  clsdict["_abc_impl"] = None
          else:
              # In the above if clause, registry is a set of weakrefs -- in
              # this case, registry is a WeakSet
              clsdict["_abc_impl"] = [type_ for type_ in registry]
  
      if "__slots__" in clsdict:
          # pickle string length optimization: member descriptors of obj are
          # created automatically from obj's __slots__ attribute, no need to
          # save them in obj's state
          if isinstance(obj.__slots__, str):
              clsdict.pop(obj.__slots__)
          else:
              for k in obj.__slots__:
                  clsdict.pop(k, None)
  
      clsdict.pop("__dict__", None)  # unpicklable property object
  
      return (clsdict, {})
  
imports: import _collections_abc
  import abc
  import copyreg
  import io
  import itertools
  import logging
  import sys
  import struct
  import types
  import weakref
  import typing
  from enum import Enum
  from collections import ChainMap, OrderedDict
  from .compat import pickle, Pickler
  from .cloudpickle import _extract_code_globals, _BUILTIN_TYPE_NAMES, DEFAULT_PROTOCOL, _find_imported_submodules, _get_cell_contents, _should_pickle_by_reference, _builtin_type, _get_or_create_tracker_id, _make_skeleton_class, _make_skeleton_enum, _extract_class_dict, dynamic_subimport, subimport, _typevar_reduce, _get_bases, _make_cell, _make_empty_cell, CellType, _is_parametrized_type_hint, PYPY, cell_set, parametrized_type_hint_getinitargs, _create_parametrized_type_hint, builtin_code_type, _make_dict_keys, _make_dict_values, _make_dict_items, _make_function
label_desc: Use image node_id 5 for calling a global function with example usage: _class_getstate(obj) and returns: clsdict,  dict