[python] clean duplicate lines