Importing graph methods from PIL