def METHOD_NAME(self, ip):
    """
    Get the range of the given ip and
    cache the asn of the whole ip range
    """
    try:
        # Cache the range of this ip
        whois_info = ipwhois.IPWhois(address=ip).lookup_rdap()
        asnorg = whois_info.get('asn_description', False)
        asn_cidr = whois_info.get('asn_cidr', False)
        asn_number = whois_info.get('asn', False)
        if asnorg and asn_cidr not in ('', 'NA'):
            self.db.set_asn_cache(asnorg, asn_cidr, asn_number)
            asn_info = {
                'asn': {
                    'number': f'AS{asn_number}',
                    'org': asnorg
                }
            }
            return asn_info
    except (
        ipwhois.exceptions.IPDefinedError,
        ipwhois.exceptions.HTTPLookupError,
    ):
        # private ip or RDAP lookup failed. don't cache
        return False
    except ipwhois.exceptions.ASNRegistryError:
        # ASN lookup failed with no more methods to try
        pass