def METHOD_NAME(notebookdirectory):    
    """Process Notebook."""
    status = False
    try:
        retry_times = int(os.getenv('RETRY_TIMES', '1'))
        retry_interval = int(os.getenv('RETRY_INTERVAL', '60'))
        if notebookdirectory == 'weekly':
            week_report_dates = ast.literal_eval(os.getenv('WEEKLY_REPORT_DATES', ''))
    except Exception:
        logging.exception('Error processing notebook for %s', notebookdirectory)
        send_email(notebookdirectory, 'ERROR', traceback.format_exc())
        return status
    # For weekly tasks, we only run on the specified days
    if notebookdirectory == 'weekly' and date.today().weekday() in week_report_dates:        
        logging.info('Processing: %s', notebookdirectory)
        num_files = len(os.listdir(notebookdirectory))
        file_processed = 0
        for file in findfiles(notebookdirectory, '*.ipynb'):
            file_processed += 1
            note_book = os.path.basename(file)
            for attempt in range(retry_times):
                try:                    
                    pm.execute_notebook(file, os.getenv('DATA_DIR', '')+'temp.ipynb', parameters=None)
                    send_email(note_book, '', '')
                    os.remove(os.getenv('DATA_DIR', '')+'temp.ipynb')                    
                    status = True                    
                    break
                except Exception:
                    if attempt + 1 == retry_times:
                        # If any errors occur with the notebook processing they will be logged to the log file
                        logging.exception(
                            'Error processing notebook %s at %s/%s try.', notebookdirectory, attempt + 1,
                            retry_times)
                        send_email(notebookdirectory, 'ERROR', traceback.format_exc())
                    else:
                        # If any errors occur with the notebook processing they will be logged to the log file
                        logging.exception('Error processing notebook %s at %s/%s try. '
                                          'Sleeping for %s secs before next try', notebookdirectory, attempt + 1,
                                          retry_times, retry_interval)
                        time.sleep(retry_interval)
                        continue
            if not status and num_files == file_processed:
                break
    return status