code: def scripts(self, tag: bool = True) -> str:
      if tag:
          return JS_RESOURCES.render(js_raw=self.js_raw, js_files=[])
      else:
          return "\n".join(self.js_raw)
  
imports: from __future__ import annotations
  import logging
  import hashlib
  import json
  import os
  from dataclasses import dataclass
  from os.path import normpath
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable, Iterator, Sequence, TypedDict
  from urllib.parse import urljoin
  from ..core.has_props import HasProps
  from ..core.templates import CSS_RESOURCES, JS_RESOURCES
  from ..document.document import Document
  from ..resources import Resources
  from ..settings import settings
  from ..util.compiler import bundle_models
  from .util import contains_tex_string
label_desc: Use image node_id 5 for calling the Bundle obj's underlying member method code with example usage: obj.scripts(tag) and returns: JS_RESOURCES, str