<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def print_groups():
 """Print all groups as JSON"""

    print("Printing information about all groups defined in the Gateway")
    groups = api(gateway.get_groups())
    if len(groups) == 0:
        exit(bold("No groups defined"))

    container = []
    for group in groups:
        container.append(api(group).raw)
    print(jsonify(container))