'Search episode data for term, if it matches, return the Episode (self).
The key parameter can be used to limit the search to a specific element,
for example, episodename.
This primarily for use use by Show.search and Season.search. See
Show.search for further information on search
Simple example:
>>> e = Episode()
>>> e[\'episodename\'] = "An Example"
>>> e.search("examp")
<Episode 00x00 - An Example>
Limiting by key:
>>> e.search("examp", key = "episodename")
<Episode 00x00 - An Example>'

def search(self, term=None, key=None):

    if (term == None):
        raise TypeError('must    supply    string    to    search    for    (contents)')
    term = unicode(term).lower()
    for (cur_key, cur_value) in self.items():
        (cur_key, cur_value) = (unicode(cur_key).lower(), unicode(cur_value).lower())
        if ((key is not None) and (cur_key != key)):
            continue
        if (cur_value.find(unicode(term).lower()) > (-1)):
            return self
