code: def _function_getstate(func):
      # - Put func's dynamic attributes (stored in func.__dict__) in state. These
      #   attributes will be restored at unpickling time using
      #   f.__dict__.update(state)
      # - Put func's members into slotstate. Such attributes will be restored at
      #   unpickling time by iterating over slotstate and calling setattr(func,
      #   slotname, slotvalue)
      slotstate = {
          "__name__": func.__name__,
          "__qualname__": func.__qualname__,
          "__annotations__": func.__annotations__,
          "__kwdefaults__": func.__kwdefaults__,
          "__defaults__": func.__defaults__,
          "__module__": func.__module__,
          "__doc__": func.__doc__,
          "__closure__": func.__closure__,
      }
  
      f_globals_ref = _extract_code_globals(func.__code__)
      f_globals = {
          k: func.__globals__[k]
          for k in f_globals_ref
          if k in func.__globals__
      }
  
      closure_values = (
          list(map(_get_cell_contents, func.__closure__))
          if func.__closure__ is not None
          else ()
      )
  
      # Extract currently-imported submodules used by func. Storing these modules
      # in a smoke _cloudpickle_subimports attribute of the object's state will
      # trigger the side effect of importing these modules at unpickling time
      # (which is necessary for func to work correctly once depickled)
      slotstate["_cloudpickle_submodules"] = _find_imported_submodules(
          func.__code__,
          itertools.chain(f_globals.values(), closure_values),
      )
      slotstate["__globals__"] = f_globals
  
      state = func.__dict__
      return state, slotstate
  
imports: 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
  from ._compat import pickle, Pickler
  from ._cloudpickle import _extract_code_globals, _BUILTIN_TYPE_NAMES, DEFAULT_PROTOCOL, _find_imported_submodules, _get_cell_contents, _is_importable, _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
label_desc: Use image node_id 4 for calling a global function with example usage: _function_getstate(func) and returns: state,  slotstate