code: def get_most_available_stanza(self, peer_jid):
          
          presences = sorted(
              self.get_peer_resources(peer_jid).items(),
              key=lambda item: aioxmpp.structs.PresenceState.from_stanza(item[1])
          )
          if not presences:
              return None
          return presences[-1][1]
docs: Obtain the stanza describing the most-available presence of the
          contact.
  
          :param peer_jid: Bare JID of the contact.
          :type peer_jid: :class:`aioxmpp.JID`
          :rtype: :class:`aioxmpp.Presence` or :data:`None`
          :return: The presence stanza of the most available resource or
                   :data:`None` if there is no available resource.
  
          The "most available" resource is the one whose presence state orderest
          highest according to :class:`~aioxmpp.PresenceState`.
  
          If there is no available resource for a given `peer_jid`, :data:`None`
          is returned.