Python code of node objectExtension.SetMaterial

Hello,
Does anyone know the python-code of the node ObjectExtensions.SetMaterial?
I want to make a python node that assigns materials to 3D-solid based on the layername (dictionary key layer, value material).