code: def _process_response(response):
          
          if response.status_code == 404:
              raise Trovebox404Error("HTTP Error %d: %s" %
                                     (response.status_code, response.reason))
          try:
              json_response = response.json()
              code = json_response["code"]
              message = json_response["message"]
          except (ValueError, KeyError):
              # Response wasn't Trovebox JSON - check the HTTP status code
              if 200 <= response.status_code < 300:
                  # Status code was valid, so just reraise the exception
                  raise
              else:
                  raise TroveboxError("HTTP Error %d: %s" %
                                      (response.status_code, response.reason))
  
          if 200 <= code < 300:
              return json_response
          elif (code == DUPLICATE_RESPONSE["code"] and
                 DUPLICATE_RESPONSE["message"] in message):
              raise TroveboxDuplicateError("Code %d: %s" % (code, message))
          else:
              raise TroveboxError("Code %d: %s" % (code, message))
docs: Decodes the JSON response, returning a dict.
          Raises an exception if an invalid response code is received.