empty this function is the same as the reduce(function that was built-in in python for future compatibilityuse this version instead update_wrapper(wrapperwrapped [assigned [updated]]this is utility function that is useful when writing decorators copies attributes from function wrapped to wrapper function wrapper in order to make the wrapped function look like the original function assigned is tuple of attribute names to copy and is set to (' _name_ ',' _module_ ',' _doc_ 'by default updated is tuple containing the names of function attributes that are dictionaries and which you want values merged in the wrapper by defaultit is tuple (' _dict_ ',wraps(function [assigned [updated ]] decorator carries out the same task as update_wrapper(on the function to which it is applied assigned and updated have the same meaning typical use of this decorator is when writing other decorators for examplefrom functools import wraps def debug(func)@wraps(funcdef wrapped(*args,**kwargs)print("calling %sfunc _name_ _r func(*args,**kwargsprint("done calling %sfunc _name_ _return wrapped @debug def add( , )return + see also"functions and functional programming heapq the heapq module implements priority queue using heap heaps are simply lists of ordered items in which the heap condition has been imposed specificallyheap[ <heap[ * + and heap[ <heap[ * + for all nstarting with heap[ always contains the smallest item heapify(xconverts listxinto heapin place heappop(heapreturns and removes the smallest item from heappreserving the heap condition raises indexerror if heap is empty heappush(heapitemadds item to the heappreserving the heap condition lib fl ff