code: def test_move_model_groups_in_collection_success(sagemaker_session):
      model_group_name = unique_name_from_base("test-model-group")
      sagemaker_session.sagemaker_client.create_model_package_group(
          ModelPackageGroupName=model_group_name
      )
      collection = Collection(sagemaker_session)
      source_collection_name = unique_name_from_base(
          "test-collection-source"
      )
      destination_collection_name = unique_name_from_base(
          "test-collection-destination"
      )
      collection.create(source_collection_name)
      collection.create(destination_collection_name)
      model_groups = []
      model_groups.append(model_group_name)
      add_response = collection.add_model_groups(
          collection_name=source_collection_name,
          model_groups=model_groups,
      )
      collection_filter = [
          {
              "Name": "resource-type",
              "Values": [
                  "AWS::ResourceGroups::Group",
                  "AWS::SageMaker::ModelPackageGroup",
              ],
          },
      ]
      collection_details = sagemaker_session.list_group_resources(
          group=source_collection_name, filters=collection_filter
      )
  
      assert len(add_response["failure"]) == 0
      assert len(add_response["added_groups"]) == 1
      assert len(collection_details["Resources"]) == 1
  
      move_response = collection.move_model_group(
          source_collection_name=source_collection_name,
          model_group=model_group_name,
          destination_collection_name=destination_collection_name,
      )
  
      assert move_response["moved_success"] == model_group_name
  
      collection_details = sagemaker_session.list_group_resources(
          group=destination_collection_name, filters=collection_filter
      )
  
      assert len(collection_details["Resources"]) == 1
  
      collection_details = sagemaker_session.list_group_resources(
          group=source_collection_name, filters=collection_filter
      )
      assert len(collection_details["Resources"]) == 0
  
      remove_response = collection.remove_model_groups(
          collection_name=destination_collection_name,
          model_groups=model_groups,
      )
  
      assert len(remove_response["failure"]) == 0
      assert len(remove_response["removed_groups"]) == 1
  
      delete_response = collection.delete(
          [source_collection_name, destination_collection_name]
      )
      assert len(delete_response["deleted_collections"]) == 2
      sagemaker_session.sagemaker_client.delete_model_package_group(
          ModelPackageGroupName=model_group_name
      )
  
imports: from __future__ import absolute_import
  from sagemaker.utils import unique_name_from_base
  from sagemaker.collection import Collection
label_desc: Use image node_id 4 for calling a global function with example usage: test_move_model_groups_in_collection_success(sagemaker_session) without return types