code: def __GetAuthorizationTokenUsingMasterKey(verb,
                                           resource_id_or_fullname,
                                           resource_type,
                                           headers,
                                           master_key):
      
  
  
      # decodes the master key which is encoded in base64    
      key = base64.b64decode(master_key)
      
      # Skipping lower casing of resource_id_or_fullname since it may now contain "ID" of the resource as part of the fullname
      text = '{verb}\n{resource_type}\n{resource_id_or_fullname}\n{x_date}\n{http_date}\n'.format(
          verb=(verb.lower() or ''),
          resource_type=(resource_type.lower() or ''),
          resource_id_or_fullname=(resource_id_or_fullname or ''),
          x_date=headers.get(http_constants.HttpHeaders.XDate, '').lower(),
          http_date=headers.get(http_constants.HttpHeaders.HttpDate, '').lower())
     
      if six.PY2:
          body = text.decode('utf-8')
          digest = hmac.new(key, body, sha256).digest()
          signature = digest.encode('base64')
      else:
          # python 3 support
          body = text.encode('utf-8')
          digest = hmac.new(key, body, sha256).digest()
          signature = base64.encodebytes(digest).decode('utf-8')
  
      master_token = 'master'
      token_version = '1.0'
      return  'type={type}&ver={ver}&sig={sig}'.format(type=master_token,
                                                      ver=token_version,
                                                      sig=signature[:-1])
docs: Gets the authorization token using `master_key.
  
      :param str verb:
      :param str resource_id_or_fullname:
      :param str resource_type:
      :param dict headers:
      :param str master_key:
  
      :return:
          The authorization token.
      :rtype: dict