code: def register_algorithm(self, alg_id, alg_obj):
          
          if alg_id in self._algorithms:
              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)
docs: Registers a new Algorithm for use when creating and verifying tokens.