def _parse_exchange_token_response(content):
 resp = {}
 try:
  resp = json.loads(content.decode('utf-8'))
 except Exception:
  content = content.decode('utf-8')
  resp = dict(urllib.parse.parse_qsl(content))
 if (resp and ('expires' in resp)):
  resp['expires_in'] = resp.pop('expires')
 return resp

def _parse_exchange_token_response ( content ) : resp = { } try : resp = json . loads ( content . decode ( 'utf-8' ) ) except Exception : content = content . decode ( 'utf-8' ) resp = dict ( urllib . parse . parse_qsl ( content ) ) if ( resp and ( 'expires' in resp ) ) : resp [ 'expires_in' ] = resp . pop ( 'expires' ) return resp
parses response of an exchange token request .