(self, username, password,
                                      tenant_id=None)
return self._new_session(username=username,
                                 tenant_id=tenant_id)
Create or return a :obj:`Session` based on a user's credentials.
Create or return a :obj:`Session` based on a user's credentials.
Create or return a : obj : Session based on a user s credentials .
def session_for_username_password(self, username, password,
                                      tenant_id=None):
        """
        Create or return a :obj:`Session` based on a user's credentials.
        """
        if username in self._username_to_token:
            s = self._token_to_session[self._username_to_token[username]]
            self._assert_tenant_matches(s, tenant_id)
            return s

        if tenant_id and tenant_id in self._tenant_to_session:
            return self._tenant_to_session[tenant_id]

        return self._new_session(username=username,
                                 tenant_id=tenant_id)
def session_for_username_password ( self , username , password , tenant_id = None ) : if username in self . _username_to_token : s = self . _token_to_session [ self . _username_to_token [ username ] ] self . _assert_tenant_matches ( s , tenant_id ) return s if tenant_id and tenant_id in self . _tenant_to_session : return self . _tenant_to_session [ tenant_id ] return self . _new_session ( username = username , tenant_id = tenant_id )