code: def _ipy_prev_trials_cb(prev_results_cb, objective_scalar):
      def f():
          runs, _results = prev_results_cb()
          return batch_util.trial_results_for_runs(
              runs, [objective_scalar]
          )
  
      return f
  
imports: import logging
  import os
  import typing
  import warnings
  from guild import _skopt
  from guild import batch_util
  from guild import flag_util
  from guild import op_util
  from guild import query
label_desc: Use image node_id 29 for calling a global function with example usage: _ipy_prev_trials_cb(prev_results_cb, objective_scalar) and returns: f, batch_util