code: def gen_html(
      conversations,
      height,
      width,
      title,
      other_speaker,
      human_speaker,
      user_icon,
      alt_icon,
  ):
      """
      Generate HTML string for the given conversation.
  
      :param conversation:
          The conversation to be rendered (after pre-processing)
      :param height:
          Height of the HTML page
      :param width:
          Width of the HTML page
      :param title:
          Title of the HTML page
      :param other_speaker:
          The title of the model (grey boxes)
      :param human_speaker:
          Human speaker in the dialogs (blue boxes)
  
      :return: HTML string for the desired conversation
      """
      html_str = f"""<html>
  <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <title> {title} </title>
      <style type="text/css">
          @media print{{
              @page{{ margin: 0; size: {str(width)}in {str(height)}in; }}
          }}
          ul{{
            list-style: none;
          }}
          .{other_speaker}_img_div{{
            display: inline-block;
            float: left;
            margin: 18px 5px 0px -25px;
          }}
          .{human_speaker}_img_div{{
            display: inline-block;
            float: right;
            margin: 18px 15px 5px 5px;
          }}
          .{other_speaker}_img{{
              content:url({alt_icon});
          }}
          .{human_speaker}_img{{
              content:url({user_icon});
          }}
          .{other_speaker}_p_div{{
            float: left;
          }}
          .{human_speaker}_p_div{{
            float:right;
          }}
          p{{
            display:inline-block;
            overflow-wrap: break-word;
            border-radius: 30px;
            padding: 10px 10px 10px 10px;
            font-family: Helvetica, Arial, sans-serif;
          }}
          .clear{{
              float: none;
              clear: both;
          }}
          .{other_speaker}{{
                  background: #eee;
                  float: left;
              }}
          .{human_speaker}{{
              background: #0084ff;
              color: #fff;
              float: right;
          }}
          .breaker{{
              color: #bec3c9;
              display: block;
              height: 20px;
              margin: 20px 20px 20px 20px;
              text-align: center;
              text-transform: uppercase;
          }}
          img{{
            border-radius: 50px;
            width: 50px;
            height: 50px;
          }}
      </style>
  </head>
  <body>
  {gen_convo_ul(conversations)}
  </body>
  </html>
      """
      return html_str
  
imports: import os
  import json
  import random
  import tempfile
  import subprocess
  from parlai.core.params import ParlaiParser
  from parlai.core.script import ParlaiScript, register_script
  from parlai.utils.io import PathManager
label_desc: Use image node_id 2 for calling a global function with example usage: gen_html(conversations, height, width, title, other_speaker, human_speaker, user_icon, alt_icon) and returns: html_str