<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def vertex_nodes(self):
 """ Get a list of which vertex indices are nodes, which are either endpoints or points where the entity makes a direction change. Returns nodes : (n, 2) int Indexes of self.vertices which are nodes """

        nodes = np.vstack([e.nodes for e in self.entities])
        return nodes