def require_admin_context(f):
 def wrapper(*args, **kwargs):
  if (not is_admin_context(args[0])):
   raise exception.AdminRequired()
  return f(*args, **kwargs)
 return wrapper

def require_admin_context ( f ) : def wrapper ( * args , ** kwargs ) : if ( not is_admin_context ( args [ 0 ] ) ) : raise exception . AdminRequired ( ) return f ( * args , ** kwargs ) return wrapper
decorator to require admin request context .