code: def get_weights(interp_method, projected_grid, field_of_view):
      # the set of weights per each output pixels is the result of the chosen
      # interpolation method applied to the distances between projected grid
      # locations and the pixel-centers in the field of view (distances are
      # directed, can be positive or negative)
      weights = interp_method(projected_grid[:, None] - field_of_view)
  
      # we now carefully normalize the weights to sum to 1 per each output pixel
      sum_weights = weights.sum(1, keepdim=True)
      sum_weights[sum_weights == 0] = 1
      return weights / sum_weights
  
imports: import warnings
  from fractions import Fraction
  from math import ceil
  from typing import Tuple
  import disco_diffusion_clip_rn50.resize_right.interp_methods
label_desc: Use image node_id 5 for calling a global function with example usage: get_weights(interp_method, projected_grid, field_of_view) and returns: unknown