def get_controller_children(parent, disconnect_from_parent=False):
    """
    Return a list of all children of the given controller.

    If disconnect_from_parent is true, disconnect the children list so edits can be
    made.  Reassign the resulting list using assign_controller_children.
    """
    all_children = []
    for children_plug in parent.children:
        children = children_plug.listConnections(s=True, d=False, t='controller', p=True)
        if not children:
            continue
        child = children[0]
        all_children.append(child.node())
        if disconnect_from_parent:
            child.disconnect(children_plug)

    return all_children