code: def heap_analytics(
      userid, user_properties=None, event_properties=None
  ) -> ui.InlineScript:
      script = (
          "window.heap=window.heap||[],heap.load=function(e,t)"
          "{window.heap.appid=e,window.heap."
          'config=t=t||{};var r=document.createElement("script");'
          'r.type="text/javascript",'
          'r.async=!0,r.src="https://cdn.heapanalytics.com/js/heap-"+e+".js";'
          'var a=document.getElementsByTagName("script")[0];'
          "a.parentNode.insertBefore(r,a);"
          "for(var n=function(e){return function(){heap.push([e]."
          "concat(Array.prototype.slice.call(arguments,0)))}},"
          'p=["addEventProperties","addUserProperties","clearEventProperties","identify",'
          '"resetIdentity","removeEventProperty","setEventProperties","track",'
          '"unsetEventProperty"],o=0;o<p.length;o++)heap[p[o]]=n(p[o])};'
          'heap.load("1090178399");'
      )
  
      identity = hashlib.sha256(userid.encode()).hexdigest()
      script += f"heap.identify('{identity}');"
  
      if user_properties is not None:
          script += f"heap.addUserProperties({user_properties})"
  
      if event_properties is not None:
          script += f"heap.addEventProperties({event_properties})"
  
      return ui.inline_script(content=script)
  
imports: import hashlib
  import logging
  from typing import List
  from h2o_wave import Q, ui
  from llm_studio.app_utils.cards import card_zones
  from llm_studio.app_utils.config import default_cfg
label_desc: Use image node_id 1 for calling a global function with example usage: heap_analytics(userid, user_properties, event_properties) and returns: ui