code: def test_indices(self):
      mock_data = Data()
      mock_data.pos = torch.zeros((batch_size, num_points, 3))
      mock_data.y = torch.zeros((batch_size, num_points, 1))
      mock_data.pred = torch.zeros((batch_size, num_points, 1))
      data = {"mock_date": mock_data}
  
      self.run_path = os.path.join(DIR, "test_viz")
      if not os.path.exists(self.run_path):
          os.makedirs(self.run_path)
  
      mock_num_batches = {"train": 9, "test": 3, "val": 0}
      config = OmegaConf.load(
          os.path.join(DIR, "test_config/viz/viz_config_indices.yaml")
      )
      visualizer = Visualizer(
          config.visualization,
          mock_num_batches,
          batch_size,
          self.run_path,
          None,
      )
  
      for epoch in range(epochs):
          run(9, visualizer, epoch, "train", data)
          run(3, visualizer, epoch, "test", data)
          run(0, visualizer, epoch, "val", data)
  
      targets = {"train": set(["1_1", "0_0"]), "test": set(["0_0"])}
      for split in ["train", "test"]:
          for epoch in range(epochs):
              for format in ["ply", "las"]:
                  files = os.listdir(
                      os.path.join(
                          self.run_path,
                          "viz",
                          str(epoch),
                          split,
                          format,
                      )
                  )
                  files = [
                      os.path.splitext(filename)[0]
                      for filename in files
                  ]
  
                  target = targets[split]
                  target = [
                      "%d_%s" % (epoch, f) for f in target
                  ]  # append current epoch to start of target
                  if format == "las":
                      target_gt = [
                          "%s_gt" % (x) for x in target
                      ]  # add gt files for las
                      target += target_gt
  
                  self.assertEqual(set(target), set(files))
      shutil.rmtree(self.run_path)
  
file_path: torch-points3d/test/test_visualization.py
imports: import unittest
  import os
  import shutil
  import sys
  from omegaconf import OmegaConf
  import torch
  from torch_geometric.data import Data
  from torch_points3d.visualization import Visualizer
label_desc: Use image node_id 2 for calling the TestVisualizer obj's underlying member method code with example usage: obj.test_indices() without return types