code: def predict_factor(h_abs, h_abs_old, error_norm, error_norm_old):
      """Predict by which factor to increase/decrease the step size.
  
      The algorithm is described in [1]_.
  
      Parameters
      ----------
      h_abs, h_abs_old : float
          Current and previous values of the step size, `h_abs_old` can be None
          (see Notes).
      error_norm, error_norm_old : float
          Current and previous values of the error norm, `error_norm_old` can
          be None (see Notes).
  
      Returns
      -------
      factor : float
          Predicted factor.
  
      Notes
      -----
      If `h_abs_old` and `error_norm_old` are both not None then a two-step
      algorithm is used, otherwise a one-step algorithm is used.
  
      References
      ----------
      .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
             Equations II: Stiff and Differential-Algebraic Problems", Sec. IV.8.
      """
      if error_norm_old is None or h_abs_old is None or error_norm == 0:
          multiplier = 1
      else:
          multiplier = (
              h_abs / h_abs_old * (error_norm_old / error_norm) ** 0.25
          )
  
      with np.errstate(divide="ignore"):
          factor = min(1, multiplier) * error_norm**-0.25
  
      return factor
  
file_path: scipy/scipy/integrate/_ivp/radau.py
imports: import numpy
  from scipy.linalg import lu_factor, lu_solve
  from scipy.sparse import csc_matrix, issparse, eye
  from scipy.sparse.linalg import splu
  from scipy.optimize._numdiff import group_columns
  from .common import validate_max_step, validate_tol, select_initial_step, norm, num_jac, EPS, warn_extraneous, validate_first_step
  from .base import OdeSolver, DenseOutput
label_desc: Use image node_id 2 for calling a global function with example usage: predict_factor(h_abs, h_abs_old, error_norm, error_norm_old) and returns: factor