code: def get_random_segments(
      x: torch.Tensor,
      x_lengths: torch.Tensor,
      segment_size: int,
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Get random segments.
  
      Args:
          x (Tensor): Input tensor (B, C, T).
          x_lengths (Tensor): Length tensor (B,).
          segment_size (int): Segment size.
  
      Returns:
          Tensor: Segmented tensor (B, C, segment_size).
          Tensor: Start index tensor (B,).
  
      """
      b, c, t = x.size()
      max_start_idx = x_lengths - segment_size
      max_start_idx[max_start_idx < 0] = 0
      start_idxs = (torch.rand([b]).to(x.device) * max_start_idx).to(
          dtype=torch.long,
      )
      segments = get_segments(x, start_idxs, segment_size)
  
      return segments, start_idxs
  
label_desc: Use image node_id 1 for calling a global function with example usage: get_random_segments(x, x_lengths, segment_size) and returns: segments,  start_idxs