def text_coords(string, position):
line_start = string.rfind('<STR_LIT:\n>', <NUM_LIT:0>, position) + <NUM_LIT:1><EOL>line_end = string.find('<STR_LIT:\n>', position)<EOL>lineno = string.count('<STR_LIT:\n>', <NUM_LIT:0>, position)<EOL>columnno = position - line_start<EOL>line = string[line_start:line_end]<EOL>return (lineno, columnno, line)<EOL>
r"""
    Transform a simple index into a human-readable position in a string.

    This function accepts a string and an index, and will return a triple of
    `(lineno, columnno, line)` representing the position through the text. It's
    useful for displaying a string index in a human-readable way::

        >>> s = "abcdef\nghijkl\nmnopqr\nstuvwx\nyz"
        >>> text_coords(s, 0)
        (0, 0, 'abcdef')
        >>> text_coords(s, 4)
        (0, 4, 'abcdef')
        >>> text_coords(s, 6)
        (0, 6, 'abcdef')
        >>> text_coords(s, 7)
        (1, 0, 'ghijkl')
        >>> text_coords(s, 11)
        (1, 4, 'ghijkl')
        >>> text_coords(s, 15)
        (2, 1, 'mnopqr')