import re
from textwrap import dedent


def normalize_repr_output(expression):
    """
    Enable string comparison between :func:`repr()` output on different Python versions.

    This function enables string comparison between :func:`repr()` output on
    Python 2 (where Unicode strings have the ``u`` prefix) and Python 3 (where
    Unicode strings are the default and no prefix is emitted by
    :func:`repr()`).
    """
    return re.sub(r'\bu([\'"])', r'\1', dedent(expression).strip())