def METHOD_NAME(opts, flgs):
    TMPVECT = []
    DEBUG = True if flgs["d"] else False
    atexit.register(cleanup, vect=TMPVECT, debug=DEBUG)
    # check input maps
    rhydro = ["kind_label", "discharge", "id_point", "id_plant"]
    rother = ["kind_label", "discharge", "id_point", "id_plant"]
    ovwr = overwrite()
    try:
        hydro = check_required_columns(
            opts["hydro"], int(opts["hydro_layer"]), rhydro, "hydro"
        )
        if opts["other"]:
            other = check_required_columns(
                opts["other"], opts["other_layer"], rother, "other"
            )
        else:
            other = None
        # minflow = check_float_or_raster(opts['minflow'])
    except ParameterError as exc:
        exception2error(exc)
    # start working
    hydro.open("r")
    el, mset = (
        opts["elevation"].split("@")
        if "@" in opts["elevation"]
        else (opts["elevation"], "")
    )
    elev = RasterRow(name=el, mapset=mset)
    elev.open("r")
    # import ipdb; ipdb.set_trace()
    plants, skipped = read_plants(
        hydro,
        elev=elev,
        restitution=opts["hydro_kind_turbine"],
        intake=opts["hydro_kind_intake"],
    )
    hydro.close()
    rvname, rvmset = (
        opts["river"].split("@") if "@" in opts["river"] else (opts["river"], "")
    )
    vplants = opts["output_plants"] if opts["output_plants"] else "tmpplants"
    # FIXME: I try with tmpplants in my mapset and it doesn'work
    if opts["output_plants"] == "":
        TMPVECT.append(vplants)
    with VectorTopo(rvname, rvmset, mode="r") as river:
        write_plants(plants, vplants, river, elev, overwrite=ovwr)
    if skipped:
        for skip in skipped:
            print("Plant: %r, Point: %r, kind: %r" % skip)
    elev.close()
    # compute a buffer around the plants
    buff = vplants + "buff"
    v.buffer(input=vplants, type="line", output=buff, distance=0.1, overwrite=ovwr)
    TMPVECT.append(buff)
    # return all the river segments that are not already with plants
    v.overlay(
        flags="t",
        ainput=opts["river"],
        atype="line",
        binput=buff,
        operator="not",
        output=opts["output_streams"],
        overwrite=ovwr,
    )