That looks like a helper function to load an image using the PIL library, and return it as a RGB image. Note that you will need from PIL import Image somewhere above this code for the function to work.