code: def test_record_set(sagemaker_session, cpu_instance_type):
      """Test the method ``AmazonAlgorithmEstimatorBase.record_set``.
  
      In particular, test that the objects uploaded to the S3 bucket are encrypted.
      """
      kmeans = KMeans(
          role="SageMakerRole",
          instance_count=1,
          instance_type=cpu_instance_type,
          k=10,
          sagemaker_session=sagemaker_session,
      )
      record_set = kmeans.record_set(
          datasets.one_p_mnist()[0][:100], encrypt=True
      )
      parsed_url = urlparse(record_set.s3_data)
      s3_client = sagemaker_session.boto_session.client("s3")
      head = s3_client.head_object(
          Bucket=parsed_url.netloc, Key=parsed_url.path.lstrip("/")
      )
      assert head["ServerSideEncryption"] == "AES256"
  
imports: from __future__ import absolute_import
  from six.moves.urllib.parse import urlparse
  from sagemaker import KMeans
  from tests.integ import datasets
label_desc: Use image node_id 1 for calling a global function with example usage: test_record_set(sagemaker_session, cpu_instance_type) without return types