Nope. Not officially (unless you use native extensions). There is a hack to do it, though. There is this global variable named __dm_script_instance__ which you can save when registering the callback and then temporarily set while calling it.
__dm_script_instance__
See discussion here: