Convert perl usage to python
am: 3271186bc8

Change-Id: Ied695136a66a34afdff7539ea3c2617ec80a8428