docstr: pre_transform raw fragments and save it into fragments
docstr_tok: ["pre_transform","raw","fragments","and","save","it","into","fragments"]
code: def _pre_transform_fragment(self, mod):
      """
      pre_transform raw fragments and save it into fragments
      """
      out_dir = osp.join(self.processed_dir, mod, "fragment")
      if files_exist([out_dir]):  # pragma: no cover
          return
      makedirs(out_dir)
      for scene_path in os.listdir(osp.join(self.raw_dir, mod)):
          # TODO list the right sequences.
          list_seq = [
              f
              for f in os.listdir(
                  osp.join(self.raw_dir, mod, scene_path)
              )
              if "seq" in f
          ]
          for seq in list_seq:
              in_dir = osp.join(
                  self.processed_dir,
                  mod,
                  "raw_fragment",
                  scene_path,
                  seq,
              )
              out_dir = osp.join(
                  self.processed_dir, mod, "fragment", scene_path, seq
              )
              makedirs(out_dir)
              list_fragment_path = sorted(
                  [f for f in os.listdir(in_dir) if "fragment" in f]
              )
              for path in list_fragment_path:
                  data = torch.load(osp.join(in_dir, path))
                  if self.pre_transform is not None:
                      data = self.pre_transform(data)
                  torch.save(data, osp.join(out_dir, path))
  
imports: import json
  import logging
  import numpy
  import os
  import os.path
  from plyfile import PlyData
  import shutil
  import torch
  from torch_geometric.data import Dataset, download_url, extract_zip
  from torch_geometric.data import Data
  from torch_points3d.datasets.registration.detector import RandomDetector
  from torch_points3d.datasets.registration.utils import rgbd2fragment_rough
  from torch_points3d.datasets.registration.utils import rgbd2fragment_fine
  from torch_points3d.datasets.registration.utils import compute_overlap_and_matches
  from torch_points3d.datasets.registration.utils import to_list
  from torch_points3d.datasets.registration.utils import files_exist
  from torch_points3d.datasets.registration.utils import makedirs
  from torch_points3d.datasets.registration.utils import get_urls
  from torch_points3d.datasets.registration.utils import PatchExtractor
label_desc: Use image node_id 6 for calling the Base3DMatch obj's underlying member method code with example usage: obj._pre_transform_fragment(mod) without return types