def wrap_check_policy(func):
 @functools.wraps(func)
 def wrapped(self, context, target_obj, *args, **kwargs):
  check_policy(context, func.__name__, target_obj)
  return func(self, context, target_obj, *args, **kwargs)
 return wrapped

def wrap_check_policy ( func ) : @ functools . wraps ( func ) def wrapped ( self , context , target_obj , * args , ** kwargs ) : check_policy ( context , func . __name__ , target_obj ) return func ( self , context , target_obj , * args , ** kwargs ) return wrapped
check policy corresponding to the wrapped methods prior to execution .