code: def _reorganize_output_matrix(
      output_array: np.ndarray,
      value_increased: np.ndarray,
      value_decreased: np.ndarray,
      increase: bool = True,
  ) -> np.ndarray:
      """Reorganize the output matrix.
  
      This method reorganizes the output matrix in a way that allows the
      elementary effects to be computed as a simple subtraction between two
      arrays. It repositions the outputs in the output matrix according to the
      order they changed during the formation of the trajectories.
  
      Parameters
      ----------
      output_array: np.ndarray
          Matrix of model output values
      value_increased: np.ndarray
          Input variables that had their values increased when forming the
          trajectories matrix
      value_decreased: np.ndarray
          Input variables that had their values decreased when forming the
          trajectories matrix
      increase: bool
          Direction to consider (values that increased or decreased). "Increase"
          is the default value.
  
      Returns
      -------
      np.ndarray
      """
      if increase:
          pad_up = (1, 0)
          pad_lo = (0, 1)
      else:
          pad_up = (0, 1)
          pad_lo = (1, 0)
  
      value_increased = np.pad(
          value_increased, ((0, 0), pad_up, (0, 0)), "constant"
      )
      value_decreased = np.pad(
          value_decreased, ((0, 0), pad_lo, (0, 0)), "constant"
      )
  
      res = np.einsum(
          "ik,ikj->ij", output_array, value_increased + value_decreased
      )
  
      return res.T
  
imports: from typing import Dict, List
  import numpy
  from scipy.stats import norm
  from .None import common_args
  from ..util import read_param_file, compute_groups_matrix, ResultDict, _define_problem_with_groups, _compute_delta, _check_groups
label_desc: Use image node_id 5 for calling a global function with example usage: _reorganize_output_matrix(output_array, value_increased, value_decreased, increase) and returns: res