code: def _file_reduce(obj):
      """Save a file"""
      import io
  
      if not hasattr(obj, "name") or not hasattr(obj, "mode"):
          raise pickle.PicklingError(
              "Cannot pickle files that do not map to an actual file"
          )
      if obj is sys.stdout:
          return getattr, (sys, "stdout")
      if obj is sys.stderr:
          return getattr, (sys, "stderr")
      if obj is sys.stdin:
          raise pickle.PicklingError("Cannot pickle standard input")
      if obj.closed:
          raise pickle.PicklingError("Cannot pickle closed files")
      if hasattr(obj, "isatty") and obj.isatty():
          raise pickle.PicklingError(
              "Cannot pickle files that map to tty objects"
          )
      if "r" not in obj.mode and "+" not in obj.mode:
          raise pickle.PicklingError(
              "Cannot pickle files that are not opened for reading: %s"
              % obj.mode
          )
  
      name = obj.name
  
      retval = io.StringIO()
  
      try:
          # Read the whole file
          curloc = obj.tell()
          obj.seek(0)
          contents = obj.read()
          obj.seek(curloc)
      except IOError as e:
          raise pickle.PicklingError(
              "Cannot pickle file %s as it cannot be read" % name
          ) from e
      retval.write(contents)
      retval.seek(curloc)
  
      retval.name = name
      return _file_reconstructor, (retval,)
  
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 10 for calling a global function with example usage: _file_reduce(obj) and returns: _file_reconstructor,  retval, getattr,  sys,  str, getattr,  sys,  str