Cherry-picked changes to lineage.py from a local branch
Cherry-picked changes to lineage.py from a local branch


Former-commit-id: c69ff99655e9d9cc2b58599728dff5a4a4ade11b
kaustubhcs/PyOpenWorm,openworm/PyOpenWorm,hnunner/PyOpenWorm,gsarma/PyOpenWorm,travs/PyOpenWorm,openworm/PyOpenWorm,gsarma/PyOpenWorm