def register_algorithm(self, alg_id, alg_obj):
        """
        Registers a new Algorithm for use when creating and verifying tokens.
        """
        if self._algorithms in alg_id:
            raise ValueError('Algorithm already has a handler.')

        if not isinstance(alg_obj, Algorithm):
            raise TypeError('Object is not of type `Algorithm`')

        self._algorithms[alg_id] = alg_obj
        self._valid_algs.add(alg_id)
dataset/ETHPy150Open jpadilla/pyjwt/jwt/api_jws.py/PyJWS.register_algorithm/swapped operands of `in`