def split_args_for_flags(args):
    """Returns `split_args, other_args` for `args`.

    Split occurs using the last occurrence of `--` in `args`.

    If `arg` does not contain `--` returns `args, []`.
    """
    for i in range(len(args) - 1, -1, -1):
        if args[i] == "--":
            return args[i + 1 :], args[:i]
    return args, []