Implement rate_all(user, to_rate, fns) in the recommendation module.
What to do:
Input:
user: a User object that may have existing reviews for some restaurants.
to_rate: a list of Restaurant objects to rate.
fns: a list of rating functions. Each function takes a Restaurant and returns a numeric score (int or float).
Output:
Return a dictionary mapping each restaurant's name (string) to a numeric rating (int if derived from the user’s review, otherwise a float predicted rating).
Behavior:
For any restaurant that the user has already reviewed, use the user's rating from that review as the value in the dictionary.
For restaurants not reviewed by the user, compute a predicted rating by applying every function in fns to the restaurant and combining the results (e.g., average the returned scores) to obtain a single numeric prediction.
The resulting dictionary should have one entry per restaurant in to_rate, with keys being restaurant names and values being numbers.
Notes:
The function should work with the given data structures (User, Restaurant, Review) as used in the tests.
The keys of the dictionary must be restaurant names, and the values must be numeric ratings.