parameters: (self, n, center=False)
return_statement: return b
docstring: Resize self.original to an image with nxn pixels (maintain proportion)
      if center, center the colored pixels in the square, else left align
docstring_summary: Resize self.original to an image with nxn pixels (maintain proportion)
      if center, center the colored pixels in the square, else left align
docstring_tokens: Resize self . original to an image with nxn pixels ( maintain proportion ) if center center the colored pixels in the square else left align
function: def resize_to_square(self, n, center=False):
      '''
      Resize self.original to an image with nxn pixels (maintain proportion)
      if center, center the colored pixels in the square, else left align
      '''
      a = self.resize_to_max(n)
      h,w,c = a.shape
      pad_lr = int((n-w)/2) # left right pad
      pad_tb = int((n-h)/2) # top bottom pad
      b = np.zeros((n,n,3))
      if center: b[ pad_tb:pad_tb+h, pad_lr:pad_lr+w, : ] = a
      else: b[:h, :w, :] = a
      return b
function_tokens: def resize_to_square ( self , n , center = False ) : a = self . resize_to_max ( n ) h , w , c = a . shape pad_lr = int ( ( n - w ) / 2 ) # left right pad pad_tb = int ( ( n - h ) / 2 ) # top bottom pad b = np . zeros ( ( n , n , 3 ) ) if center : b [ pad_tb : pad_tb + h , pad_lr : pad_lr + w , : ] = a else : b [ : h , : w , : ] = a return b