code: def _init_matrix(matrices, transform_func, default_val):
      """Initialize default value if matrix is None, or transform to np.ndarray.
  
      Parameters
      ----------
      matrices : np.ndarray
      transform_func : transformation function from array-like to ndarray
      default_val : np.ndarray
  
      Returns
      -------
          transformed_matrices : np.ndarray
              matrices as np.ndarray
      """
      if matrices is None:
          return default_val
      return transform_func(matrices)
  
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 3 for calling a global function with example usage: _init_matrix(matrices, transform_func, default_val) and returns: transform_func, default_val