docs: def _members_changed(
          sender, instance, action, reverse, model, pk_set, **kwargs):
      """
      Hook that executes whenever the group members are changed.
      """
      if action == "post_add":
          if not reverse:
              group = instance
              for person in model.objects.filter(pk__in=pk_set):
                  log.change(person, "Added person to group %s" % group)
                  log.change(group, "Added person %s to group" % person)
                  _add_person_to_group(person, group)
          else:
              person = instance
              for group in model.objects.filter(pk__in=pk_set):
                  log.change(person, "Added person to group %s" % group)
                  log.change(group, "Added person %s to group" % person)
                  _add_person_to_group(person, group)
  
      elif action == "post_remove":
          if not reverse:
              group = instance
              for person in model.objects.filter(pk__in=pk_set):
                  log.change(person, "Removed person from group %s" % group)
                  log.change(group, "Removed person %s from group" % person)
                  _remove_person_from_group(person, group)
          else:
              person = instance
              for group in model.objects.filter(pk__in=pk_set):
                  log.change(person, "Removed person from group %s" % group)
                  log.change(group, "Removed person %s from group" % person)
                  _remove_person_from_group(person, group)
  
      elif action == "pre_clear":
          # This has to occur in pre_clear, not post_clear, as otherwise
          # we won't see what groups need to be removed.
          if not reverse:
              group = instance
              log.change(group, "Removed all people from group")
              for person in group.members.all():
                  log.change(group, "Removed person %s from group" % person)
                  _remove_person_from_group(person, group)
          else:
              person = instance
              log.change(person, "Removed person from all groups")
              for group in person.groups.all():
                  log.change(group, "Removed person %s from group" % person)
                  _remove_person_from_group(person, group)