human
Complete the below
def dump_pyopenssl_chain(chain, filetype=OpenSSL.crypto.FILETYPE_PEM):

    ''''Dump certificate chain into a bundle.
    :param list chain: List of `OpenSSL.crypto.X509` (or wrapped in
    `acme.jose.ComparableX509`).'
    '''

=====
Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    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))