code: def composite(
      background_image,
      foreground_image,
      foreground_width_ratio=0.25,
      foreground_position=(0.0, 0.0),
  ):
      """Takes two images and composites them."""
  
      if foreground_width_ratio <= 0:
          return background_image
  
      composite = background_image.copy()
      width = int(foreground_width_ratio * background_image.shape[1])
      foreground_resized = resize(foreground_image, width)
      size = foreground_resized.shape
  
      x = int(
          foreground_position[1] * (background_image.shape[1] - size[1])
      )
      y = int(
          foreground_position[0] * (background_image.shape[0] - size[0])
      )
  
      # TODO: warn if resulting coordinates are out of bounds?
      composite[y : y + size[0], x : x + size[1]] = foreground_resized
  
      return composite
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from scipy import ndimage
label_desc: Use image node_id 2 for calling a global function with example usage: composite(background_image, foreground_image, foreground_width_ratio, foreground_position) and returns: composite, background_image