code: def _init_with_vegafusion(self, local_tz: str):
      if self.chart is not None:
          vegalite_spec = self.chart.to_dict(
              context={"pre_transform": False}
          )
          with self.hold_sync():
              self._chart_state = compile_to_vegafusion_chart_state(
                  vegalite_spec, local_tz
              )
              self._js_watch_plan = self._chart_state.get_watch_plan()[
                  "client_to_server"
              ]
              self.spec = self._chart_state.get_transformed_spec()
  
              # Callback to update chart state and send updates back to client
              def on_js_to_py_updates(change):
                  if self.debug:
                      updates_str = json.dumps(change["new"], indent=2)
                      print(
                          f"JavaScript to Python VegaFusion updates:\n {updates_str}"
                      )
                  updates = self._chart_state.update(change["new"])
                  if self.debug:
                      updates_str = json.dumps(updates, indent=2)
                      print(
                          f"Python to JavaScript VegaFusion updates:\n {updates_str}"
                      )
                  self._py_to_js_updates = updates
  
              self.observe(on_js_to_py_updates, ["_js_to_py_updates"])
  
imports: import json
  import anywidget
  import traitlets
  import pathlib
  from typing import Any, Set, Optional
  import altair
  from altair.utils._vegafusion_data import using_vegafusion, compile_to_vegafusion_chart_state
  from altair import TopLevelSpec
  from altair.utils.selection import IndexSelection, PointSelection, IntervalSelection
label_desc: Use image node_id 4 for calling the JupyterChart obj's underlying member method code with example usage: obj._init_with_vegafusion(local_tz) without return types