where '%r' is replaced with name and filter_func, respectively. define the method filter_function with 3 arguments: self, func and unpacked dictionary flags.
def filter_function ( self , func , ** flags ) :