def METHOD_NAME(groups: Dict) -> List[str]:
    # group --name NAME [--gid GID]
    res = []
    for name, opts in groups.items():
        gid = opts.get("gid")
        arguments = [f"group --name {name}"]
        if gid:
            arguments += ["--gid", str(gid)]
        res.append(" ".join(arguments))
    return res