def METHOD_NAME(self, pat):
    _grep.engine._pat = pat
    with captured_stdout() as s:
        _grep.grep_it(re.compile(pat), __file__)
    lines = s.getvalue().split('\n')
    lines.pop()  # remove bogus '' after last \n
    return lines