Python port of Android's function