code: def choose_algorithm(self, context, **kwargs):
          
          try:
              algorithm = kwargs["algorithm"]
          except KeyError:
              # different contexts uses different signing algorithms
              algorithm = DEF_SIGN_ALG[context]
          if not algorithm:
              raise AuthnFailure("Missing algorithm specification")
          return algorithm
docs: Pick signing algorithm
  
          :param context: Signing context
          :param kwargs: extra keyword arguments
          :return: Name of a signing algorithm