def identify_format(text_list):
    "Identify the appropriate formats to convert a list of DocOnce texts.\n\n    Given a list of DocOnce texts, check if they contain code. If so, return the suffix\n    '.ipynb' (for the Jupyter Notebook ipynb format), otherwise return '.md' (for\n    the pandoc markdown format).\n    :param list[str] text_list: list of strings using DocOnce syntax\n    :return: list of formats\n    :rtype: list[str]\n    "
    chunk_formats = ([''] * len(text_list))
    for (i, text) in enumerate(text_list):
        format = 'pandoc'
        (_filestr, code_blocks, code_block_types, tex_blocks) = remove_code_and_tex(text, format)
        if len(code_blocks):
            format = 'ipynb'
        chunk_formats[i] += ('.md' if (format == 'pandoc') else '.ipynb')
    return chunk_formats
Identify the appropriate formats to convert a list of DocOnce texts.

Given a list of DocOnce texts, check if they contain code. If so, return the suffix
'.ipynb' (for the Jupyter Notebook ipynb format), otherwise return '.md' (for
the pandoc markdown format).
:param list[str] text_list: list of strings using DocOnce syntax
:return: list of formats
:rtype: list[str]
def identify_format(text_list):
    "Identify the appropriate formats to convert a list of DocOnce texts.\n\n    Given a list of DocOnce texts, check if they contain code. If so, return the suffix\n    '.ipynb' (for the Jupyter Notebook ipynb format), otherwise return '.md' (for\n    the pandoc markdown format).\n    :param list[str] text_list: list of strings using DocOnce syntax\n    :return: list of formats\n    :rtype: list[str]\n    "
    chunk_formats = ([] * len(text_list))
    for (i, text) in enumerate(text_list):
        format = 'pandoc'
        (_filestr, code_blocks, code_block_types, tex_blocks) = remove_code_and_tex(text, format)
        if len(code_blocks):
            format = 'ipynb'
        chunk_formats[i] += ('.md' if (format == 'pandoc') else '.ipynb')
    return chunk_formats