def pkcs7_unpad(buf):
    # type: (bytes) -> bytes
    """Removes PKCS7 padding a decrypted object
    :param bytes buf: buffer to remove padding
    :rtype: bytes
    :return: buffer without PKCS7_PADDING
    """
    unpadder = cryptography.hazmat.primitives.padding.PKCS7(
        cryptography.hazmat.primitives.ciphers.
        algorithms.AES.block_size).unpadder()
    return unpadder.update(buf) + unpadder.finalize()
def pkcs7_unpad ( buf ) : unpadder = cryptography . hazmat . primitives . padding . PKCS7 ( cryptography . hazmat . primitives . ciphers . algorithms . AES . block_size ) . unpadder ( ) return unpadder . update ( buf ) + unpadder . finalize ( )
Removes PKCS7 padding a decrypted object
    :param bytes buf: buffer to remove padding
    :rtype: bytes
    :return: buffer without PKCS7_PADDING