@staticmethod<EOL><INDENT>def parse_response(resp):<DEDENT>
if resp.status_code in [<NUM_LIT:200>, <NUM_LIT>, <NUM_LIT>]:<EOL><INDENT>return resp.json()<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>return None<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.BadRequestError(resp.text)<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.UnauthorizedError(resp.text)<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.ForbiddenError(resp.text)<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.NotFoundError(resp.text)<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.TooManyRequestsError(resp.text)<EOL><DEDENT>elif resp.status_code == <NUM_LIT>:<EOL><INDENT>raise error.ServiceUnavailableError(resp.text)<EOL><DEDENT>else:<EOL><INDENT>raise error.OptimizelyError(resp.text)<EOL><DEDENT>
Method to parse response from the Optimizely API and
        return results as JSON. Errors are thrown for various
        errors that the API can throw.