<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_group(self, group = None):
 """This method removes a group. The group needed to remove the group. group must be a v1Group. """


        if group is None:
            raise KPError("Need group to remove a group")
        elif type(group) is not v1Group:
            raise KPError("group must be v1Group")

        children = []
        entries = []
        if group in self.groups:
            # Save all children and entries to
            # delete them later
            children.extend(group.children)
            entries.extend(group.entries)
            # Finally remove group
            group.parent.children.remove(group)
            self.groups.remove(group)
        else:
            raise KPError("Given group doesn't exist")
        self._num_groups -= 1
        
        for i in children:
            self.remove_group(i)
        for i in entries:
            self.remove_entry(i)     
        return True