def geocodeFromExternalAndWriteToCache(query, providerId, countryCode=None, acceptableTypes=None, biasCoord=None, retry=2): results = geocodeFromExternal(query, providerId, countryCode, acceptableTypes, retry) if results is not None: writeGeocodeResultToCache(query, countryCode, acceptableTypes, results) return processGeocodeResults(results, biasCoord) else: return None
def func(query): query = ' '.join(query) results = _geocodeFromCache(query, providerId, countryCode, acceptableTypes, inMemoryOnly, False) if results is not None: result = processGeocodeResults(results, biasCoord) stop = StopIteration() stop.my_result = result raise stop