code: def test_js_callback() -> None:
      slider = Slider()
  
      cb = CustomJS(code="foo();", args=dict(x=slider))
      assert "foo()" in cb.code
      assert cb.args["x"] is slider
  
      cb = CustomJS(code="foo();", args=dict(x=3))
      assert "foo()" in cb.code
      assert cb.args["x"] == 3
  
      with raises(AttributeError):  # kwargs not supported
          CustomJS(code="foo();", x=slider)
  
file_path: bokeh/tests/unit/bokeh/models/test_callbacks__models.py
imports: from __future__ import annotations
  import pytest
  from pathlib import Path
  from unittest.mock import mock_open, patch
  from pytest import raises
  from bokeh.models import Slider
  from bokeh.models import CustomJS
label_desc: Use image node_id 1 for calling a global function with example usage: test_js_callback() without return types