code: def ipy_gen_trials(
      proto_flag_vals,
      prev_results_cb,
      suggest_x_cb,
      max_trials=DEFAULT_MAX_TRIALS,
      random_seed=None,
      random_starts=None,
      minimize=None,
      maximize=None,
      suggest_x_opts=None,
      **_kw,
  ):
      objective_scalar, objective_negate = _ipy_objective(
          minimize, maximize
      )
      prev_trials_cb = _ipy_prev_trials_cb(
          prev_results_cb, objective_scalar
      )
      trials_count = 0
      for (
          trial_flag_vals,
          is_trial_random_start,
          prev_trials,
          x0,
      ) in _iter_seq_trials(
          proto_flag_vals,
          objective_negate,
          max_trials,
          random_seed,
          random_starts,
          prev_trials_cb,
          suggest_x_cb,
          suggest_x_opts,
      ):
          _log_seq_trial(
              is_trial_random_start,
              random_starts,
              trials_count,
              x0,
              prev_trials,
              objective_scalar,
          )
          yield trial_flag_vals
          trials_count += 1
  
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 26 for calling a global function with example usage: ipy_gen_trials(proto_flag_vals, prev_results_cb, suggest_x_cb, max_trials, random_seed, random_starts, minimize, maximize, suggest_x_opts) without return types