Python connected region