def _closest_ref_length(references, trans_length):
ref_lengths = (len(reference) for reference in references)<EOL>closest_ref_len = min(ref_lengths,<EOL>key=lambda ref_length: (abs(ref_length - trans_length), ref_length))<EOL>return closest_ref_len<EOL>
Find the reference that has the closest length to the translation.

    Parameters
    ----------
    references: list(list(str))
        A list of references.
    trans_length: int
        Length of the translation.

    Returns
    -------
    closest_ref_len: int
        Length of the reference that is closest to the translation.