code: def test_calendar_base(fake_writer):
      begin = datetime.date(2017, 1, 1)
      end = datetime.date(2017, 12, 31)
      data = [
          [
              str(begin + datetime.timedelta(days=i)),
              random.randint(1000, 25000),
          ]
          for i in range((end - begin).days + 1)
      ]
  
      c = (
          Calendar()
          .add("", data, calendar_opts=opts.CalendarOpts(range_="2017"))
          .set_global_opts(
              visualmap_opts=opts.VisualMapOpts(
                  max_=20000,
                  min_=500,
                  orient="horizontal",
                  is_piecewise=True,
                  pos_top="230px",
                  pos_left="100px",
              )
          )
      )
      c.render()
      _, content = fake_writer.call_args[0]
      assert_equal(c.theme, "white")
      assert_equal(c.renderer, "canvas")
      assert_in("visualMap", content)
  
imports: import datetime
  import random
  from unittest.mock import patch
  from nose.tools import assert_equal, assert_in
  from pyecharts import options
  from pyecharts.charts import Calendar
label_desc: Use image node_id 1 for calling a global function with example usage: test_calendar_base(fake_writer) without return types