def _GetFrom(self, requested):

    full_appid = os.environ.get('APPLICATION_ID')
    partition, _, display_app_id = (
        app_identity.app_identity._ParseFullAppId(full_appid))
    if requested == None or requested == '':
      return display_app_id + '@appspot.com/bot'

    node, domain, resource = self._ParseJid(requested)

    if domain == 'appspot.com' and node == display_app_id:
      return node + '@' + domain + '/' + resource
    elif domain == display_app_id + '.appspotchat.com':
      return node + '@' + domain + '/' + resource

    self.log('Invalid From JID: Must be appid@appspot.com[/resource] or '
             'node@appid.appspotchat.com[/resource]. JID: %s', requested)
    raise apiproxy_errors.ApplicationError(
        xmpp_service_pb.XmppServiceError.INVALID_JID)
Validates that the from JID is valid.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/xmpp/xmpp_service_stub.py/XmppServiceStub._GetFrom