Get String Index Python Function Definition