def ensure_pandoc(func):
logger = logging.getLogger(__name__)<EOL>@functools.wraps(func)<EOL>def _install_and_run(*args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>result = func(*args, **kwargs)<EOL><DEDENT>except OSError:<EOL><INDENT>message = "<STR_LIT>"<EOL>logger.warning(message)<EOL>pypandoc.download_pandoc(version='<STR_LIT>')<EOL>logger.debug("<STR_LIT>")<EOL>result = func(*args, **kwargs)<EOL><DEDENT>return result<EOL><DEDENT>return _install_and_run<EOL>
Decorate a function that uses pypandoc to ensure that pandoc is
    installed if necessary.