def geocode(self, address, restriction):
        try:
            locs = self._geocode(address, restriction)
            rlocs = self._geocode(restriction)
            if locs:
                if rlocs:
                    restriction_latlon = rlocs[0][1]
                    locs.sort(key=lambda loc: distance_func(loc[1], restriction_latlon))

                description, (lat, lon) = locs[0]
                query = self.get_format_string(restriction) % address

                return description, (lat, lon), query
        except __HOLE__:
            return None
        except Exception as e:
            raise
        return None
dataset/ETHPy150Open sirrice/dbtruck/dbtruck/analyze/geocode.py/DBTruckGeocoder.geocode