Stuck in Deep learning for NLP (with python) 2

max_encoder_seq_length = max([len(re.findall(r"[\w']+|[^\s\w]", input_doc)) for input_doc in input_docs])
max_decoder_seq_length = max([len(re.findall(r"[\w']+|[^\s\w]", target_doc)) for target_doc in target_docs])

In the above code, input docs & target docs contain all the input and target sentences we’re giving for training the model for translation from english to spanish.

My question is what exactly are we trying to do and what exactly do max_encoder_seq_length & max_decoder_seq_length contain?