Using graphs inside Python