Python Check If Index Exists