code: def move_group(self, group = None, parent = None):
          
  
          if group is None or type(group) is not v1Group:
              raise KPError("A valid group must be given.")
          elif parent is not None and type(parent) is not v1Group:
              raise KPError("parent must be a v1Group.")
          elif group is parent:
              raise KPError("group and parent must not be the same group")
          if parent is None:
              parent = self.root_group
          if group in self.groups:
              self.groups.remove(group)
              group.parent.children.remove(group)
              group.parent = parent
              if parent.children:
                  if parent.children[-1] is self.groups[-1]:
                      self.groups.append(group)
                  else:
                      new_index = self.groups.index(parent.children[-1]) + 1
                      self.groups.insert(new_index, group)
              else:
                  new_index = self.groups.index(parent) + 1
                  self.groups.insert(new_index, group)
              parent.children.append(group)
              if parent is self.root_group:
                  group.level = 0
              else:
                  group.level = parent.level + 1
              if group.children:
                  self._move_group_helper(group)
              group.last_mod = datetime.now().replace(microsecond=0)
              return True
          else:
              raise KPError("Didn't find given group.")
docs: Append group to a new parent.
  
          group and parent must be v1Group-instances.