def METHOD_NAME(
    vect_name,
    results,
    cats,
    rlayer,
    training=None,
    cols=None,
    overwrite=False,
    append=False,
    pkl=None,
):
    if pkl:
        res = open(pkl, "w")
        pickle.dump(results, res)
        res.close()
    # check if the link already exist
    with Vector(vect_name, mode="r") as vct:
        link = vct.dblinks.by_name(rlayer)
        mode = "r" if link else "w"
    print("Opening vector <%s>" % vect_name)
    with Vector(vect_name, mode=mode) as vect:
        if cols:
            cols.insert(0, COLS[0])
            tab = link.table() if link else Table(rlayer, vect.table.conn)
            if tab.exist() and append:
                columns_to_up = []
                # add the column to the table
                for cname, ctype in cols:
                    columns_to_up.append("%s=?" % cname)
                    if cname not in tab.columns:
                        tab.columns.add(cname, ctype)
                upsql = "UPDATE %s SET %s WHERE %s=%s"
                up = upsql % (tab.name, ",".join(columns_to_up), tab.key, "?")
            else:
                if tab.exist():
                    print("Table <%s> already exist, will be removed." % tab.name)
                    tab.drop(force=True)
                print("Ceating a new table <%s>." % rlayer)
                tab.create(cols)
                up = ""
            export2onesqlite(
                tab,
                cats.astype(int),
                up,
                *[cls["predict"].astype(int) for cls in results],
            )
            if mode == "w":
                nlyr = len(vect.dblinks) + 1
                link = Link(nlyr, tab.name, tab.name)
                vect.dblinks.add(link)
                vect.build()
        else:
            for cls in results:
                create_tab(
                    vect,
                    cls["name"],
                    cats,
                    cls["predict"],
                    training,
                    COLS if training else COLS[:2],
                )