[python] Remove lines that contain certain string