def _filter_stmts(self, stmts, frame, offset):
<EOL>if offset == -<NUM_LIT:1>:<EOL><INDENT>myframe = self.frame().parent.frame()<EOL><DEDENT>else:<EOL><INDENT>myframe = self.frame()<EOL>if self.statement() is myframe and myframe.parent:<EOL><INDENT>myframe = myframe.parent.frame()<EOL><DEDENT><DEDENT>mystmt = self.statement()<EOL>if myframe is frame and mystmt.fromlineno is not None:<EOL><INDENT>assert mystmt.fromlineno is not None, mystmt<EOL>mylineno = mystmt.fromlineno + offset<EOL><DEDENT>else:<EOL><INDENT>mylineno = <NUM_LIT:0><EOL><DEDENT>_stmts = []<EOL>_stmt_parents = []<EOL>statements = self._get_filtered_node_statements(stmts)<EOL>for node, stmt in statements:<EOL><INDENT>if stmt.fromlineno > mylineno > <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>if mystmt is stmt and is_from_decorator(self):<EOL><INDENT>continue<EOL><DEDENT>assert hasattr(node, "<STR_LIT>"), (<EOL>node,<EOL>node.scope(),<EOL>node.scope().locals,<EOL>)<EOL>assign_type = node.assign_type()<EOL>if node.has_base(self):<EOL><INDENT>break<EOL><DEDENT>_stmts, done = assign_type._get_filtered_stmts(self, node, _stmts, mystmt)<EOL>if done:<EOL><INDENT>break<EOL><DEDENT>optional_assign = assign_type.optional_assign<EOL>if optional_assign and assign_type.parent_of(self):<EOL><INDENT>_stmts = [node]<EOL>_stmt_parents = [stmt.parent]<EOL>continue<EOL><DEDENT>try:<EOL><INDENT>pindex = _stmt_parents.index(stmt.parent)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if _stmts[pindex].assign_type().parent_of(assign_type):<EOL><INDENT>continue<EOL><DEDENT>if not (optional_assign or are_exclusive(_stmts[pindex], node)):<EOL><INDENT>if (<EOL>not node.is_function<EOL>or node.qname() != "<STR_LIT>"<EOL>or node.name != _stmts[pindex].name<EOL>):<EOL><INDENT>del _stmt_parents[pindex]<EOL>del _stmts[pindex]<EOL><DEDENT><DEDENT><DEDENT>if isinstance(node, AssignName):<EOL><INDENT>if not optional_assign and stmt.parent is mystmt.parent:<EOL><INDENT>_stmts = []<EOL>_stmt_parents = []<EOL><DEDENT><DEDENT>elif isinstance(node, DelName):<EOL><INDENT>_stmts = []<EOL>_stmt_parents = []<EOL>continue<EOL><DEDENT>if not are_exclusive(self, node):<EOL><INDENT>_stmts.append(node)<EOL>_stmt_parents.append(stmt.parent)<EOL><DEDENT><DEDENT>return _stmts<EOL>
Filter the given list of statements to remove ignorable statements.

        If self is not a frame itself and the name is found in the inner
        frame locals, statements will be filtered to remove ignorable
        statements according to self's location.

        :param stmts: The statements to filter.
        :type stmts: list(NodeNG)

        :param frame: The frame that all of the given statements belong to.
        :type frame: NodeNG

        :param offset: The line offset to filter statements up to.
        :type offset: int

        :returns: The filtered statements.
        :rtype: list(NodeNG)