def get_resource_and_action(action):
 data = action.split(':', 1)[0].split('_', 1)
 return (('%ss' % data[(-1)]), (data[0] != 'get'))

def get_resource_and_action ( action ) : data = action . split ( ':' , 1 ) [ 0 ] . split ( '_' , 1 ) return ( ( '%ss' % data [ ( - 1 ) ] ) , ( data [ 0 ] != 'get' ) )
return resource and enforce_attr_based_check per resource and action extracted from api operation .