def convert_aa_code(x):
if len(x) == <NUM_LIT:1>:<EOL><INDENT>return amino_acid_codes[x.upper()]<EOL><DEDENT>elif len(x) == <NUM_LIT:3>:<EOL><INDENT>return inverse_aa_codes[x.upper()]<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % x)<EOL><DEDENT>
Converts between 3-letter and 1-letter amino acid codes.