def METHOD_NAME():
    valmap = options["input"]
    dirmap = options["direction"]
    rpathmap = options["output"]
    vpathmap = options["drain"]
    start_coords = options["start_coordinates"]
    start_pnts = options["start_points"]
    global tmp_maps
    tmp_maps = False
    atexit.register(cleanup)
    if not dirmap:
        valmap_name = valmap.split("@", maxsplit=1)[0]
        # get directions with r.fill.dir, without sink filling
        dirmap = gs.append_node_pid(f"{valmap_name}_dir")
        fill_map = gs.append_node_pid(f"{valmap_name}_fill")
        area_map = gs.append_node_pid(f"{valmap_name}_area")
        tmp_maps = dirmap + "," + fill_map + "," + area_map
        gs.run_command(
            "r.fill.dir",
            input=valmap,
            output=fill_map,
            direction=dirmap,
            areas=area_map,
            flags="f",
            format="grass",
        )
    # create args for r.path
    kwargs = {}
    kwargs["input"] = dirmap
    if flags["c"] or flags["a"]:
        kwargs["values"] = valmap
    kwargs["format"] = "degree"
    if start_coords:
        kwargs["start_coordinates"] = start_coords
    if start_pnts:
        kwargs["start_points"] = start_pnts
    if rpathmap:
        kwargs["raster_path"] = rpathmap
    if vpathmap:
        kwargs["vector_path"] = vpathmap
    pathflags = ""
    if flags["c"]:
        pathflags += "c"
    if flags["a"]:
        pathflags += "a"
    if flags["n"]:
        pathflags += "n"
    gs.run_command("r.path", flags=pathflags, **kwargs)
    return 0