class_docstr: A class for sampling training batches with a controlled composition
  of sequences.
class_docstr_tok: ["A","class","for","sampling","training","batches","with","a","controlled","composition","of","sequences","."]
code: def _split_to_segments(
      self, sequence_timestamps: Iterable[Tuple[float, int, int]]
  ) -> List[List[int]]:
      if (
          self.consecutive_frames_max_gap <= 0
          and self.consecutive_frames_max_gap_seconds <= 0.0
      ):
          raise AssertionError(
              "This function is only needed for non-trivial max_gap"
          )
  
      segments = []
      last_no = (
          -self.consecutive_frames_max_gap - 1
      )  # will trigger a new segment
      last_ts = -self.consecutive_frames_max_gap_seconds - 1.0
      for ts, no, idx in sequence_timestamps:
          if ts <= 0.0 and no <= last_no:
              raise AssertionError(
                  "Sequence frames are not ordered while timestamps are not given"
              )
  
          if (
              no - last_no > self.consecutive_frames_max_gap > 0
              or ts - last_ts
              > self.consecutive_frames_max_gap_seconds
              > 0.0
          ):  # new group
              segments.append([idx])
          else:
              segments[-1].append(idx)
  
          last_no = no
          last_ts = ts
  
      return segments
  
file_path: pytorch3d/pytorch3d/implicitron/dataset/scene_batch_sampler.py
imports: import warnings
  from collections import Counter
  from dataclasses import dataclass, field
  from typing import Dict, Iterable, Iterator, List, Sequence, Tuple
  import numpy
  from torch.utils.data.sampler import Sampler
  from .dataset_base import DatasetBase
label_desc: Use image node_id 6 for calling the SceneBatchSampler obj's underlying member method code with example usage: obj._split_to_segments(sequence_timestamps) and returns: segments