code: def ensure_predictions_shape(
      pred: np.ndarray, data: t.Sequence
  ) -> np.ndarray:
      """Ensure the predictions are in the right shape and if so return them. else raise error."""
      if pred.shape[0] != len(data):
          raise errors.ValidationError(
              f"Prediction array expected to be of same length as data {len(data)},"
              f" but was: {pred.shape[0]}"
          )
      return pred
  
file_path: deepchecks/deepchecks/tabular/utils/validation.py
imports: import typing
  import numpy
  import pandas
  from deepchecks import tabular
  from deepchecks.core import errors
  from deepchecks.utils.typing import BasicModel
label_desc: Use image node_id 4 for calling a global function with example usage: ensure_predictions_shape(pred, data) and returns: pred