code: def shepards(
      image: pyvips.Image, couples: List[Couple]
  ) -> pyvips.Image:
      """Shepard's distortion.
  
      Distort an image with a set of control points.
      """
  
      index = pyvips.Image.xyz(image.width, image.height)
      deltas = []
      weights = []
      for p1, p2 in couples:
          diff = index - list(p2)
  
          distance = diff[0] ** 2 + diff[1] ** 2
          distance = distance.ifthenelse(distance, 0.1)
  
          weight = 1.0 / distance
  
          delta = [(p1[0] - p2[0]), (p1[1] - p2[1])] * weight
  
          weights.append(weight)
          deltas.append(delta)
  
      # add, normalize
      index += pyvips.Image.sum(deltas) / pyvips.Image.sum(weights)
  
      return image.mapim(
          index, interpolate=pyvips.Interpolate.new("bicubic")
      )
  
imports: import re
  import sys
  from typing import Tuple, List
  import pyvips
label_desc: Use image node_id 1 for calling a global function with example usage: shepards(image, couples) and returns: image