Python 3: replace "im_self" by "__self__"

The Python 3 removed the "im_self" attribute. This patch
replaces "im_self" by "__self__" attribute.
Original description http://docs.python.org/2/reference/datamodel.html

Change-Id: I0e66553ccebfcae750693177354723f332637cf5
Partial-Bug: #1282514
Merge "Python 3: replace "im_self" by "__self__""