<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fmt_ria(ria, verbose=True, mip=False):
 """Format a |RepertoireIrreducibilityAnalysis|."""

    if verbose:
        mechanism = 'Mechanism: {}\n'.format(
            fmt_mechanism(ria.mechanism, ria.node_labels))
        direction = '\nDirection: {}'.format(ria.direction)
    else:
        mechanism = ''
        direction = ''

    if config.REPR_VERBOSITY is HIGH:
        partition = '\n{}:\n{}'.format(
            ('MIP' if mip else 'Partition'),
            indent(fmt_partition(ria.partition)))
        repertoire = '\nRepertoire:\n{}'.format(
            indent(fmt_repertoire(ria.repertoire)))
        partitioned_repertoire = '\nPartitioned repertoire:\n{}'.format(
            indent(fmt_repertoire(ria.partitioned_repertoire)))
    else:
        partition = ''
        repertoire = ''
        partitioned_repertoire = ''

    # TODO? print the two repertoires side-by-side
    return (
        '{SMALL_PHI} = {phi}\n'
        '{mechanism}'
        'Purview = {purview}'
        '{direction}'
        '{partition}'
        '{repertoire}'
        '{partitioned_repertoire}').format(
            SMALL_PHI=SMALL_PHI,
            mechanism=mechanism,
            purview=fmt_mechanism(ria.purview, ria.node_labels),
            direction=direction,
            phi=fmt_number(ria.phi),
            partition=partition,
            repertoire=repertoire,
            partitioned_repertoire=partitioned_repertoire)