ENH: User defined operation for reduce