(self, username, expires_in, impersonator_token=None,
                                  impersonated_token=None)
return session
Create or return a :obj:`Session` impersonating a given user; this
        session updates the expiration to be that indicated.
Create or return a :obj:`Session` impersonating a given user; this
        session updates the expiration to be that indicated.
Create or return a : obj : Session impersonating a given user ; this session updates the expiration to be that indicated .
def session_for_impersonation(self, username, expires_in, impersonator_token=None,
                                  impersonated_token=None):
        """
        Create or return a :obj:`Session` impersonating a given user; this
        session updates the expiration to be that indicated.
        """
        impersonator_session = self._token_to_session.get(impersonator_token)
        session = self.session_for_username_password(
            username, "lucky we don't check passwords, isn't it"
        )
        session.expires = datetime.utcfromtimestamp(self.clock.seconds() + expires_in)
        session.impersonator_session_map[impersonated_token] = impersonator_session
        self._token_to_session[impersonated_token] = session
        return session
def session_for_impersonation ( self , username , expires_in , impersonator_token = None , impersonated_token = None ) : impersonator_session = self . _token_to_session . get ( impersonator_token ) session = self . session_for_username_password ( username , "lucky we don't check passwords, isn't it" ) session . expires = datetime . utcfromtimestamp ( self . clock . seconds ( ) + expires_in ) session . impersonator_session_map [ impersonated_token ] = impersonator_session self . _token_to_session [ impersonated_token ] = session return session