def explanation_value(explanation, text):
    """ Gets the value from the explanation for descriptions starting with
    the given text.

    """

    if explanation.description.startswith(text):
        return {
            'description': explanation.description,
            'value': explanation.value
        }

    for detail in getattr(explanation, 'details', []):
        result = explanation_value(detail, text)

        if result:
            return result