code: def _js_val(encoder, data):
      if isinstance(data, dict):
          val = _js_dict(encoder, data)
      elif isinstance(data, list):
          val = _js_list(encoder, data)
      else:
          val = encoder.encode(data)
      return val
  
file_path: popmon/popmon/resources.py
imports: import json
  import pathlib
  from jinja2 import Environment, FileSystemLoader
  from pkg_resources import resource_filename
  import popmon
label_desc: Use image node_id 3 for calling a global function with example usage: _js_val(encoder, data) and returns: val