def find(self, y):
node = self.root<EOL>while True:<EOL><INDENT>edge = self._edgeLabel(node, node.parent)<EOL>if edge.startswith(y):<EOL><INDENT>return node.idx<EOL><DEDENT>i = <NUM_LIT:0><EOL>while(i < len(edge) and edge[i] == y[<NUM_LIT:0>]):<EOL><INDENT>y = y[<NUM_LIT:1>:]<EOL>i += <NUM_LIT:1><EOL><DEDENT>if i != <NUM_LIT:0>:<EOL><INDENT>if i == len(edge) and y != '<STR_LIT>':<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT><DEDENT>node = node._get_transition_link(y[<NUM_LIT:0>])<EOL>if not node:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT><DEDENT>
Returns starting position of the substring y in the string used for
        building the Suffix tree.

        :param y: String
        :return: Index of the starting position of string y in the string used for building the Suffix tree
                 -1 if y is not a substring.