def _ParseJid(self, jid):
    if set(jid).intersection(INVALID_JID_CHARACTERS):
      self.log('Invalid JID: characters "%s" not supported.  JID: %s',
               INVALID_JID_CHARACTERS,
               jid)
      raise apiproxy_errors.ApplicationError(
          xmpp_service_pb.XmppServiceError.INVALID_JID)

    node, domain, resource = ('', '', '')
    at = jid.find('@')
    if at == -1:
      self.log('Invalid JID: No \'@\' character found. JID: %s', jid)
      raise apiproxy_errors.ApplicationError(
          xmpp_service_pb.XmppServiceError.INVALID_JID)

    node = jid[:at]
    if not node:
      self.log('Invalid JID: No node. JID: %s', jid)
      raise apiproxy_errors.ApplicationError(
          xmpp_service_pb.XmppServiceError.INVALID_JID)

    rest = jid[at+1:]
    if rest.find('@') > -1:
      self.log('Invalid JID: Second \'@\' character found. JID: %s',
               jid)
      raise apiproxy_errors.ApplicationError(
          xmpp_service_pb.XmppServiceError.INVALID_JID)

    slash = rest.find('/')
    if slash == -1:
      domain = rest
      resource = 'bot'
    else:
      domain = rest[:slash]
      resource = rest[slash+1:]

    if resource.find('/') > -1:
      self.log('Invalid JID: Second \'/\' character found. JID: %s',
               jid)
      raise apiproxy_errors.ApplicationError(
          xmpp_service_pb.XmppServiceError.INVALID_JID)

    return node, domain, resource
Parse the given JID.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/xmpp/xmpp_service_stub.py/XmppServiceStub._ParseJid