def METHOD_NAME(self, target, afi, vrf, title, wantroutes, debug=0):
    logstr = "RequireUnicastRoutes %s" % str(wantroutes)
    vrfstr = ""
    if vrf != "":
        vrfstr = "vrf %s" % (vrf)
    if (afi != "ipv4") and (afi != "ipv6"):
        self.log("ERROR invalid afi")
    cmdstr = "show bgp %s %s unicast" % (vrfstr, afi)
    # non json form for humans
    cmd = 'vtysh -c "%s"' % cmdstr
    luCommand(target, cmd, ".", "None", "Get %s %s RIB (non-json)" % (vrfstr, afi))
    cmd = 'vtysh -c "%s json"' % cmdstr
    ret = luCommand(
        target, cmd, ".*", "None", "Get %s %s RIB (json)" % (vrfstr, afi)
    )
    if re.search(r"^\s*$", ret):
        # degenerate case: empty json means no routes
        if len(wantroutes) > 0:
            luResult(target, False, title, logstr)
            return
        luResult(target, True, title, logstr)
    rib = json.loads(ret)
    try:
        table = rib["routes"]
        # KeyError: 'routes' probably means missing/bad VRF
    except KeyError as err:
        if vrf != "":
            errstr = "-script ERROR: check if wrong vrf (%s)" % (vrf)
        else:
            errstr = "-script ERROR: check if vrf missing"
        luResult(target, False, title + errstr, logstr)
        return
    # if debug:
    #    self.log("table=%s" % table)
    for want in wantroutes:
        if debug:
            self.log("want=%s" % want)
        if not self.routes_include_wanted(table, want, debug):
            luResult(target, False, title, logstr)
            return
    luResult(target, True, title, logstr)