def _consensus_base_alphabet(alphabets):
 common = None
 for alpha in alphabets:
  a = _get_base_alphabet(alpha)
  if (common is None):
   common = a
  elif (common == a):
   pass
  elif isinstance(a, common.__class__):
   pass
  elif isinstance(common, a.__class__):
   common = a
  elif (isinstance(a, NucleotideAlphabet) and isinstance(common, NucleotideAlphabet)):
   common = generic_nucleotide
  elif (isinstance(a, SingleLetterAlphabet) and isinstance(common, SingleLetterAlphabet)):
   common = single_letter_alphabet
  else:
   return generic_alphabet
 if (common is None):
  return generic_alphabet
 return common

def _consensus_base_alphabet ( alphabets ) : common = None for alpha in alphabets : a = _get_base_alphabet ( alpha ) if ( common is None ) : common = a elif ( common == a ) : pass elif isinstance ( a , common . __class__ ) : pass elif isinstance ( common , a . __class__ ) : common = a elif ( isinstance ( a , NucleotideAlphabet ) and isinstance ( common , NucleotideAlphabet ) ) : common = generic_nucleotide elif ( isinstance ( a , SingleLetterAlphabet ) and isinstance ( common , SingleLetterAlphabet ) ) : common = single_letter_alphabet else : return generic_alphabet if ( common is None ) : return generic_alphabet return common
returns a common but often generic base alphabet object .