from typing import Optional


def search_for_object(obj_list: list, obj_name) -> Optional[object]:
    """Given a list of objects, return a matching object if any"""
    if len(obj_list) == 1:
        return obj_list[0]
    for obj in obj_list:
        if obj.name == obj_name:
            return obj