def TransposeTable(table):
  """Transpose a list of lists, using None to extend all input lists to the
  same length.

  For example:
  >>> TransposeTable(
  [ [11,   12,   13],
    [21,   22],
    [31,   32,   33,   34]])

  [ [11,   21,   31],
    [12,   22,   32],
    [13,   None, 33],
    [None, None, 34]]
  """
  transposed = []
  rows = len(table)
  cols = max(len(row) for row in table)
  for x in range(cols):
    transposed.append([])
    for y in range(rows):
      if len(table[y]) < x:
        transposed[x].append(table[y][x])
      else:
        transposed[x].append(None)
  return transposed
dataset/ETHPy150Open google/transitfeed/examples/table.py/TransposeTable/swapped operands of `<`