docs: def encrypt_item(table_name, aws_cmk_id):
      """Demonstrate use of EncryptedClient to transparently encrypt an item."""
      index_key = {"partition_attribute": {"S": "is this"}, "sort_attribute": {"N": "55"}}
      plaintext_item = {
          "example": {"S": "data"},
          "some numbers": {"N": "99"},
          "and some binary": {"B": b"\x00\x01\x02"},
          "leave me": {"S": "alone"},  # We want to ignore this attribute
      }
      # Collect all of the attributes that will be encrypted (used later).
      encrypted_attributes = set(plaintext_item.keys())
      encrypted_attributes.remove("leave me")
      # Collect all of the attributes that will not be encrypted (used later).
      unencrypted_attributes = set(index_key.keys())
      unencrypted_attributes.add("leave me")
      # Add the index pairs to the item.
      plaintext_item.update(index_key)
  
      # Create a normal client.
      client = boto3.client("dynamodb")
      # Create a crypto materials provider using the specified AWS KMS key.
      aws_kms_cmp = AwsKmsCryptographicMaterialsProvider(key_id=aws_cmk_id)
      # Create attribute actions that tells the encrypted client to encrypt all attributes except one.
      actions = AttributeActions(
          default_action=CryptoAction.ENCRYPT_AND_SIGN, attribute_actions={"leave me": CryptoAction.DO_NOTHING}
      )
      # Use these objects to create an encrypted client.
      encrypted_client = EncryptedClient(client=client, materials_provider=aws_kms_cmp, attribute_actions=actions)
  
      # Put the item to the table, using the encrypted client to transparently encrypt it.
      encrypted_client.put_item(TableName=table_name, Item=plaintext_item)
  
      # Get the encrypted item using the standard client.
      encrypted_item = client.get_item(TableName=table_name, Key=index_key)["Item"]
  
      # Get the item using the encrypted client, transparently decyrpting it.
      decrypted_item = encrypted_client.get_item(TableName=table_name, Key=index_key)["Item"]
  
      # Verify that all of the attributes are different in the encrypted item
      for name in encrypted_attributes:
          assert encrypted_item[name] != plaintext_item[name]
          assert decrypted_item[name] == plaintext_item[name]
  
      # Verify that all of the attributes that should not be encrypted were not.
      for name in unencrypted_attributes:
          assert decrypted_item[name] == encrypted_item[name] == plaintext_item[name]
  
      # Clean up the item
      encrypted_client.delete_item(TableName=table_name, Key=index_key)