def METHOD_NAME(doc):
    source = ColumnDataSource(dict(xs=[], ys=[]))
    renderer = plot.add_glyph(source, MultiLine(xs='xs', ys='ys'))
    tool = FreehandDrawTool(num_objects=num_objects, renderers=[renderer])
    plot.add_tools(tool)
    plot.toolbar.active_multi = tool
    div = Div(text='False')
    def cb(attr, old, new):
        if cds_data_almost_equal(new, expected):
            div.text = 'True'
    source.on_change('data', cb)
    code = RECORD("matches", "div.text")
    plot.tags.append(CustomJS(name="custom-action", args=dict(div=div), code=code))
    doc.add_root(column(plot, div))