/usr/lib/python2.7/dist-packages/pg.py is in python-pygresql 1:4.0-3build1.
This file is owned by root:root, with mode 0o777.
It is a symlink to /usr/lib/python2.7/dist-packages/../../../share/pyshared/pg.py
/usr/lib/python2.7/dist-packages/../../../share/pyshared/pg.py