def _get_sheet_from_workbook(workbook, sheet_index=None):
    """Returns a sheet from a Workbook; default active or at the given index

    By default returns the active worksheet from the given openpyxl.Workbook
    instance, but if given a sheet_index argument, the sheet at that index
    will instead be returned

    Args:
        workbook (openpyxl.Workbook): The workbook to select a sheet from.
        sheet_index (int, optional): The index of the worksheet to return.
            A value of None returns the active worksheet. Defaults to None.

    Returns:
        openpyxl.worksheet.Worksheet: The active or selected worksheet.
    """
    if sheet_index is None:
        return workbook.active
    return workbook.worksheets[sheet_index]