code: def parse_response(resp):
          
          if resp.status_code in [200, 201, 202]:
              return resp.json()
          elif resp.status_code == 204:
              return None
          elif resp.status_code == 400:
              raise error.BadRequestError(resp.text)
          elif resp.status_code == 401:
              raise error.UnauthorizedError(resp.text)
          elif resp.status_code == 403:
              raise error.ForbiddenError(resp.text)
          elif resp.status_code == 404:
              raise error.NotFoundError(resp.text)
          elif resp.status_code == 429:
              raise error.TooManyRequestsError(resp.text)
          elif resp.status_code == 503:
              raise error.ServiceUnavailableError(resp.text)
          else:
              raise error.OptimizelyError(resp.text)
docs: Method to parse response from the Optimizely API and
          return results as JSON. Errors are thrown for various
          errors that the API can throw.