'Find and return :class:`~flexget.entry.Entry` with given attributes from task or None
:param string category: entries, accepted, rejected or failed. Defaults to entries.
:param values: Key values of entries to be searched
:return: Entry or None'

def find_entry(self, category=u'entries', **values):

    cat = getattr(self, category)
    if (not isinstance(cat, EntryIterator)):
        raise TypeError(u'category    must    be    a    EntryIterator')
    for entry in cat:
        for (k, v) in values.items():
            if (not ((k in entry) and (entry[k] == v))):
                break
        else:
            return entry
    return None
