original_docstring:  creates calendar layout as a word table. 
docstring: creates calendar layout as a word table.
docstring_tokens: creates calendar layout as a word table .
code: def add_dates_to_header(table,first_day,num_days):
  
      ''' creates calendar layout as a word table. ''' 
      
      header_cells = table.rows[0].cells
  
      days_list = []
      if WEEK_STARTS_ON == "Monday":
          days_names = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
      elif WEEK_STARTS_ON == "Sunday":
          days_names = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']
  
      for i in range(7):
          n = first_day+i
          number = determine_day(n,num_days)
          number_day = f'{days_names[i]} {number}'
          days_list.append(number_day)
  
      for day in range(7):
          header_cells[day+1].text = days_list[day]
          p = header_cells[day+1].paragraphs[0]
          header_cells[day+1].vertical_alignment = WD_ALIGN_VERTICAL.CENTER
          p_format = p.paragraph_format
          p_format.alignment = WD_ALIGN_PARAGRAPH.CENTER
          cell_grey_bg = parse_xml(r'<w:shd {} w:fill="f2f2f2"/>'.format(nsdecls('w')))
          header_cells[day+1]._tc.get_or_add_tcPr().append(cell_grey_bg)
code_tokens: def add_dates_to_header ( table , first_day , num_days ) : header_cells = table . rows [ 0 ] . cells days_list = [ ] if WEEK_STARTS_ON == "Monday" : days_names = [ 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' , 'Sunday' ] elif WEEK_STARTS_ON == "Sunday" : days_names = [ 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' ] for i in range ( 7 ) : n = first_day + i number = determine_day ( n , num_days ) number_day = f'{days_names[i]} {number}' days_list . append ( number_day ) for day in range ( 7 ) : header_cells [ day + 1 ] . text = days_list [ day ] p = header_cells [ day + 1 ] . paragraphs [ 0 ] header_cells [ day + 1 ] . vertical_alignment = WD_ALIGN_VERTICAL . CENTER p_format = p . paragraph_format p_format . alignment = WD_ALIGN_PARAGRAPH . CENTER cell_grey_bg = parse_xml ( r'<w:shd {} w:fill="f2f2f2"/>' . format ( nsdecls ( 'w' ) ) ) header_cells [ day + 1 ] . _tc . get_or_add_tcPr ( ) . append ( cell_grey_bg )
short_docstring: creates calendar layout as a word table.
short_docstring_tokens: creates calendar layout as a word table .
comment: ''' creates calendar layout as a word table. '''