code: def calculate_recent_window_average(arr, window_size, num_entries):
      if len(arr) > 0:
          begin = max(0, len(arr) - window_size)
          return np.mean(np.array(arr[begin:]), axis=0)
      else:
          logger.error("Not enough samples for evaluation.")
          if num_entries == 1:
              return float("nan")
          else:
              return [float("nan")] * num_entries
  
imports: import logging
  from math import ceil
  from typing import Dict, List
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_recent_window_average(arr, window_size, num_entries) and returns: np, float, unknown