code: def _apply_html_preview_to_item(self, item, nb_path):
      html_str = self._nb_to_html_str(nb_path)
  
      json_file_name = "notebook_preview.json"
      json_file_path = os.path.join(".", json_file_name)
      with open(json_file_path, "w") as f:
          json.dump({"html": html_str}, f)
  
      if item.resources.list():
          item.resources.remove()
      item.resources.add(file=json_file_path, file_name=json_file_name)
      log.debug(f"Added html preview new resource for item {item.id}")
      os.remove(json_file_path)
  
imports: import os
  import sys
  import argparse
  import traceback
  import json
  import re
  import logging
  import yaml
  import nbformat
  from nbconvert import HTMLExporter
  from arcgis.gis import GIS
label_desc: Use image node_id 8 for calling the ItemsUploader obj's underlying member method code with example usage: obj._apply_html_preview_to_item(item, nb_path) without return types