<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_substituted_contents(contents, substitutions):
 """ Perform a list of substitutions and return the result. contents: the starting string on which to beging substitutions substitutions: list of Substitution objects to call, in order, with the result of the previous substitution. """

    result = contents
    for sub in substitutions:
        result = sub.apply_and_get_result(result)
    return result