code: def _validate_param_shape(
      param_name, matrix_shape, actual_shape, time_steps=None
  ):
      """Validate shape of matrix parameter.
  
      Assert `actual_shape` equals to:
          -  'shape' of a single matrix or
          -  'shape' of time_steps matrices.
      If neither, raise an informative `ValueError` that includes the parameter's name.
  
      Parameters
      ----------
      param_name : str
          The name of the matrix-parameter.
      matrix_shape : tuple
          The supposed shape of a single matrix.
      actual_shape : tuple
          The actual shape of matrix-parameter.
      time_steps : int
          actual_shape[0] if matrix-parameter is dynamic (matrix per time-step).
  
      Raises
      ------
          ValueError
              error with an informative message that includes parameter's name,
              and the shape that parameter should have.
      """
      if time_steps is None:
          if actual_shape != matrix_shape:
              raise ValueError(
                  f"Shape of parameter `{param_name}` is: {actual_shape}, "
                  f"but should be: {matrix_shape}."
              )
      else:
          matrices_shape = (time_steps, *matrix_shape)
          if not (
              actual_shape == matrix_shape
              or actual_shape == matrices_shape
          ):
              raise ValueError(
                  f"Shape of parameter `{param_name}` is: {actual_shape}, but should be: "
                  f"{matrix_shape} or {matrices_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 2 for calling a global function with example usage: _validate_param_shape(param_name, matrix_shape, actual_shape, time_steps) without return types