def navigation_index(position):
 if (position is None):
  return None
 try:
  navigation_position = int(position.split('_', 1)[0])
 except (ValueError, TypeError):
  LOGGER.exception(u'Bad position %r passed to navigation_index, will assume first position', position)
  navigation_position = 1
 return navigation_position

def navigation_index ( position ) : if ( position is None ) : return None try : navigation_position = int ( position . split ( '_' , 1 ) [ 0 ] ) except ( ValueError , TypeError ) : LOGGER . exception ( u'Bad position %r passed to navigation_index, will assume first position' , position ) navigation_position = 1 return navigation_position
get the navigation index from the position argument argument: position - result of position returned from call to path_to_location .