def METHOD_NAME(*, username: str, realm: str, password: str, krb5ccname: str, timeout: Union[int, float]) -> KerberosAuthenticationResult:
    try:
        kinit = pexpect.spawn("/usr/bin/kinit", ["-c", krb5ccname, "{}@{}".format(username, realm)], timeout=timeout, encoding="utf-8")
        kinit.expect(":")
        kinit.sendline(password)
        returned = kinit.expect([pexpect.EOF, "password:"])
        if returned == 1:
            logger.debug("Password for %s@%s expired, needs reset", username, realm)
            return KerberosAuthenticationResult.EXPIRED
        kinit.close()
        return KerberosAuthenticationResult.SUCCESS if kinit.exitstatus == 0 else KerberosAuthenticationResult.FAILURE
    except pexpect.TIMEOUT:
        KerberosAuthenticationBackend.kinit_timeout_handle(username, realm)
        return KerberosAuthenticationResult.FAILURE