code: def result_invoke(action):
      r"""
      Decorate a function with an action function that is
      invoked on the results returned from the decorated
      function (for its side-effect), then return the original
      result.
  
      >>> @result_invoke(print)
      ... def add_two(a, b):
      ...     return a + b
      >>> x = add_two(2, 3)
      5
      >>> x
      5
      """
  
      def wrap(func):
          @functools.wraps(func)
          def wrapper(*args, **kwargs):
              result = func(*args, **kwargs)
              action(result)
              return result
  
          return wrapper
  
      return wrap
  
imports: import functools
  import time
  import inspect
  import collections
  import types
  import itertools
  import warnings
  import setuptools.extern.more_itertools
  from typing import Callable, TypeVar
label_desc: Use image node_id 7 for calling a global function with example usage: result_invoke(action) and returns: wrap, wrapper, result