def parse_json(self, page, exactly_one=True):
        if not isinstance(page, basestring):
            page = decode_page(page)
        resources = json.loads(page)
        
        if exactly_one and len(resources) != 1:
            from warnings import warn
            warn("Didn't find exactly one resource!" + \
                "(Found %d.), use exactly_one=False\n" % len(resources)
            )
            
        def parse_resource(resource):
            location = resource['display_name']
            
            latitude = resource['lat'] or None
            longitude = resource['lon'] or None
            if latitude and longitude:
                latitude = float(latitude)
                longitude = float(longitude)
            
            return (location, (latitude, longitude))
        
        if exactly_one:
            return parse_resource(resources[0])
        else:
            return [parse_resource(resource) for resource in resources]
L{util.addPluginDir} is deprecated.
dataset/ETHPy150Open sahana/eden/modules/geopy/geocoders/openmapquest.py/OpenMapQuest.parse_json--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/python/test/test_util.py/DeprecationTests.test_addPluginDir