def find(self, search_term, index=False):
hits = []<EOL>for i, iv in enumerate(self):<EOL><INDENT>try:<EOL><INDENT>search_text = iv.description or iv.primary.summary()<EOL>pattern = re.compile(search_term, flags=re.IGNORECASE)<EOL>if pattern.search(search_text):<EOL><INDENT>hits.append(i)<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>if search_term in iv.components:<EOL><INDENT>hits.append(i)<EOL><DEDENT><DEDENT><DEDENT>if hits and index:<EOL><INDENT>return hits<EOL><DEDENT>elif hits:<EOL><INDENT>return self[hits]<EOL><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT>
Look for a regex expression in the descriptions of the striplog.
If there's no description, it looks in the summaries.

If you pass a Component, then it will search the components, not the
descriptions or summaries.

Case insensitive.

Args:
    search_term (string or Component): The thing you want to search
        for. Strings are treated as regular expressions.
    index (bool): Whether to return the index instead of the interval.
Returns:
    Striplog: A striplog that contains only the 'hit' Intervals.
        However, if ``index`` was ``True``, then that's what you get.