def METHOD_NAME(self, data, level, items, f):
    if level == 1:
        item_iter = repeat_last(items)
        return [self.METHOD_NAME(obj, level-1, next(item_iter), f) for obj in data]
    elif level:
        return [self.METHOD_NAME(obj, level-1, items, f) for obj in data]
    else:
        return f(data, items)