def challb_to_achall(challb, account_key, domain):
 chall = challb.chall
 logger.info('%s challenge for %s', chall.typ, domain)
 if isinstance(chall, challenges.KeyAuthorizationChallenge):
  return achallenges.KeyAuthorizationAnnotatedChallenge(challb=challb, domain=domain, account_key=account_key)
 elif isinstance(chall, challenges.DNS):
  return achallenges.DNS(challb=challb, domain=domain)
 else:
  raise errors.Error('Received unsupported challenge of type: %s', chall.typ)

def challb_to_achall ( challb , account_key , domain ) : chall = challb . chall logger . info ( '%s challenge for %s' , chall . typ , domain ) if isinstance ( chall , challenges . KeyAuthorizationChallenge ) : return achallenges . KeyAuthorizationAnnotatedChallenge ( challb = challb , domain = domain , account_key = account_key ) elif isinstance ( chall , challenges . DNS ) : return achallenges . DNS ( challb = challb , domain = domain ) else : raise errors . Error ( 'Received unsupported challenge of type: %s' , chall . typ )
converts a challengebody object to an annotatedchallenge .