Detect String Between Python Function Example