code: def test_inline_extension() -> None:
      from bokeh.io import save
      from bokeh.models import TickFormatter
      from bokeh.plotting import figure
      from bokeh.util.compiler import TypeScript
  
      TS_CODE = """
      import {TickFormatter} from "models/formatters/tick_formatter"
  
      export class TestFormatter extends TickFormatter {
  
        doFormat(ticks: number[]): string[] {
          if (ticks.length == 0)
            return[]
          else {
            const formatted = [`${ticks[0]}`]
            for (let i = 1; i < ticks.length; i++) {
              const difference = (ticks[i] - ticks[0]).toPrecision(2)
              formatted.push(`+${difference}}`)
            }
            return formatted
          }
        }
      }
      """
  
      class TestFormatter(TickFormatter):
          __implementation__ = TypeScript(TS_CODE)
  
      class TestFormatter2(TickFormatter):
          __implementation__ = TypeScript(
              "^"
          )  # invalid syntax on purpose
  
      p = figure()
      p.scatter([1, 2, 3, 4, 6], [5, 7, 3, 2, 4])
      p.xaxis.formatter = TestFormatter()
      save(p)
  
file_path: bokeh/tests/unit/bokeh/util/test_compiler.py
imports: from __future__ import annotations
  import pytest
  import json
  import os
  from unittest.mock import MagicMock, patch
  import bokeh.util.compiler
label_desc: Use image node_id 11 for calling a global function with example usage: test_inline_extension() without return types