code: def _wait_for_macaroon(wait_url):
      ''' Returns a macaroon from a legacy wait endpoint.
      '''
      headers = {
          BAKERY_PROTOCOL_HEADER: str(bakery.LATEST_VERSION)
      }
      resp = requests.get(url=wait_url, headers=headers)
      if resp.status_code != 200:
          raise InteractionError('cannot get {}'.format(wait_url))
  
      return bakery.Macaroon.from_dict(resp.json().get('Macaroon')f _wait_for_macaroon(wait_url):
      ''' Returns a macaroon from a legacy wait endpoint.
      '''
      headers = {
          BAKERY_PROTOCOL_HEADER: str(bakery.LATEST_VERSION)
      }
      resp = requests.get(url=wait_url, headers=headers)
      if resp.status_code != 200:
          raise InteractionError('cannot get {}'.format(wait_url))
  
      return bakery.Macaroon.from_dict(resp.json().get('Macaroon'))
docs: Returns a macaroon from a legacy wait endpoint.