def METHOD_NAME(spreadsheet, worksheet_num_or_title):
    worksheet = None
    if type(worksheet_num_or_title) is int:
        worksheet = spreadsheet.get_worksheet_by_index(worksheet_num_or_title)
        if worksheet is None:
            worksheet_count = len(spreadsheet.worksheets())
            raise WorksheetNotFoundError(worksheet_num_or_title, worksheet_count)
    elif type(worksheet_num_or_title) is str:
        worksheet = spreadsheet.get_worksheet_by_title(worksheet_num_or_title)
        if worksheet is None:
            raise WorksheetNotFoundByTitleError(worksheet_num_or_title)
    worksheet_values = worksheet.get_all_values()
    return parse_worksheet(worksheet_values)