code: def encrypt_aes_cbc(cleartext, key, iv):
      
      if isinstance(cleartext, unicode):
          cleartext = cleartext.encode('utf8')
      elif isinstance(cleartext, bytearray):
          cleartext = bytes(cleartext)
      if not isinstance(cleartext, bytes):
          raise TypeError("content to encrypt must by bytes.")
      
      aes = AES.new(key, AES.MODE_CBC, iv)
      padding = AES.block_size - (len(cleartext) % AES.block_size)
      cleartext += chr(padding).encode('utf-8') * padding # the encode() is for py3k compat
      return aes.encrypt(cleartext)
docs: This method encrypts the content.
      
      :rtype: bytes