def _format_position(data, pos):
 line = 0
 col = 0
 llb = u''
 for c in data[:pos]:
  if ((c == u'\r') or (c == u'\n')):
   if (llb and (c != llb)):
    llb = u''
   else:
    line += 1
    col = 0
    llb = c
  else:
   col += 1
   llb = u''
 return u'line {0}, column {1}'.format((line + 1), (col + 1))

def _format_position ( data , pos ) : line = 0 col = 0 llb = u'' for c in data [ : pos ] : if ( ( c == u'\r' ) or ( c == u'\n' ) ) : if ( llb and ( c != llb ) ) : llb = u'' else : line += 1 col = 0 llb = c else : col += 1 llb = u'' return u'line {0}, column {1}' . format ( ( line + 1 ) , ( col + 1 ) )
return position formatted as line/column .