code: def move(self, target_parent, name=None, include_children=True, include_instances=True):
          if not name:
              name = self.name
          if self.category == Category.MODEL and target_parent.category == Category.MODEL:
              moved_model = relocate_model(part=self, target_parent=target_parent, name=name,
                                           include_children=include_children)
              if include_instances:
                  retrieve_instances_to_copied = list(self.instances())
                  retrieve_parent_instances = list(target_parent.instances())
                  for parent_instance in retrieve_parent_instances:
                      for instance in retrieve_instances_to_copied:
                          instance.populate_descendants()
                          move_part_instance(part_instance=instance, target_parent=parent_instance,
                                             part_model=self, name=instance.name, include_children=include_children)
              self.delete()
              return moved_model
          elif self.category == Category.INSTANCE and target_parent.category == Category.INSTANCE:
              moved_instance = relocate_instance(part=self, target_parent=target_parent, name=name,
                                                 include_children=include_children)
              try:
                  self.delete()
              except APIError:
                  model_of_instance = self.model()
                  model_of_instance.delete()
              return moved_instance
          else:
              raise IllegalArgumentError('part "{}" and target parent "{}" must have the same category')