class_docstr: Test Case to generate pdf report
class_docstr_tok: ["Test","Case","to","generate","pdf","report"]
code: def test_add_model_evaluation(self):
      self.name = "model-evaluation"
      self.report_name = "Model Evaluation Report"
      self.page_number = 2
      ## Create Report
      self.report = Report(name=self.report_name)
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Confusion Matrix")
      self.assertEqual(len(self.report.detail.contents), 1)
  
      # ### Confusion Matrix
      # with open(prepare_input_path(
      #                 data_path='sample_data/binary_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      # splits = eval_result.keys()
      # confusion_matrix_list = []
      #
      # for split in splits:
      #     label_eval_result = eval_result[split]
      #     confusion_matrix_list.append((split,
      #                                   {"labels": ["Negative", "Positive"],
      #                                    "values": label_eval_result["CM"]}))
      # print(confusion_matrix_list)
      #
      # self.report.detail.add_confusion_matrix_results(
      # confusion_matrix_list)
      # self.assertEqual(len(self.report.detail.contents), 2)
  
      ### Create Data Evaluation Section
      self.report.detail.add_new_page()
      self.report.detail.add_section_title(
          "Example for Data Evaluation "
      )
      ### Add Header Level 1
      self.report.detail.add_header_level_1(
          text="Multi-class Classification Evaluation Analysis"
      )
      self.assertEqual(len(self.report.detail.contents), 4)
  
      # with open(prepare_input_path(
      #                 data_path='sample_data/multi_evaluation_results.json'), 'r') as f:
      #     eval_result = json.load(f)
      #
      # label_key = 'label_1'
      # label_eval_result = eval_result[label_key]
      # vis_result = label_eval_result['vis_result']
      # del (label_eval_result['vis_result'])
      #
      # ### Add Header Level 2
      # report.detail.add_header_level_2(text='Confidence Distribution')
      # ###  Probability Plot
      # for class_name, class_value in vis_result.items():
      #     print('Class:', class_name)
      #     for key, value in class_value.items():
      #         print(' - %s:' % key, type(value), value[:4])
      #
      # self.report.detail.add_multi_class_confidence_distribution([('',
      # vis_result)])
      # self.assertEqual(len(self.report.detail.contents), 2)
  
      ### Add Header Level 2
      self.report.detail.add_header_level_2(text="Confusion Matrix")
      self.assertEqual(len(self.report.detail.contents), 5)
  
imports: import json
  import os
  import sys
  import unittest
  from pathlib import Path
  import warnings
  import numpy
  import pandas
  from PyPDF2 import PdfFileReader
  from datetime import datetime
  from xai.data import DataUtil
  from xai.data.constants import DATATYPE
  from xai.model.interpreter import FeatureInterpreter
  from xai.formatter import Report, PdfWriter
  from tests.formatter.util import prepare_input_path, prepare_output_path
label_desc: Use image node_id 8 for calling the TestGeneratePdfReport obj's underlying member method code with example usage: obj.test_add_model_evaluation() without return types