code: def test_to_visdom(self, tboard):
      handler = imaging.imaging._to_visdom(
          "test",
          log_dir="./logs",
          comment="comment",
          visdom_params="test_params",
      )
      image = MagicMock()
      handler(image, 0, {torchbearer.EPOCH: 1})
      image.clamp.assert_called_once_with(0, 1)
      tboard.get_writer.assert_called_once_with(
          "./logs/comment",
          imaging.imaging._to_visdom,
          visdom=True,
          visdom_params="test_params",
      )
      tboard.get_writer().add_image.assert_called_once_with(
          "test_1", image.clamp(), 1
      )
      tboard.close_writer.assert_called_once_with(
          "./logs/comment", imaging.imaging._to_visdom
      )
  
imports: from unittest import TestCase
  from mock import MagicMock, patch, ANY
  import torch
  import torchbearer
  import torchbearer.callbacks.imaging
  import matplotlib.pyplot
label_desc: Use image node_id 4 for calling the TestHandlers obj's underlying member method code with example usage: obj.test_to_visdom(tboard) without return types