Assuming I have a tuple like:
[(\'text-1\',\'xxx\'), (\'img-1\',\'iii\'), (\'img-2\',\'jjj\'), (\'text-2\',\'xxx\')]
I want to filter out t
tuple_filter = lambda t, i, w: filter(lambda a: a[i].startswith(w), t) newtuple = tuple_filter(thetuple, 0, 'img')