<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetGroups(r, bulk=False):
 """ Gets all node groups in the cluster. @type bulk: bool @param bulk: whether to return all information about the groups @rtype: list of dict or str @return: if bulk is true, a list of dictionaries with info about all node groups in the cluster, else a list of names of those node groups """


    if bulk:
        return r.request("get", "/2/groups", query={"bulk": 1})
    else:
        groups = r.request("get", "/2/groups")
        return r.applier(itemgetters("name"), groups)