def token(token=core.UNSET):
    if token is None:
        return None
    elif token is core.UNSET:
        return Token.from_thread()
    elif type(token) != PyHANDLE:
        return Token(token)
    elif issubclass(token.__class__, Token):
        return token
    else:
        raise x_winsys("Token must be HANDLE, Token or None")
dataset/ETHPy150Open tjguk/winsys/winsys/_security/_tokens.py/token/operator `is` -> `!=`