def variable_length_to_fixed_length_categorical(<EOL>self, left_edge=<NUM_LIT:4>, right_edge=<NUM_LIT:4>, max_length=<NUM_LIT:15>):
cache_key = (<EOL>"<STR_LIT>",<EOL>left_edge,<EOL>right_edge,<EOL>max_length)<EOL>if cache_key not in self.encoding_cache:<EOL><INDENT>fixed_length_sequences = (<EOL>self.sequences_to_fixed_length_index_encoded_array(<EOL>self.sequences,<EOL>left_edge=left_edge,<EOL>right_edge=right_edge,<EOL>max_length=max_length))<EOL>self.encoding_cache[cache_key] = fixed_length_sequences<EOL><DEDENT>return self.encoding_cache[cache_key]<EOL>
Encode variable-length sequences using a fixed-length encoding designed
for preserving the anchor positions of class I peptides.

The sequences must be of length at least left_edge + right_edge, and at
most max_length.

Parameters
----------
left_edge : int, size of fixed-position left side
right_edge : int, size of the fixed-position right side
max_length : sequence length of the resulting encoding

Returns
-------
numpy.array of integers with shape (num sequences, max_length)