This function is copied from chromium's version.py. I think the naming should be following rules.