<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nearest(self, nodes):
 """Get the node closest to this one from the given list of nodes. :param nodes: The list of nodes to search. All of these nodes must belong to the same module as this one. The list should be sorted by the line number of the nodes, smallest first. :type nodes: iterable(NodeNG) :returns: The node closest to this one in the source code, or None if one could not be found. :rtype: NodeNG or None """

        myroot = self.root()
        mylineno = self.fromlineno
        nearest = None, 0
        for node in nodes:
            assert node.root() is myroot, (
                "nodes %s and %s are not from the same module" % (self, node)
            )
            lineno = node.fromlineno
            if node.fromlineno > mylineno:
                break
            if lineno > nearest[1]:
                nearest = node, lineno
        # FIXME: raise an exception if nearest is None ?
        return nearest[0]