def METHOD_NAME(self) -> Dict[str, Dict[Tuple[str, int], Set[str]]]:
    addresses = set(self.get_addrs())
    results: Dict[str, Dict[Tuple[str, int], Set[str]]] = {}
    with subprocess.Popen(self.cmd_openports, stdout=subprocess.PIPE) as proc:
        assert proc.stdout is not None
        for line in proc.stdout:
            m = self.match_openports.search(line.decode())
            if m is None:
                continue
            md = m.groupdict()
            if {"tcp": "LISTEN", "udp": "UNCONN"}[md["proto"]] != md["state"]:
                utils.LOGGER.warning("Weird state %(state)s (proto %(proto)s)", md)
            for addr in addresses if md["addr"] == "0.0.0.0" else [md["addr"]]:
                progs = results.setdefault(addr, {}).setdefault(
                    (md["proto"], int(md["port"])), set()
                )
                if md["progname"] is not None:
                    progs.add(md["progname"])
        return results