docs: def encrypt(**kwargs):
      """Encrypts and serializes provided plaintext.
  
      .. note::
          When using this function, the entire ciphertext message is encrypted into memory before returning
          any data.  If streaming is desired, see :class:`aws_encryption_sdk.stream`.
  
      .. code:: python
  
          >>> import aws_encryption_sdk
          >>> kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(key_ids=[
          ...     'arn:aws:kms:us-east-1:2222222222222:key/22222222-2222-2222-2222-222222222222',
          ...     'arn:aws:kms:us-east-1:3333333333333:key/33333333-3333-3333-3333-333333333333'
          ... ])
          >>> my_ciphertext, encryptor_header = aws_encryption_sdk.encrypt(
          ...     source=my_plaintext,
          ...     key_provider=kms_key_provider
          ... )
  
      :param config: Client configuration object (config or individual parameters required)
      :type config: aws_encryption_sdk.streaming_client.EncryptorConfig
      :param source: Source data to encrypt or decrypt
      :type source: str, bytes, io.IOBase, or file
      :param materials_manager: `CryptoMaterialsManager` from which to obtain cryptographic materials
          (either `materials_manager` or `key_provider` required)
      :type materials_manager: aws_encryption_sdk.materials_managers.base.CryptoMaterialsManager
      :param key_provider: `MasterKeyProvider` from which to obtain data keys for encryption
          (either `materials_manager` or `key_provider` required)
      :type key_provider: aws_encryption_sdk.key_providers.base.MasterKeyProvider
      :param int source_length: Length of source data (optional)
  
          .. note::
              If source_length is not provided and unframed message is being written or read() is called,
              will attempt to seek() to the end of the stream and tell() to find the length of source data.
  
          .. note::
              .. versionadded:: 1.3.0
  
              If `source_length` and `materials_manager` are both provided, the total plaintext bytes
              encrypted will not be allowed to exceed `source_length`. To maintain backwards compatibility,
              this is not enforced if a `key_provider` is provided.
  
      :param dict encryption_context: Dictionary defining encryption context
      :param algorithm: Algorithm to use for encryption
      :type algorithm: aws_encryption_sdk.identifiers.Algorithm
      :param int frame_length: Frame length in bytes
      :returns: Tuple containing the encrypted ciphertext and the message header object
      :rtype: tuple of bytes and :class:`aws_encryption_sdk.structures.MessageHeader`
      """
      with StreamEncryptor(**kwargs) as encryptor:
          ciphertext = encryptor.read()
      return ciphertext, encryptor.header