How to access the render layer in process?

I need to know which render layer is being processed when a freestyle script is run. It can also be found if I know the render layer node in compositor under which the script is running. But I can’t find the access. Can you tell me how?