'Returns a filter function that automatically removes blocks that satisfy
the removal_condition.
Arguments:
removal_condition ((usage_key)->bool) - A function that
takes a block\'s usage key as input and returns whether
or not to remove that block from the block structure.
keep_descendants (bool) - See the description in
remove_block.'

def create_removal_filter(self, removal_condition, keep_descendants=False):

    return partial(self.retain_or_remove, removal_condition=removal_condition, keep_descendants=keep_descendants)
