# Buggy code
def _filter_stmts(self, stmts, frame, offset):
    """filter 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
    """
    # if offset == -1, my actual frame is not the inner frame but its parent
    #
    # class A(B): pass
    #
    # we need this to resolve B correctly
    if offset == -1:
        myframe = self.frame().parent.frame()
    else:
        myframe = self.frame()
        # If the frame of this node is the same as the statement
        # of this node, then the node is part of a class or
        # a function definition and the frame of this node should be the
        # the upper frame, not the frame of the definition.
        # For more information why this is important,
        # see Pylint issue #295.
        # For example, for 'b', the statement is the same
        # as the frame / scope:
        #
        # def test(b=1):
        #     ...

        if self.statement() is myframe and myframe.parent:
            myframe = myframe.parent.frame()

    mystmt = self.statement()
    # line filtering if we are in the same frame
    #
    # take care node may be missing lineno information (this is the case for
    # nodes inserted for living objects)
    if myframe is frame and mystmt.fromlineno is not None:
        assert mystmt.fromlineno is not None, mystmt
        mylineno = mystmt.fromlineno + offset
    else:
        # disabling lineno filtering
        mylineno = 0
    _stmts = []
    _stmt_parents = []
    for node in stmts:
        stmt = node.statement()
        # line filtering is on and we have reached our location, break
        if mylineno > 0 and stmt.fromlineno > mylineno:
            break
        assert hasattr(node, "assign_type"), (node, node.scope(), node.scope().locals)
        assign_type = node.assign_type()

        if node.has_base(self):
            break

        _stmts, done = assign_type._get_filtered_stmts(self, node, _stmts, mystmt)
        if done:
            break

        optional_assign = assign_type.optional_assign
        if optional_assign and assign_type.parent_of(self):
            # we are inside a loop, loop var assigment is hidding previous
            # assigment
            _stmts = [node]
            _stmt_parents = [stmt.parent]
            continue

        # XXX comment various branches below!!!
        try:
            pindex = _stmt_parents.index(stmt.parent)
        except ValueError:
            pass
        else:
            # we got a parent index, this means the currently visited node
            # is at the same block level as a previously visited node
            if _stmts[pindex].assign_type().parent_of(assign_type):
                # both statements are not at the same block level
                continue
            # if currently visited node is following previously considered
            # assignement and both are not exclusive, we can drop the
            # previous one. For instance in the following code ::
            #
            #   if a:
            #     x = 1
            #   else:
            #     x = 2
            #   print x
            #
            # we can't remove neither x = 1 nor x = 2 when looking for 'x'
            # of 'print x'; while in the following ::
            #
            #   x = 1
            #   x = 2
            #   print x
            #
            # we can remove x = 1 when we see x = 2
            #
            # moreover, on loop assignment types, assignment won't
            # necessarily be done if the loop has no iteration, so we don't
            # want to clear previous assigments if any (hence the test on
            # optional_assign)
            if not (
                optional_assign or interpreterutil.are_exclusive(_stmts[pindex], node)
            ):
                del _stmt_parents[pindex]
                del _stmts[pindex]
        if isinstance(node, treeabc.AssignName):
            if not optional_assign and stmt.parent is mystmt.parent:
                _stmts = []
                _stmt_parents = []
        elif isinstance(node, treeabc.DelName):
            _stmts = []
            _stmt_parents = []
            continue
        if not interpreterutil.are_exclusive(self, node):
            _stmts.append(node)
            _stmt_parents.append(stmt.parent)
    return _stmts


# Traceback (AssertionError)
FAIL: test_builtin_fromlineno_missing (unittest_nodes.ArgumentsNodeTC)
----------------------------------------------------------------------
Traceback (most recent call last):
File "~/code/astroid/.tox/py34/lib/python3.4/site-packages/astroid/tests/unittest_nodes.py", line 479, in test_builtin_fromlineno_missing
self.assertEqual(new.args.fromlineno, 0)
AssertionError: 1 != 0

# Fixed code
def _filter_stmts(self, stmts, frame, offset):
    """filter 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
    """
    # if offset == -1, my actual frame is not the inner frame but its parent
    #
    # class A(B): pass
    #
    # we need this to resolve B correctly
    if offset == -1:
        myframe = self.frame().parent.frame()
    else:
        myframe = self.frame()
        # If the frame of this node is the same as the statement
        # of this node, then the node is part of a class or
        # a function definition and the frame of this node should be the
        # the upper frame, not the frame of the definition.
        # For more information why this is important,
        # see Pylint issue #295.
        # For example, for 'b', the statement is the same
        # as the frame / scope:
        #
        # def test(b=1):
        #     ...

        if self.statement() is myframe and myframe.parent:
            myframe = myframe.parent.frame()

    mystmt = self.statement()
    # line filtering if we are in the same frame
    #
    # take care node may be missing lineno information (this is the case for
    # nodes inserted for living objects)
    if myframe is frame and mystmt.fromlineno is not None:
        mylineno = mystmt.fromlineno + offset
    else:
        # disabling lineno filtering
        mylineno = 0
    _stmts = []
    _stmt_parents = []
    for node in stmts:
        stmt = node.statement()
        # line filtering is on and we have reached our location, break
        if mylineno > 0 and stmt.fromlineno and stmt.fromlineno > mylineno:
            break
        assert hasattr(node, "assign_type"), (node, node.scope(), node.scope().locals)
        assign_type = node.assign_type()

        if node.has_base(self):
            break

        _stmts, done = assign_type._get_filtered_stmts(self, node, _stmts, mystmt)
        if done:
            break

        optional_assign = assign_type.optional_assign
        if optional_assign and assign_type.parent_of(self):
            # we are inside a loop, loop var assigment is hidding previous
            # assigment
            _stmts = [node]
            _stmt_parents = [stmt.parent]
            continue

        # XXX comment various branches below!!!
        try:
            pindex = _stmt_parents.index(stmt.parent)
        except ValueError:
            pass
        else:
            # we got a parent index, this means the currently visited node
            # is at the same block level as a previously visited node
            if _stmts[pindex].assign_type().parent_of(assign_type):
                # both statements are not at the same block level
                continue
            # if currently visited node is following previously considered
            # assignement and both are not exclusive, we can drop the
            # previous one. For instance in the following code ::
            #
            #   if a:
            #     x = 1
            #   else:
            #     x = 2
            #   print x
            #
            # we can't remove neither x = 1 nor x = 2 when looking for 'x'
            # of 'print x'; while in the following ::
            #
            #   x = 1
            #   x = 2
            #   print x
            #
            # we can remove x = 1 when we see x = 2
            #
            # moreover, on loop assignment types, assignment won't
            # necessarily be done if the loop has no iteration, so we don't
            # want to clear previous assigments if any (hence the test on
            # optional_assign)
            if not (
                optional_assign or interpreterutil.are_exclusive(_stmts[pindex], node)
            ):
                del _stmt_parents[pindex]
                del _stmts[pindex]
        if isinstance(node, treeabc.AssignName):
            if not optional_assign and stmt.parent is mystmt.parent:
                _stmts = []
                _stmt_parents = []
        elif isinstance(node, treeabc.DelName):
            _stmts = []
            _stmt_parents = []
            continue
        if not interpreterutil.are_exclusive(self, node):
            _stmts.append(node)
            _stmt_parents.append(stmt.parent)
    return _stmts