def get_mechanisms(xs):
 mechanisms = []
 for element in xs.features[(NS_XMPP_SASL, 'mechanisms')].elements():
  if (element.name == 'mechanism'):
   mechanisms.append(str(element))
 return mechanisms

def get_mechanisms ( xs ) : mechanisms = [ ] for element in xs . features [ ( NS_XMPP_SASL , 'mechanisms' ) ] . elements ( ) : if ( element . name == 'mechanism' ) : mechanisms . append ( str ( element ) ) return mechanisms
parse the sasl feature to extract the available mechanism names .