def find_in_list_by_name(haystack, target_name, target_package, nodetype):
    """Find an entry in the given list by name."""
    for model in haystack:
        name = model.get('unique_id')
        if id_matches(name, target_name, target_package, nodetype, model):
            return model

    return None