comefrom: <qiyuangong>221_Maximal_Square_1.py
code: def maximalSquare( matrix):
      if matrix is None or len(matrix) == 0:
          return 0
      rows, cols = len(matrix), len(matrix[0])
      res = 0
      for i in range(rows):
          for j in range(cols):
              if matrix[i][j] == '1':
                  sqlen, flag = 1, True
                  while sqlen + i < rows and sqlen + j < cols and flag:
                      for k in range(j, sqlen + j + 1):
                          if matrix[i + sqlen][k] == '0':
                              flag = False
                              break
                      for k in range(i, sqlen + i + 1):
                          if matrix[k][j + sqlen] == '0':
                              flag = False
                              break
                      if flag:
                          sqlen += 1
                  if res < sqlen:
                      res = sqlen
      return res * res
masked: def sample_funcname ( var_0 ) :
      if var_0 is None or len ( var_0 ) == 0 :
          return 0
      var_1 , var_2 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_3 = 0
      for var_4 in range ( var_1 ) :
          for var_5 in range ( var_2 ) :
              if var_0 [ var_4 ] [ var_5 ] == '1' :
                  var_6 , var_7 = 1 , True
                  while var_6 + var_4 < var_1 and var_6 + var_5 < var_2 and var_7 :
                      for var_8 in range ( var_5 , var_6 + var_5 + 1 ) :
                          if var_0 [ var_4 + var_6 ] [ var_8 ] == '0' :
                              var_7 = False
                              break
                      for var_8 in range ( var_4 , var_6 + var_4 + 1 ) :
                          if var_0 [ var_8 ] [ var_5 + var_6 ] == '0' :
                              var_7 = False
                              break
                      if var_7 :
                          var_6 += 1
                  if var_3 < var_6 :
                      var_3 = var_6
      return var_3 * var_3
  