I want to use the code snippets of "Generate points(pixel centroids) inside polygon" plugin in Processing Toolbox of QGIS. I tried searching in QGIS github, but couldn't find it.
I think this is the GitHub page of the tool you're looking for:
You can also find this in your QGIS directory. For example, in my QGIS 2.16.1 standalone directory, it is located in:
C:\Program Files\QGIS 2.16.1\apps\qgis\python\plugins\processing\algs\qgis\PointsFromPolygons.py