How to use make an AI detect light source and avoid it?

Since this is getting a lot of clicks wanted to share the proper version of Light Awareness plugin for detecting lights on any object quite a correctly and efficiently with a universal solution.

Simple approach

Robust proper solution.