code: def _get_t_matrix(time_t, matrices, shape, time_steps):
      """Extract matrix to be used at iteration `time_t` of the Kalman filter iterations.
  
      Parameters
      ----------
      time_t : int
          The required time step.
      matrices : np.ndarray
      shape : tuple
          The shape of a single matrix.
      time_steps : int
          Number of iterations.
  
      Returns
      -------
          matrix : np.ndarray
              matrix to be used at iteration `time_t`
      """
      matrices = np.asarray(matrices)
      if matrices.shape == shape:
          return matrices
      if matrices.shape == (time_steps, *shape):
          return matrices[time_t]
      raise ValueError(
          f"Shape of `matrices` {matrices.shape}, does not match single matrix"
          f"`shape` {shape}, nor shape of list of matrices {(time_steps, *shape)}."
      )
  
imports: import numpy
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.warnings import warn
label_desc: Use image node_id 1 for calling a global function with example usage: _get_t_matrix(time_t, matrices, shape, time_steps) and returns: matrices, matrices