code: def _compute_aspect_ratios_voc_dataset(dataset, indices=None):
      if indices is None:
          indices = range(len(dataset))
      aspect_ratios = []
      for i in indices:
          # this doesn't load the data into memory, because PIL loads it lazily
          width, height = Image.open(dataset.images[i]).size
          aspect_ratio = float(width) / float(height)
          aspect_ratios.append(aspect_ratio)
      return aspect_ratios
  
imports: import bisect
  import copy
  import math
  from collections import defaultdict
  from itertools import repeat, chain
  import numpy
  import torch
  import torch.utils.data
  import torchvision
  from PIL import Image
  from torch.utils.data.sampler import BatchSampler, Sampler
  from torch.utils.model_zoo import tqdm
label_desc: Use image node_id 5 for calling a global function with example usage: _compute_aspect_ratios_voc_dataset(dataset, indices) and returns: aspect_ratios