Can not change data.source in python by callback

I am working on a tool for manual classification which changes the property of certain dot(color in my case) chosen in a scatter plot by bokeh. I changed the source data in callback by = d2 and s.change.emit() but both failed. I thought such operation will change, but when I print, actually nothing happens. The dots’ color in the plot changes as expected though. Here is my related code:

DF = pd.read_csv(csv_path)
s = ColumnDataSource(DF_file)
p = figure(plot_width=500, plot_height=500, tooltips=TOOLTIPS,tools="lasso_select, tap", title="manual classification")
circles ='x', 'y', color='color', size=10, source=s, line_alpha=0.6,fill_alpha=0.6)
s.callback = CustomJS(args=dict(s1=s), code="""
    var inds = cb_obj.selected.indices;
    var d1 =;

    for (var i = 0; i < inds.length; i++) 
    {d1['color'][inds[i]] = 'green';} 


(Sorry for asking about this question at the same time at stack overflow and here, but I am in a hurry for a task.)

You need to copy the new data to the object you have provided via args.
So before the line s1.change.emit() you have to add = d1

See this topic and this issue.

Thank you for your reply and sorry for my delay in response.
I have tried your method but still filed. However, the link shared by you is very useful and I got the solution to my problem from Getting selected glyph data properties via CustomJS.
Thank you anyway.