code: def crop(img, size):
      """resize the images.
  
      Args:
        img: a pillow image
        size: the size of the image (both x & y)
  
      Returns:
        nothing
      """
      small_side = min(img.size)
      center = img.size[0] / 2
      margin_left = center - small_side / 2
      margin_right = margin_left + small_side
      img = img.crop((margin_left, 0, margin_right, small_side))
      img = img.resize((size, size), Image.ANTIALIAS)
      return img
  
file_path: magenta/magenta/video/tools/extract_frames.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import glob
  import os
  import sys
  from PIL import Image
  import six
  import skvideo.io
label_desc: Use image node_id 1 for calling a global function with example usage: crop(img, size) and returns: img