code: def test_delete_all(sagemaker_session):
      obj = experiment.Experiment(
          sagemaker_session, experiment_name="foo", description="bar"
      )
      client = sagemaker_session.sagemaker_client
      client.list_trials.return_value = {
          "TrialSummaries": [
              {
                  "TrialName": "trial-1",
                  "CreationTime": datetime_obj,
                  "LastModifiedTime": datetime_obj,
              },
              {
                  "TrialName": "trial-2",
                  "CreationTime": datetime_obj,
                  "LastModifiedTime": datetime_obj,
              },
          ]
      }
      client.describe_trial.side_effect = [
          {
              "Trialname": "trial-1",
              "ExperimentName": "experiment-name-value",
          },
          {
              "Trialname": "trial-2",
              "ExperimentName": "experiment-name-value",
          },
      ]
      client.list_trial_components.side_effect = [
          {
              "TrialComponentSummaries": [
                  {
                      "TrialComponentName": "trial-component-1",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
                  {
                      "TrialComponentName": "trial-component-2",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
              ]
          },
          {
              "TrialComponentSummaries": [
                  {
                      "TrialComponentName": "trial-component-3",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
                  {
                      "TrialComponentName": "trial-component-4",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
              ]
          },
      ]
  
      client.describe_trial_component.side_effect = [
          {"TrialComponentName": "trial-component-1"},
          {"TrialComponentName": "trial-component-2"},
          {"TrialComponentName": "trial-component-3"},
          {"TrialComponentName": "trial-component-4"},
      ]
  
      client.delete_trial_component.return_value = {}
      client.delete_trial.return_value = {}
      client.delete_experiment.return_value = {}
  
      obj._delete_all(action="--force")
  
      client.delete_experiment.assert_called_with(ExperimentName="foo")
  
      delete_trial_expected_calls = [
          unittest.mock.call(TrialName="trial-1"),
          unittest.mock.call(TrialName="trial-2"),
      ]
      assert (
          delete_trial_expected_calls == client.delete_trial.mock_calls
      )
  
      delete_trial_component_expected_calls = [
          unittest.mock.call(TrialComponentName="trial-component-1"),
          unittest.mock.call(TrialComponentName="trial-component-2"),
          unittest.mock.call(TrialComponentName="trial-component-3"),
          unittest.mock.call(TrialComponentName="trial-component-4"),
      ]
      assert (
          delete_trial_component_expected_calls
          == client.delete_trial_component.mock_calls
      )
  
imports: from __future__ import absolute_import
  import botocore.exceptions
  import pytest
  import unittest.mock
  import datetime
  from unittest.mock import patch
  from sagemaker import Session
  from sagemaker.experiments import experiment
  from sagemaker.experiments._api_types import TrialSummary
label_desc: Use image node_id 15 for calling a global function with example usage: test_delete_all(sagemaker_session) without return types