code: def test_pointcloud_segmentation_data(tmpdir):
      seed_everything(52)
  
      download_data(
          "https://pl-flash-data.s3.amazonaws.com/SemanticKittiMicro.zip",
          tmpdir,
      )
  
      datamodule = PointCloudSegmentationData.from_folders(
          train_folder=join(tmpdir, "SemanticKittiMicro", "train"),
          predict_folder=join(tmpdir, "SemanticKittiMicro", "predict"),
          batch_size=4,
      )
  
      class MockModel(PointCloudSegmentation):
          def training_step(self, batch, batch_idx: int):
              assert batch[DataKeys.INPUT]["xyz"][
                  0
              ].shape == torch.Size([2, 45056, 3])
              assert batch[DataKeys.INPUT]["xyz"][
                  1
              ].shape == torch.Size([2, 11264, 3])
              assert batch[DataKeys.INPUT]["xyz"][
                  2
              ].shape == torch.Size([2, 2816, 3])
              assert batch[DataKeys.INPUT]["xyz"][
                  3
              ].shape == torch.Size([2, 704, 3])
              assert batch[DataKeys.INPUT][
                  "labels"
              ].shape == torch.Size([2, 45056])
              assert batch[DataKeys.INPUT]["labels"].max() == 19
              assert batch[DataKeys.INPUT]["labels"].min() == 0
              assert batch[DataKeys.METADATA][0]["name"] in (
                  "00_000000",
                  "00_000001",
              )
              assert batch[DataKeys.METADATA][1]["name"] in (
                  "00_000000",
                  "00_000001",
              )
  
      num_classes = 19
      model = MockModel(backbone="randlanet", num_classes=num_classes)
      trainer = Trainer(
          max_epochs=1, limit_train_batches=1, limit_val_batches=0
      )
      trainer.fit(model, datamodule=datamodule)
  
      predictions = trainer.predict(model, datamodule=datamodule)[0]
      assert predictions[0][DataKeys.INPUT].shape == torch.Size(
          [45056, 3]
      )
      assert predictions[0][DataKeys.PREDS].shape == torch.Size(
          [45056, 19]
      )
      assert predictions[0][DataKeys.TARGET].shape == torch.Size(
          [45056]
      )
  
file_path: lightning-flash/tests/pointcloud/segmentation/test_data.py
imports: from os.path import join
  import pytest
  import torch
  from flash import Trainer
  from flash.core.data.io.input import DataKeys
  from flash.core.data.utils import download_data
  from flash.core.utilities.imports import _TOPIC_POINTCLOUD_AVAILABLE
  from flash.pointcloud.segmentation import PointCloudSegmentation, PointCloudSegmentationData
  from pytorch_lightning import seed_everything
label_desc: Use image node_id 1 for calling a global function with example usage: test_pointcloud_segmentation_data(tmpdir) without return types