def aa_name(aa): """Given the single-letter code for an amino acid, find the corresponding name. Throws an exception if given an invalid code.""" if not(is_string(aa)): parameter_error("aa_name", 1, "string", aa) if len(aa) != 1: parameter_error("aa_name", 1, "length-one string", aa) if not(aa in amino_acids): parameter_error("aa_name", 1, "one-character amino acid", aa) return aa_name_dict[aa]