code: def test_bar_base_with_custom_background_image(fake_writer):
      c = (
          Bar(
              init_opts=opts.InitOpts(
                  bg_color={
                      "type": "pattern",
                      "image": JsCode("img"),
                      "repeat": "no-repeat",
                  }
              )
          )
          .add_xaxis(["A", "B", "C"])
          .add_yaxis("series0", [1, 2, 4])
          .add_yaxis("series1", [2, 3, 6])
          .set_global_opts(
              title_opts=opts.TitleOpts(
                  title="Bar-背景图基本示例",
                  subtitle="我是副标题",
                  title_textstyle_opts=opts.TextStyleOpts(
                      color="white"
                  ),
              )
          )
      )
      c.add_js_funcs(
          """
          var img = new Image(); img.src = 'https://s2.ax1x.com/2019/07/08/ZsS0fK.jpg';
          """
      )
      c.render()
      _, content = fake_writer.call_args[0]
      assert_in("image", content)
  
imports: import re
  import sys
  from io import StringIO
  from test import stdout_redirect
  from unittest.mock import patch
  from nose.tools import assert_equal, assert_greater, assert_in, assert_not_in
  from pyecharts import options
  from pyecharts.charts import Bar
  from pyecharts.commons.utils import JsCode
  from pyecharts.globals import CurrentConfig, NotebookType, ThemeType
  from pyecharts.render.display import HTML
label_desc: Use image node_id 4 for calling a global function with example usage: test_bar_base_with_custom_background_image(fake_writer) without return types