<s> """<STR_LIT>""" <EOL> from _functools import partial , reduce <EOL> WRAPPER_ASSIGNMENTS = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> WRAPPER_UPDATES = ( '<STR_LIT>' , ) <EOL> def update_wrapper ( wrapper , <EOL> wrapped , <EOL> assigned = WRAPPER_ASSIGNMENTS , <EOL> updated = WRAPPER_UPDATES ) : <EOL> """<STR_LIT>""" <EOL> for attr in assigned : <EOL> setattr ( wrapper , attr , getattr ( wrapped , attr ) ) <EOL> for attr in updated : <EOL> getattr ( wrapper , attr ) . update ( getattr ( wrapped , attr , { } ) ) <EOL> return wrapper <EOL> def wraps ( wrapped , <EOL> assigned = WRAPPER_ASSIGNMENTS , <EOL> updated = WRAPPER_UPDATES ) : <EOL> """<STR_LIT>""" <EOL> return partial ( update_wrapper , wrapped = wrapped , <EOL> assigned = assigned , updated = updated ) </s>
