def pad_sents(sents, padding_token_index):
    """

    Pad the sents(in word index form) into same length so they can form a matrix
    
    # 15447
    >>> sents = [[1,2,3], [1,2], [1,2,3,4,5]]
    >>> pad_sents(sents, padding_token_index = -1)
    [[1, 2, 3, -1, -1], [1, 2, -1, -1, -1], [1, 2, 3, 4, 5]]
    """
    max_len_sent = max(sents, 
                       key = lambda sent: len(sent))
    max_len = len(max_len_sent)
    
    get_padding = lambda sent: [padding_token_index] * (max_len - len(sent))
    padded_sents = [(sent + get_padding(sent))
                    for sent in sents]
    return padded_sents