code: def __getitem__(self, index):
      index = index % self.total_frames
      # we want bisect_right here so that the first frame in a file gets the
      # file, not the previous file
      next_file_index = bisect.bisect_right(self.start_index, index)
      if self.start_index[next_file_index] < index + self.frames:
          index = self.start_index[next_file_index] - self.frames - 1
  
      for i, file_idx in enumerate(range(index, index + self.frames)):
          image = io.imread(self.files[file_idx])
  
          # TODO(jbarker): Tidy this up and remove redundant computation
          if i == 0 and self.is_cropped:
              crop_x = random.randint(
                  0, self.image_shape[1] - self.frame_size[1]
              )
              crop_y = random.randint(
                  0, self.image_shape[0] - self.frame_size[0]
              )
          elif self.is_cropped == False:
              crop_x = math.floor(
                  (self.image_shape[1] - self.frame_size[1]) / 2
              )
              crop_y = math.floor(
                  (self.image_shape[0] - self.frame_size[0]) / 2
              )
              self.crop_size = self.frame_size
  
          image = image[
              crop_y : crop_y + self.crop_size[0],
              crop_x : crop_x + self.crop_size[1],
              :,
          ]
  
          self.frame_buffer[:, i, :, :] = np.rollaxis(image, 2, 0)
  
      return torch.from_numpy(self.frame_buffer)
  
file_path: DALI/docs/examples/use_cases/video_superres/dataloading/datasets.py
imports: import copy
  import sys, time, argparse, os, subprocess, shutil
  import math, numbers, random, bisect
  from random import Random
  from skimage import io, transform
  from os import listdir
  from os.path import join
  from glob import glob
  import numpy
  import torch
  import torch.utils.data
label_desc: Use image node_id 3 for calling the imageDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: torch