code: def line(p0, p1, canvas, color=1):
      """
      line((y0,x0), (y1,x1), canvas, color=1)
  
      Draw a line
  
      Parameters
      ----------
      p0 : pair of integers
          first point
      p1 : pair of integers
          second point
      canvas : ndarray
          where to draw, will be modified in place
      color : integer, optional
          which value to store on the pixels (default: 1)
  
      notes
      -----
      `Implementation Reference <https://en.wikipedia.org/wiki/Bresenham's_line_algorithm>`__
      """
      y0, x0 = p0
      y1, x1 = p1
      steep = abs(y1 - y0) > abs(x1 - x0)
      if steep:
          x0, y0 = y0, x0
          x1, y1 = y1, x1
      if x0 > x1:
          x0, x1 = x1, x0
          y0, y1 = y1, y0
      dx = x1 - x0
      dy = abs(y1 - y0)
      error = dx / 2.0
      y = y0
      ystep = +1 if y0 < y1 else -1
      for x in range(x0, x1 + 1):
          if steep:
              canvas[x, y] = color
          else:
              canvas[y, x] = color
          error -= dy
          if error < 0:
              y += ystep
              error += dx
  
imports: from __future__ import division
  import numpy
  from .None import _convex
label_desc: Use image node_id 1 for calling a global function with example usage: line(p0, p1, canvas, color) without return types