code: def derive_data_encryption_key(source_key, algorithm, message_id):
      
      key = source_key
      if algorithm.kdf_type is not None:
          key = algorithm.kdf_type(
              algorithm=algorithm.kdf_hash_type(),
              length=algorithm.data_key_len,
              salt=None,
              info=struct.pack(">H16s", algorithm.algorithm_id, message_id),
              backend=default_backend(),
          ).derive(source_key)
      return key
docs: Derives the data encryption key using the defined algorithm.
  
      :param bytes source_key: Raw source key
      :param algorithm: Algorithm used to encrypt this body
      :type algorithm: aws_encryption_sdk.identifiers.Algorithm
      :param bytes message_id: Message ID
      :returns: Derived data encryption key
      :rtype: bytes