[python] Get the first item from an iterable that matches a condition