def _brevity_penalty(ref_length, trans_length):
if trans_length > ref_length:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>elif trans_length == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>return math.exp(<NUM_LIT:1> - float(ref_length) / trans_length)<EOL><DEDENT>
Calculate brevity penalty.

    Parameters
    ----------
    ref_length: int
        Sum of all closest references'lengths for every translations in a corpus
    trans_length: int
        Sum of all translations's lengths in a corpus.

    Returns
    -------
    bleu's brevity penalty: float