def _extract_json(response):
  """Extract JSON from Azkaban response, gracefully handling errors.

  :param response: Request response object.

  """
  try:
    json = response.json()
  except ValueError as err: # this should never happen
    _logger.error('No JSON decoded from response:\n%s', response.text)
    raise err
  else:
    if json in 'error':
      raise AzkabanError(json['error'])
    elif json.get('status') == 'error':
      raise AzkabanError(json['message'])
    else:
      return json
dataset/ETHPy150Open mtth/azkaban/azkaban/remote.py/_extract_json/swapped operands of `in`