def geocode(self, query, exactly_one=True, timeout=None):
        params = {'text': query, 'f': 'json'}
        if exactly_one is True:
            params['maxLocations'] = 1
        url = "?".join((self.api, urlencode(params)))
        logger.debug("%s.geocode: %s", self.__class__.__name__, url)
        response = self._call_geocoder(url, timeout=timeout)

        # Handle any errors; recursing in the case of an expired token.
        if 'error' in response:
            if response['error']['code'] == self._TOKEN_EXPIRED:
                self.retry += 1
                self._refresh_authentication_token()
                return self.geocode(
                    query, exactly_one=exactly_one, timeout=timeout
                )
            raise GeocoderServiceError(str(response['error']))

        # Success; convert from the ArcGIS JSON format.
        if not len(response['locations']):
            return None
        geocoded = []
        for resource in response['locations']:
            geometry = resource['feature']['geometry']
            geocoded.append(
                Location(
                    resource['name'], (geometry['y'], geometry['x']), resource
                )
            )
        if exactly_one is True:
            return geocoded[0]
        return geocoded
Compare two ISO formatted timestamps, with a special case when cached_time
dataset/ETHPy150Open geopy/geopy/geopy/geocoders/arcgis.py/ArcGIS.geocode--crossover with--dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/synapseclient/cache.py/compare_timestamps