docs: def set_with_dataframe(worksheet,
                         dataframe,
                         row=1,
                         col=1,
                         include_index=False,
                         include_column_header=True,
                         resize=False,
                         allow_formulas=True):
      """
      Sets the values of a given DataFrame, anchoring its upper-left corner
      at (row, col). (Default is row 1, column 1.)
  
      :param worksheet: the gspread worksheet to set with content of DataFrame.
      :param dataframe: the DataFrame.
      :param include_index: if True, include the DataFrame's index as an
              additional column. Defaults to False.
      :param include_column_header: if True, add a header row before data with
              column names. (If include_index is True, the index's name will be
              used as its column's header.) Defaults to True.
      :param resize: if True, changes the worksheet's size to match the shape
              of the provided DataFrame. If False, worksheet will only be
              resized as necessary to contain the DataFrame contents.
              Defaults to False.
      :param allow_formulas: if True, interprets `=foo` as a formula in
              cell values; otherwise all text beginning with `=` is escaped
              to avoid its interpretation as a formula. Defaults to True.
      """
      # x_pos, y_pos refers to the position of data rows only,
      # excluding any header rows in the google sheet.
      # If header-related params are True, the values are adjusted
      # to allow space for the headers.
      y, x = dataframe.shape
      if include_index:
          x += 1
      if include_column_header:
          y += 1
      if resize:
          worksheet.resize(y, x)
      else:
          _resize_to_minimum(worksheet, y, x)
  
      updates = []
  
      if include_column_header:
          elts = list(dataframe.columns)
          if include_index:
              elts = [ dataframe.index.name ] + elts
          for idx, val in enumerate(elts):
              updates.append(
                  (row,
                   col+idx,
                   _cellrepr(val, allow_formulas))
              )
          row += 1
  
      values = []
      for value_row, index_value in zip_longest(dataframe.values, dataframe.index):
          if include_index:
              value_row = [index_value] + list(value_row)
          values.append(value_row)
      for y_idx, value_row in enumerate(values):
          for x_idx, cell_value in enumerate(value_row):
              updates.append(
                  (y_idx+row,
                   x_idx+col,
                   _cellrepr(cell_value, allow_formulas))
              )
  
      if not updates:
          logger.debug("No updates to perform on worksheet.")
          return
  
      cells_to_update = [ Cell(row, col, value) for row, col, value in updates ]
      logger.debug("%d cell updates to send", len(cells_to_update))
  
      resp = worksheet.update_cells(cells_to_update, value_input_option='USER_ENTERED')
      logger.debug("Cell update response: %s", resp)