def METHOD_NAME():
    # lazy imports
    import grass.temporal as tgis
    # Get the options
    input = options["input"]
    output = options["output"]
    method = options["method"]
    quantile = options["quantile"]
    order = options["order"]
    memory = options["memory"]
    nprocs = options["nprocs"]
    where = options["where"]
    max_files_open = int(options["file_limit"])
    add_time = flags["t"]
    nulls = flags["n"]
    # Check if number of methods and output maps matches
    if "quantile" in method:
        len_method = len(method.split(",")) - 1
    else:
        len_method = len(method.split(","))
    if (len(list(filter(None, quantile.split(",")))) + len_method) != len(
        output.split(",")
    ):
        grass.fatal(_("Number requested methods and output maps do not match."))
    # Make sure the temporal database exists
    tgis.init()
    sp = tgis.open_old_stds(input, "strds")
    rows = sp.get_registered_maps("id", where, order, None)
    if rows:
        # Create the r.series input file
        filename = grass.tempfile(True)
        file = open(filename, "w")
        for row in rows:
            string = "%s\n" % (row["id"])
            file.write(string)
        file.close()
        flag = ""
        if len(rows) > max_files_open:
            grass.warning(
                _(
                    "Processing over {} maps: activating -z flag of r.series which slows down processing.".format(
                        max_files_open
                    )
                )
            )
            flag += "z"
        if nulls:
            flag += "n"
        try:
            grass.run_command(
                "r.series",
                flags=flag,
                file=filename,
                output=output,
                overwrite=grass.overwrite(),
                method=method,
                quantile=quantile,
                memory=memory,
                nprocs=nprocs,
            )
        except CalledModuleError:
            grass.fatal(_("%s failed. Check above error messages.") % "r.series")
        if not add_time:
            # We need to set the temporal extent from the subset of selected maps
            maps = sp.get_registered_maps_as_objects(
                where=where, order=order, dbif=None
            )
            first_map = maps[0]
            last_map = maps[-1]
            start_a, end_a = first_map.get_temporal_extent_as_tuple()
            start_b, end_b = last_map.get_temporal_extent_as_tuple()
            if end_b is None:
                end_b = start_b
            if first_map.is_time_absolute():
                extent = tgis.AbsoluteTemporalExtent(start_time=start_a, end_time=end_b)
            else:
                extent = tgis.RelativeTemporalExtent(
                    start_time=start_a,
                    end_time=end_b,
                    unit=first_map.get_relative_time_unit(),
                )
            for out_map in output.split(","):
                # Create the time range for the output map
                if out_map.find("@") >= 0:
                    id = out_map
                else:
                    mapset = grass.gisenv()["MAPSET"]
                    id = out_map + "@" + mapset
                map = sp.get_new_map_instance(id)
                map.load()
                map.set_temporal_extent(extent=extent)
                # Register the map in the temporal database
                if map.is_in_db():
                    map.update_all()
                else:
                    map.insert()