code: def test_add_custom_scalars(self) -> None:
      with TemporaryDirectory() as tmp_dir:
          writer = SummaryWriter(tmp_dir)
          writer.add_custom_scalars = MagicMock()
          with summary_writer_context(writer):
              SummaryWriterContext.add_custom_scalars_multilinechart(
                  ["a", "b"], category="cat", title="title"
              )
              with self.assertRaisesRegex(
                  AssertionError,
                  "Title \\(title\\) is already in category \\(cat\\)",
              ):
                  SummaryWriterContext.add_custom_scalars_multilinechart(
                      ["c", "d"], category="cat", title="title"
                  )
              SummaryWriterContext.add_custom_scalars_multilinechart(
                  ["e", "f"], category="cat", title="title2"
              )
              SummaryWriterContext.add_custom_scalars_multilinechart(
                  ["g", "h"], category="cat2", title="title"
              )
  
          SummaryWriterContext.add_custom_scalars(writer)
          writer.add_custom_scalars.assert_called_once_with(
              {
                  "cat": {
                      "title": ["Multiline", ["a", "b"]],
                      "title2": ["Multiline", ["e", "f"]],
                  },
                  "cat2": {"title": ["Multiline", ["g", "h"]]},
              }
          )
  
file_path: ReAgent/reagent/test/base/test_tensorboardX.py
imports: import unittest
  from tempfile import TemporaryDirectory
  from unittest.mock import call, MagicMock
  import torch
  from reagent.core.tensorboardX import summary_writer_context, SummaryWriterContext
  from reagent.test.base.horizon_test_base import HorizonTestBase
  from torch.utils.tensorboard import SummaryWriter
label_desc: Use image node_id 9 for calling the TestSummaryWriterContext obj's underlying member method code with example usage: obj.test_add_custom_scalars() without return types