code: def test_candidate_safety_feedback(self):
      self.responses["generate_text"] = glm.GenerateTextResponse(
          candidates=[
              {
                  "output": "hello",
                  "safety_ratings": [
                      {
                          "category": safety_types.HarmCategory.HARM_CATEGORY_MEDICAL,
                          "probability": safety_types.HarmProbability.HIGH,
                      },
                      {
                          "category": safety_types.HarmCategory.HARM_CATEGORY_VIOLENCE,
                          "probability": safety_types.HarmProbability.LOW,
                      },
                  ],
              }
          ]
      )
  
      result = text_service.generate_text(
          prompt="Write a story from the ER."
      )
      self.assertIsInstance(
          result.candidates[0]["safety_ratings"][0]["category"],
          safety_types.HarmCategory,
      )
      self.assertEqual(
          result.candidates[0]["safety_ratings"][0]["category"],
          safety_types.HarmCategory.HARM_CATEGORY_MEDICAL,
      )
  
      self.assertIsInstance(
          result.candidates[0]["safety_ratings"][0]["probability"],
          safety_types.HarmProbability,
      )
      self.assertEqual(
          result.candidates[0]["safety_ratings"][0]["probability"],
          safety_types.HarmProbability.HIGH,
      )
  
imports: import copy
  import math
  import unittest
  import unittest.mock
  import google.ai.generativelanguage
  from google.generativeai import text
  from google.generativeai import client
  from google.generativeai.types import safety_types
  from google.generativeai.types import model_types
  from absl.testing import absltest
  from absl.testing import parameterized
label_desc: Use image node_id 11 for calling the UnitTests obj's underlying member method code with example usage: obj.test_candidate_safety_feedback() without return types