docs: def _decode_lines(geom):
      """
      Decode a linear MVT geometry into a list of Lines.
  
      Each individual linestring in the MVT is extracted to a separate entry in
      the list of lines.
      """
  
      lines = []
      current_line = []
      current_moveto = None
  
      # to keep track of the position. we'll adapt the move-to commands to all
      # be relative to 0,0 at the beginning of each linestring.
      x = 0
      y = 0
  
      end = len(geom)
      i = 0
      while i < end:
          header = geom[i]
          cmd = header & 7
          run_length = header // 8
  
          if cmd == 1:  # move to
              # flush previous line.
              if current_moveto:
                  lines.append(Line(current_moveto, EndsAt(x, y), current_line))
                  current_line = []
  
              assert run_length == 1
              x += unzigzag(geom[i+1])
              y += unzigzag(geom[i+2])
              i += 3
  
              current_moveto = MoveTo(x, y)
  
          elif cmd == 2:  # line to
              assert current_moveto
  
              # we just copy this run, since it's encoding isn't going to change
              next_i = i + 1 + run_length * 2
              current_line.extend(geom[i:next_i])
  
              # but we still need to decode it to figure out where each move-to
              # command is in absolute space.
              for j in xrange(0, run_length):
                  dx = unzigzag(geom[i + 1 + 2 * j])
                  dy = unzigzag(geom[i + 2 + 2 * j])
                  x += dx
                  y += dy
  
              i = next_i
  
          else:
              raise ValueError('Unhandled command: %d' % cmd)
  
      if current_line:
          assert current_moveto
          lines.append(Line(current_moveto, EndsAt(x, y), current_line))
  
      return lines