<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def repertoire_distance(direction, r1, r2):
 """Compute the distance between two repertoires for the given direction. Args: direction (Direction):
 |CAUSE| or |EFFECT|. r1 (np.ndarray):
 The first repertoire. r2 (np.ndarray):
 The second repertoire. Returns: float: The distance between ``d1`` and ``d2``, rounded to |PRECISION|. """

    if config.MEASURE == 'EMD':
        dist = directional_emd(direction, r1, r2)
    else:
        dist = measures[config.MEASURE](r1, r2)

    return round(dist, config.PRECISION)