def METHOD_NAME(code: str) -> Tuple[str, Optional[JustfixUser]]:
    """
    Attempt to verify the given verification code and mark
    the user's account as having a verified email address.
    Returns a tuple containing the response code string and
    the relevant user object, if applicable.
    Note that if the user object is included, the verification
    can be considered a success.
    """
    try:
        payload = SigningPayload.deserialize(
            signing.loads(
                code,
                salt=VERIFICATION_SALT,
                max_age=MAX_VERIFICATION_DAYS * SECONDS_PER_DAY,
            )
        )
        if payload is None:
            return (VERIFY_MALFORMED_PAYLOAD, None)
        user = JustfixUser.objects.filter(username=payload.username).first()
        if user is None:
            return (VERIFY_INVALID_USERNAME, None)
        if not (user.email and user.email == payload.email):
            # Even though we have the user object, we don't want to return
            # it because the verification was not successful.
            return (VERIFY_EMAIL_MISMATCH, None)
        if user.is_email_verified:
            return (VERIFY_ALREADY_VERIFIED, user)
        user.is_email_verified = True
        user.save()
        return (VERIFY_OK, user)
    except signing.SignatureExpired:
        return (VERIFY_EXPIRED, None)
    except signing.BadSignature:
        return (VERIFY_INVALID_CODE, None)