def _item_keys_match(crypto_config, item1, item2):
    # type: (CryptoConfig, Dict, Dict) -> Bool
    """Determines whether the values in the primary and sort keys (if they exist) are the same

    :param CryptoConfig crypto_config: CryptoConfig used in encrypting the given items
    :param dict item1: The first item to compare
    :param dict item2: The second item to compare
    :return: Bool response, True if the key attributes match
    :rtype: bool
    """
    partition_key_name = crypto_config.encryption_context.partition_key_name
    sort_key_name = crypto_config.encryption_context.sort_key_name

    partition_keys_match = item1[partition_key_name] == item2[partition_key_name]

    if sort_key_name is None:
        return partition_keys_match

    return partition_keys_match and item1[sort_key_name] == item2[sort_key_name]
Determines whether the values in the primary and sort keys (if they exist) are the same

    :param CryptoConfig crypto_config: CryptoConfig used in encrypting the given items
    :param dict item1: The first item to compare
    :param dict item2: The second item to compare
    :return: Bool response, True if the key attributes match
    :rtype: bool