Some updates to data affinity doc

- Example code updated.

Please keep the style with whitespaces after and before brackets, it's way easier to read on pdf