Python code to compute the GEO metric