class_docstr: Crop the given PIL Image to random size and aspect ratio with random interpolation.
  
  A crop of random size (default: of 0.08 to 1.0) of the original size and a random
  aspect ratio (default: of 3/4 to 4/3) of the original aspect ratio is made. This crop
  is finally resized to given size.
  This is popularly used to train the Inception networks.
  
  Args:
      size: expected output size of each edge
      scale: range of size of the origin size cropped
      ratio: range of aspect ratio of the origin aspect ratio cropped
      interpolation: Default: PIL.Image.BILINEAR
class_docstr_tok: ["Crop","the","given","PIL","Image","to","random","size","and","aspect","ratio","with","random","interpolation",".","A","crop","of","random","size","(","default",":","of","0.08","to","1.0",")","of","the","original","size","and","a","random","aspect","ratio","(","default",":","of","3\/4","to","4\/3",")","of","the","original","aspect","ratio","is","made",".","This","crop","is","finally","resized","to","given","size",".","This","is","popularly","used","to","train","the","Inception","networks",".","Args",":","size",":","expected","output","size","of","each","edge","scale",":","range","of","size","of","the","origin","size","cropped","ratio",":","range","of","aspect","ratio","of","the","origin","aspect","ratio","cropped","interpolation",":","Default",":","PIL.Image.BILINEAR"]
docstr: Get parameters for ``crop`` for a random sized crop.
  
  Args:
      img (PIL Image): Image to be cropped.
      scale (tuple): range of size of the origin size cropped
      ratio (tuple): range of aspect ratio of the origin aspect ratio cropped
  
  Returns:
      tuple: params (i, j, h, w) to be passed to ``crop`` for a random
          sized crop.
docstr_tok: ["Get","parameters","for","``","crop","``","for","a","random","sized","crop",".","Args",":","img","(","PIL","Image",")",":","Image","to","be","cropped",".","scale","(","tuple",")",":","range","of","size","of","the","origin","size","cropped","ratio","(","tuple",")",":","range","of","aspect","ratio","of","the","origin","aspect","ratio","cropped","Returns",":","tuple",":","params","(","i",",","j",",","h",",","w",")","to","be","passed","to","``","crop","``","for","a","random","sized","crop","."]
code: def get_params(img, scale, ratio):
      """Get parameters for ``crop`` for a random sized crop.
  
      Args:
          img (PIL Image): Image to be cropped.
          scale (tuple): range of size of the origin size cropped
          ratio (tuple): range of aspect ratio of the origin aspect ratio cropped
  
      Returns:
          tuple: params (i, j, h, w) to be passed to ``crop`` for a random
              sized crop.
      """
      area = img.size[0] * img.size[1]
  
      for attempt in range(10):
          target_area = random.uniform(*scale) * area
          log_ratio = (math.log(ratio[0]), math.log(ratio[1]))
          aspect_ratio = math.exp(random.uniform(*log_ratio))
  
          w = int(round(math.sqrt(target_area * aspect_ratio)))
          h = int(round(math.sqrt(target_area / aspect_ratio)))
  
          if w <= img.size[0] and h <= img.size[1]:
              i = random.randint(0, img.size[1] - h)
              j = random.randint(0, img.size[0] - w)
              return i, j, h, w
  
      # Fallback to central crop
      in_ratio = img.size[0] / img.size[1]
      if in_ratio < min(ratio):
          w = img.size[0]
          h = int(round(w / min(ratio)))
      elif in_ratio > max(ratio):
          h = img.size[1]
          w = int(round(h * max(ratio)))
      else:  # whole image
          w = img.size[0]
          h = img.size[1]
      i = (img.size[1] - h) // 2
      j = (img.size[0] - w) // 2
      return i, j, h, w
  
imports: from functools import partial
  import logging
  import math
  import random
  import time
  import numpy
  import os
  import torch
  from torchvision import datasets, transforms
  from .path_dataset import PathDataset
  from fairseq.data import FairseqDataset
  from fairseq.data.data_utils import compute_block_mask_1d, compute_block_mask_2d
  from shutil import copyfile
label_desc: Use image node_id 3 for calling the RandomResizedCropAndInterpolationWithTwoPic obj's underlying member method code with example usage: obj.get_params(img, scale, ratio) and returns: i,  j,  h,  w, i,  j,  h,  w