code: def update_artifacts(input_dir, output_dir):
      # Create a drectory where artifacts will be stored
      os.makedirs(output_dir, exist_ok=True)
  
      # Get the sorted list of existing report_ids
      list_dirs = sorted(map(lambda x: int(x), os.listdir(output_dir)))
      num_reports = len(list_dirs)
  
      # Initial case: When they are less than WINDOW_LEN-1 reports
      if num_reports < WINDOW_LEN - 1:
          add_report_id, del_report_id = num_reports, None
          update_new_report(
              input_dir, output_dir, add_report_id, del_report_id
          )
          return
  
      # When there are WINDOW_LEN - 1 reports and we want to add the new report
      # and remove the oldest report
      for i, report_id in enumerate(list_dirs):
          if i != report_id or (i + 1 == WINDOW_LEN - 1):
              if i != report_id:
                  # When  report_id has a missing element in sequence
                  add_report_id, del_report_id = i, report_id
              else:
                  # When report_id WINDOW_LEN-1 is missing
                  add_report_id, del_report_id = (
                      i + 1,
                      (i + 2) % WINDOW_LEN,
                  )
              update_new_report(
                  input_dir, output_dir, add_report_id, del_report_id
              )
              break
  
imports: import argparse
  import os
  import shutil
label_desc: Use image node_id 3 for calling a global function with example usage: update_artifacts(input_dir, output_dir) without return types