What is the use of the "reduce" function in Python?