def _get_indent_hint_line(bar_positions, bad_position):
 if (not bar_positions):
  return ''
 markers = [(pos, '|') for pos in bar_positions]
 markers.append((bad_position, '^'))
 markers.sort()
 line = ([' '] * (markers[(-1)][0] + 1))
 for (position, marker) in markers:
  line[position] = marker
 return ''.join(line)

def _get_indent_hint_line ( bar_positions , bad_position ) : if ( not bar_positions ) : return '' markers = [ ( pos , '|' ) for pos in bar_positions ] markers . append ( ( bad_position , '^' ) ) markers . sort ( ) line = ( [ ' ' ] * ( markers [ ( - 1 ) ] [ 0 ] + 1 ) ) for ( position , marker ) in markers : line [ position ] = marker return '' . join ( line )
return a line with |s for each of the positions in the given lists .