code: def _run_seq_trials(batch_run, suggest_x_cb):
      proto_flag_vals = batch_run.batch_proto.get("flags")
      batch_flag_vals = batch_run.get("flags")
      max_trials = batch_run.get("max_trials") or DEFAULT_MAX_TRIALS
      random_state = batch_run.get("random_seed")
      random_starts = min(
          batch_flag_vals.get("random-starts") or 0, max_trials
      )
      objective_scalar, objective_negate = _objective_y_info(batch_run)
      prev_trials_model = (
          batch_flag_vals.get("prev-trials")
          or batch_util.PREV_TRIALS_BATCH
      )
      prev_trials_cb = lambda: batch_util.trial_results(
          batch_run, [objective_scalar], prev_trials_model
      )
      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_state,
          random_starts,
          prev_trials_cb,
          suggest_x_cb,
          batch_flag_vals,
      ):
          _log_seq_trial(
              is_trial_random_start,
              random_starts,
              trials_count,
              x0,
              prev_trials,
              objective_scalar,
          )
          trial_run = batch_util.init_trial_run(
              batch_run, trial_flag_vals
          )
          try:
              batch_util.start_trial_run(trial_run)
          except SystemExit as e:
              batch_util.handle_trial_system_exit(
                  e, batch_run, trial_run
              )
          else:
              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 15 for calling a global function with example usage: _run_seq_trials(batch_run, suggest_x_cb) without return types