original_docstring:  create weekly calendar using the chosen monday as an input in MM/DD/YYYY format 
docstring: create weekly calendar using the chosen monday as an input in MM/DD/YYYY format
docstring_tokens: create weekly calendar using the chosen monday as an input in MM / DD / YYYY format
code: def create_week(input_date,output_folder):
  
      TYPE_OF_CAL = "week"
  
      ''' create weekly calendar using the chosen monday as an input in MM/DD/YYYY format '''
  
      # get user input and turn it into usable data and strings 
      in_month = int(input_date[1])
      in_day = int(input_date[2])
      in_year = int(input_date[0])
  
      # user number input -> string english output
      num_days = calendar.monthrange(in_year,in_month)[1] 
  
      # generate csv file from input
      csv_weekBegin = f"{in_month}/{in_day}/{in_year}"
      
      # create range of dates and header/file name
      if determine_day(in_day+6,num_days) < in_day:
          # if the week ends in a new month or year, name file and header appropriately
          if in_month + 1 == 13:
              # if the last week containing dates from december goes into january, change date to be january of next year 
              csv_weekEnd = f"{1}/{determine_day(in_day+6,num_days)}/{in_year+1}"
              month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} {in_year} to {calendar.month_name[1]} {determine_day(in_day+6,num_days)} {in_year+1}'
          else:
              csv_weekEnd = f"{in_month+1}/{determine_day(in_day+6,num_days)}/{in_year}"
              month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} to {calendar.month_name[in_month+1]} {determine_day(in_day+6,num_days)} {in_year}'
          new_month = True
      
      else:
          # if the week ends in the same month, name file and header appropriately also 
          csv_weekEnd = f"{in_month}/{determine_day(in_day+6,num_days)}/{in_year}"
          month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} to {in_day+6} {in_year}'
          new_month = False
  
      # generate CSV file and get filename
      print("Getting events from .ical file... ", end="")
      csv_filename = csvgen.calgen(csv_weekBegin,csv_weekEnd,TYPE_OF_CAL)
      print("Done!")
  
      # set up document properties
      print("Setting up document... ", end="")
      document, table = setup_document(month_year_day,TYPE_OF_CAL)
      print("Done!")
  
      # draw table based on calendar for filling 
      print("Adding Monday through Sunday to header... ", end="")
      add_dates_to_header(table,in_day,num_days)
      print("Done!")
      
      # get events in array form
      print("Getting and converting events into array... ", end="")
      week_events = get_events(csv_filename,in_day,num_days,TYPE_OF_CAL)
      print("Done!")
  
      # add events from array
      print("Adding events to table cells:\n")
      add_events_to_week(table,week_events)
      print("Done adding events!")
  
      # create file name and save file
      document_name = month_year_day + '.docx'
      document_name = os.path.join(output_folder, document_name)
  
      document.save(document_name)
      
      return document_name, csv_filename
code_tokens: def create_week ( input_date , output_folder ) : TYPE_OF_CAL = "week" in_month = int ( input_date [ 1 ] ) in_day = int ( input_date [ 2 ] ) in_year = int ( input_date [ 0 ] ) num_days = calendar . monthrange ( in_year , in_month ) [ 1 ] csv_weekBegin = f"{in_month}/{in_day}/{in_year}" if determine_day ( in_day + 6 , num_days ) < in_day : if in_month + 1 == 13 : csv_weekEnd = f"{1}/{determine_day(in_day+6,num_days)}/{in_year+1}" month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} {in_year} to {calendar.month_name[1]} {determine_day(in_day+6,num_days)} {in_year+1}' else : csv_weekEnd = f"{in_month+1}/{determine_day(in_day+6,num_days)}/{in_year}" month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} to {calendar.month_name[in_month+1]} {determine_day(in_day+6,num_days)} {in_year}' new_month = True else : csv_weekEnd = f"{in_month}/{determine_day(in_day+6,num_days)}/{in_year}" month_year_day = f'Week of {calendar.month_name[in_month]} {in_day} to {in_day+6} {in_year}' new_month = False print ( "Getting events from .ical file... " , end = "" ) csv_filename = csvgen . calgen ( csv_weekBegin , csv_weekEnd , TYPE_OF_CAL ) print ( "Done!" ) print ( "Setting up document... " , end = "" ) document , table = setup_document ( month_year_day , TYPE_OF_CAL ) print ( "Done!" ) print ( "Adding Monday through Sunday to header... " , end = "" ) add_dates_to_header ( table , in_day , num_days ) print ( "Done!" ) print ( "Getting and converting events into array... " , end = "" ) week_events = get_events ( csv_filename , in_day , num_days , TYPE_OF_CAL ) print ( "Done!" ) print ( "Adding events to table cells:\n" ) add_events_to_week ( table , week_events ) print ( "Done adding events!" ) document_name = month_year_day + '.docx' document_name = os . path . join ( output_folder , document_name ) document . save ( document_name ) return document_name , csv_filename
short_docstring: create weekly calendar using the chosen monday as an input in MM/DD/YYYY format
short_docstring_tokens: create weekly calendar using the chosen monday as an input in MM / DD / YYYY format
comment: ''' create weekly calendar using the chosen monday as an input in MM/DD/YYYY format '''$SEP$# get user input and turn it into usable data and strings $SEP$# user number input -> string english output$SEP$# generate csv file from input$SEP$# create range of dates and header/file name$SEP$# if the week ends in a new month or year, name file and header appropriately$SEP$# if the last week containing dates from december goes into january, change date to be january of next year $SEP$# if the week ends in the same month, name file and header appropriately also $SEP$# generate CSV file and get filename$SEP$# set up document properties$SEP$# draw table based on calendar for filling $SEP$# get events in array form$SEP$# add events from array$SEP$# create file name and save file