<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self, representation):
 """Parses a duration string representation :param representation: duration as a string, example: '1d' (day), :type representation: string :returns: the parsed duration representation :rtype: DurationRepresentation """

        elements = extract_tokens(representation)

        try:
            scales = [DurationRepresentation(float(p[0]), Scale(p[1])) for p in elements]
        except ValueError:
            raise ScaleFormatError("Malformed duration representation: {0}".format(representation))

        return scales