human
Complete this python program:
def dump_pyopenssl_chain(chain, filetype=OpenSSL.crypto.FILETYPE_PEM):
assistant
#Here is the Python program you requested.

    """Dump certificate chain into a bundle.
    :param list chain: List of `OpenSSL.crypto.X509` (or wrapped in
    `acme.jose.ComparableX509`).
    """
    def _dump_cert(cert):
        if isinstance(cert, jose.ComparableX509):
            cert = cert.wrapped
        return OpenSSL.crypto.dump_certificate(filetype, cert)
    return ''.join((_dump_cert(cert) for cert in chain))