def censys_ipv4_meta_extraction(raw: dict) -> dict:
    """
    Extracts metadata from Censys IPv4 dicts
    :param raw: Censys IPv4 dict
    :return: Metadata part of common format dict
    """
    _as = raw.get("autonomous_system", None) or dict()
    return {
        "ip": raw["ip"],  # Program should fail if IP is not given
        "as": {
            "number": _as.get("asn", None),
            "name": _as.get("name", None),
            "location": _as.get("country_code", None),
            "prefix": _as.get("routed_prefix", None),
        },
    }