code: def run_pandoc(text='', args=None):
      
  
      if args is None:
          args = []
  
      pandoc_path = which('pandoc')
      if pandoc_path is None or not os.path.exists(pandoc_path):
          raise OSError("Path to pandoc executable does not exists")
  
      proc = Popen([pandoc_path] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
      out, err = proc.communicate(input=text.encode('utf-8'))
      exitcode = proc.returncode
      if exitcode != 0:
          raise IOError(err)
      return out.decode('utf-8')
docs: Low level function that calls Pandoc with (optionally)
      some input text and/or arguments