def _recurse_find_trace(self, structure, item, trace=[]):
        """
        given a nested structure from _parse_repr and find the trace route to get to item
        """

        try:
            i = structure.index(item)
        except ValueError:
            for j,substructure in enumerate(structure):
                if isinstance(substructure, list):
                    return self._recurse_find_trace(substructure, item, trace+[j])
        else:
            return trace+[i]
def _recurse_find_trace ( self , structure , item , trace = [ ] ) : try : i = structure . index ( item ) except ValueError : for j , substructure in enumerate ( structure ) : if isinstance ( substructure , list ) : return self . _recurse_find_trace ( substructure , item , trace + [ j ] ) else : return trace + [ i ]
given a nested structure from _parse_repr and find the trace route to get to item