code: def resize(self, rows=None, cols=None):
          
          grid_properties = {}
  
          if rows is not None:
              grid_properties['rowCount'] = rows
  
          if cols is not None:
              grid_properties['columnCount'] = cols
  
          if not grid_properties:
              raise TypeError("Either 'rows' or 'cols' should be specified.")
  
          fields = ','.join(
              'gridProperties/%s' % p for p in grid_properties.keys()
          )
  
          body = {
              'requests': [{
                  'updateSheetProperties': {
                      'properties': {
                          'sheetId': self.id,
                          'gridProperties': grid_properties
                      },
                      'fields': fields
                  }
              }]
          }
  
          return self.spreadsheet.batch_update(body)
docs: Resizes the worksheet. Specify one of ``rows`` or ``cols``.
  
          :param rows: (optional) New number of rows.
          :type rows: int
          :param cols: (optional) New number columns.
          :type cols: int