code: def get_valid_residue(residue):
      
      if residue is not None and amino_acids.get(residue) is None:
          res = amino_acids_reverse.get(residue.lower())
          if res is None:
              raise InvalidResidueError(residue)
          else:
              return res
      return residue
docs: Check if the given string represents a valid amino acid residue.