def select_one(iterable, where, equals):
    """Returns the first object of iterable matching given attribute value."""
    for item in iterable:
        if getattr(item, where, None) == equals:
            return item