<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lineage(self, h):
 """ Returns the lineage of histories leading up to `h`. """


        lineage = [ ]

        predecessors = list(self._graph.predecessors(h))
        while len(predecessors):
            lineage.append(predecessors[0])
            predecessors = list(self._graph.predecessors(predecessors[0]))

        lineage.reverse()
        return lineage