Unable to use from_py_func

getting error for the line
callback = CustomJS. from_py_func(callback1)

AttributeError: type object ‘CustomJS’ has no attribute ‘from_py_func’

It had been deprecated and have been subsequently removed in Bokeh 2.0: https://docs.bokeh.org/en/2.0.0/docs/releases.html#api-removals

Thanks Eugene Pakhomov.
Any idea how can i use the functionality of from_py_func. Or any alternative for it?.

My organisation blocks the bokeh server JS so i have to use inline mode and CustomJS.

You have to write CustomJS code, yes.

The underlying third-party Python->JS transpiler library still exists (several others too, in fact). Presumedly you could install and use it directly to generate the JavaScript code for CustomJS callbacks. Or as mentioned, write JavaScript directly.