Adding linq implementation in python