parameters: (action)
return_statement: return wrap
docstring: 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
docstring_summary: 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.
docstring_tokens: 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 .
function: 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
  	"""
  	def wrap(func):
  		@functools.wraps(func)
  		def wrapper(*args, **kwargs):
  			result = func(*args, **kwargs)
  			action(result)
  			return result
  		return wrapper
  	return wrap
function_tokens: def result_invoke ( action ) : def wrap ( func ) : @ functools . wraps ( func ) def wrapper ( * args , * * kwargs ) : result = func ( * args , * * kwargs ) action ( result ) return result return wrapper return wrap