code: def add_header(
      html: str, title="explainerdashboard", resize=True
  ) -> str:
      """Turns a html snippet into a full html layout by adding <html>, <head> and <body> tags.
  
      Loads bootstrap css and javascript and triggers a resize event in order to prevent
      plotly figs from overflowing their div containers.
  
      resize adds a javascript snippet that simulates a window resize in order to
      properly size the plotly figs. (bit of a hack, but it works :)
      """
      full_html = f"""
  <!DOCTYPE html>
  <html lang="en">
  <head>
  <title>{title}</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
  </head>
  <body>
  
  <div class="container">
  {html}
  </div>
  
  </body>
  """
      if resize:
          full_html += """
  <script type="text/javascript">
  window.dispatchEvent(new Event('resize'));
  </script>
          """
      full_html += """
  </html>
      """
      return full_html
  
file_path: explainerdashboard/explainerdashboard/to_html.py
label_desc: Use image node_id 1 for calling a global function with example usage: add_header(html, title, resize) and returns: full_html