code: def get_history_from_direct_log(log_file_name):
      """Returns the history from the direct log file."""
      saved_iterations = [0]
      saved_max_vals = [-np.inf]
      phase = "boiler"
      log_file_handle = open(log_file_name, "r")
      for line in log_file_handle.readlines():
          words = line.strip().split()
          if phase == "boiler":
              if words[0] == "Iteration":
                  phase = "results"
          elif phase == "results":
              if len(words) == 3 and words[0].isdigit():
                  saved_iterations.append(int(words[1]))
                  saved_max_vals.append(-float(words[2]))
              else:
                  phase = "final"
          elif phase == "final":
              if words[0] == "Final":
                  saved_max_vals.append(
                      max(-float(words[-1]), saved_max_vals[-1])
                  )
                  # doing max as the fortran library rounds off the last result for some reason.
              if words[0] == "Number":
                  saved_iterations.append(int(words[-1]))
      log_file_handle.close()
      # Now fill in the rest of the history.
      curr_opt_vals = np.zeros((saved_iterations[-1]), dtype=np.float64)
      for i in range(len(saved_iterations) - 1):
          curr_opt_vals[
              saved_iterations[i] : saved_iterations[i + 1]
          ] = saved_max_vals[i]
      curr_opt_vals[-1] = saved_max_vals[-1]
      return Namespace(curr_opt_vals=curr_opt_vals)
  
imports: from __future__ import print_function
  from __future__ import division
  from argparse import Namespace
  from datetime import datetime
  from warnings import warn
  import os
  import numpy
  from .general_utils import map_to_bounds
  from .doo import DOOFunction, pdoo_wrap
label_desc: Use image node_id 8 for calling a global function with example usage: get_history_from_direct_log(log_file_name) and returns: Namespace