def transform_rule_explanation(explanation):
    """
    Transforms the provided backup rule explanation into a string.

    :param explanation: associated dataset definition
    :return: the flattened result
    """

    if explanation:
        return '\n'.join(
            list(
                map(
                    lambda entry: '({} @ line {}): {}'.format(
                        entry['operation'],
                        str(entry['original']['line_number']).rjust(3, ' '),
                        entry['original']['line'].split('#')[0].strip(),
                    ),
                    explanation
                )
            )
        )
    else:
        return '<required>'