def METHOD_NAME(session=None):
    """
    Check whether a given session, or the current session if left blank, is logged in to Pavlovia.
    Returns:
        status : bool
            True if logged in after process is completed, False otherwise.
    """
    if session is None:
        # Substitute default session
        session = pavlovia.getCurrentSession()
    if session and session.user:
        # If logged in, return positive
        return True
    else:
        # If not logged in, prompt to login
        dlg = wx.MessageDialog(None, message=_translate(
            "You are not logged in to Pavlovia. Please log in to continue."
        ), style=wx.ICON_AUTH_NEEDED | wx.OK | wx.CANCEL)
        dlg.SetOKLabel(_translate("Login..."))
        if dlg.ShowModal() == wx.ID_OK:
            # If they click Login, open login screen
            user = logInPavlovia(None)
            # Return positive or negative based on whether login succeeded
            return bool(user)
        else:
            # If they cancel out of login prompt, return negative
            return False