code: def _delete_associations(arn, sagemaker_session):
      client = sagemaker_session.sagemaker_client
      outgoing_associations = client.list_associations(SourceArn=arn)[
          "AssociationSummaries"
      ]
      incoming_associations = client.list_associations(
          DestinationArn=arn
      )["AssociationSummaries"]
      associations = []
      if outgoing_associations:
          associations.extend(outgoing_associations)
      if incoming_associations:
          associations.extend(incoming_associations)
      for association in associations:
          source_arn = association["SourceArn"]
          destination_arn = association["DestinationArn"]
          client.delete_association(
              SourceArn=source_arn, DestinationArn=destination_arn
          )
  
imports: from __future__ import absolute_import
  import glob
  import logging
  import os
  import shutil
  import tempfile
  import time
  import uuid
  import boto3
  import pytest
  from sagemaker.experiments import Run
  from tests.integ import DATA_DIR
  from sagemaker.experiments import trial_component, trial, experiment
  from sagemaker.utils import retry_with_backoff, unique_name_from_base
  from tests.integ.sagemaker.experiments.helpers import name, names
label_desc: Use image node_id 10 for calling a global function with example usage: _delete_associations(arn, sagemaker_session) without return types