code: def _function_setstate(obj, state):
      """Update the state of a dynamic function.
  
      As __closure__ and __globals__ are readonly attributes of a function, we
      cannot rely on the native setstate routine of pickle.load_build, that calls
      setattr on items of the slotstate. Instead, we have to modify them inplace.
      """
      state, slotstate = state
      obj.__dict__.update(state)
  
      obj_globals = slotstate.pop("__globals__")
      obj_closure = slotstate.pop("__closure__")
      # _cloudpickle_subimports is a set of submodules that must be loaded for
      # the pickled function to work correctly at unpickling time. Now that these
      # submodules are depickled (hence imported), they can be removed from the
      # object's state (the object state only served as a reference holder to
      # these submodules)
      slotstate.pop("_cloudpickle_submodules")
  
      obj.__globals__.update(obj_globals)
      obj.__globals__["__builtins__"] = __builtins__
  
      if obj_closure is not None:
          for i, cell in enumerate(obj_closure):
              try:
                  value = cell.cell_contents
              except ValueError:  # cell is empty
                  continue
              cell_set(obj.__closure__[i], value)
  
      for k, v in slotstate.items():
          setattr(obj, k, v)
  
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 28 for calling a global function with example usage: _function_setstate(obj, state) without return types