Action function generator to retrieve an attribute from the current link

def attr(aid):
    '''
    Action function generator to retrieve an attribute from the current link
    '''
    def _attr(ctx):
        return ctx.current_link[ATTRIBUTES].get(aid)
    return _attr