class_docstr: Calculate the Munkres solution to the classical assignment problem.
  See the module documentation for usage.
docstr: Pad a possibly non-square matrix to make it square.
  
  :Parameters:
      matrix : list of lists
          matrix to pad
  
      pad_value : int
          value to use to pad the matrix
  
  :rtype: list of lists
  :return: a new, possibly padded, matrix
docstr_tok: ["Pad","a","possibly","non-square","matrix","to","make","it","square",".",":","Parameters",":","matrix",":","list","of","lists","matrix","to","pad","pad_value",":","int","value","to","use","to","pad","the","matrix",":","rtype",":","list","of","lists",":","return",":","a","new",",","possibly","padded",",","matrix"]
code: def pad_matrix(self, matrix, pad_value=0):
      """
      Pad a possibly non-square matrix to make it square.
  
      :Parameters:
          matrix : list of lists
              matrix to pad
  
          pad_value : int
              value to use to pad the matrix
  
      :rtype: list of lists
      :return: a new, possibly padded, matrix
      """
      max_columns = 0
      total_rows = len(matrix)
  
      for row in matrix:
          max_columns = max(max_columns, len(row))
  
      total_rows = max(max_columns, total_rows)
  
      new_matrix = []
      for row in matrix:
          row_len = len(row)
          new_row = row[:]
          if total_rows > row_len:
              # Row too short. Pad it.
              new_row += [0] * (total_rows - row_len)
          new_matrix += [new_row]
  
      while len(new_matrix) < total_rows:
          new_matrix += [[0] * total_rows]
  
      return new_matrix
  
imports: import sys
label_desc: Use image node_id 3 for calling the Munkres obj's underlying member method code with example usage: obj.pad_matrix(matrix, pad_value) and returns: new_matrix