<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rating_score(obj, user):
 """ Returns the score a user has given an object """

    if not user.is_authenticated() or not hasattr(obj, '_ratings_field'):
        return False

    ratings_descriptor = getattr(obj, obj._ratings_field)
    try:
        rating = ratings_descriptor.get(user=user).score
    except ratings_descriptor.model.DoesNotExist:
        rating = None

    return rating