def METHOD_NAME(self, text):
    assert self.client is not None
    analyze_request = {
        "comment": {"text": text},
        "requestedAttributes": {"TOXICITY": {}},
    }
    response = None
    try:
        time.sleep(1)  # sleep one second before call
        response = self.client.comments().analyze(body=analyze_request).execute()
    except Exception as e:
        i = 1
        error = str(e)
        while "Quota exceeded" in error and i <= MAX_ATTEMPTS:
            try:
                logging.warning(
                    f"Rate limited; sleeping 5 seconds and trying again (attempt {i} / {MAX_ATTEMPTS})"
                )
                time.sleep(5)  # Try requests at a slower rate
                response = (
                    self.client.comments().analyze(body=analyze_request).execute()
                )
                error = ""
                logging.success("Successfully queried Perspective API")
            except Exception as e:
                error = str(e)
            i += 1
        if response is None:
            logging.error("Perspective API hit error; did not retrieve response")
            return -1
    return response["attributeScores"]["TOXICITY"]["summaryScore"]["value"]