def bresenham(x0, y0, x1, y1):
dx = x1 - x0<EOL>dy = y1 - y0<EOL>xsign = <NUM_LIT:1> if dx > <NUM_LIT:0> else -<NUM_LIT:1><EOL>ysign = <NUM_LIT:1> if dy > <NUM_LIT:0> else -<NUM_LIT:1><EOL>dx = abs(dx)<EOL>dy = abs(dy)<EOL>if dx > dy:<EOL><INDENT>xx, xy, yx, yy = xsign, <NUM_LIT:0>, <NUM_LIT:0>, ysign<EOL><DEDENT>else:<EOL><INDENT>dx, dy = dy, dx<EOL>xx, xy, yx, yy = <NUM_LIT:0>, ysign, xsign, <NUM_LIT:0><EOL><DEDENT>D = <NUM_LIT:2>*dy - dx<EOL>y = <NUM_LIT:0><EOL>for x in range(dx + <NUM_LIT:1>):<EOL><INDENT>yield x0 + x*xx + y*yx, y0 + x*xy + y*yy<EOL>if D >= <NUM_LIT:0>:<EOL><INDENT>y += <NUM_LIT:1><EOL>D -= <NUM_LIT:2>*dx<EOL><DEDENT>D += <NUM_LIT:2>*dy<EOL><DEDENT>
Yield integer coordinates on the line from (x0, y0) to (x1, y1).

    Input coordinates should be integers.

    The result will contain both the start and the end point.