Color Gradient - Paint operators

I can’t seem to find the file where the color gradient script is stored for weight paint.
I would like to see if I can use it for vertex paint.

http://www.blender.org/documentation/blender_python_api_2_69_release/bpy.ops.paint.html#bpy.ops.paint.weight_gradient

I want to take a look at the script and refer to that page to get an idea how to write it. Very new to script…