How to convert 2D screen coordinate to 3D coordinate

Hello every one! I am working on an addon for blender using python? I would like to know How to convert 2D screen coordinate to 3D coordinate ? Is there existed script or blender API ?