Sweep Line Algorithm Python Example