code: def get_all_labels(
      model,
      train_dataset,
      test_dataset=None,
      y_pred_train=None,
      y_pred_test=None,
  ):
      """Aggregate labels from all available data: labels on datasets, y_pred, and model predicitions."""
      labels = np.asarray([])
      if train_dataset:
          if train_dataset.has_label():
              labels = np.append(
                  labels, train_dataset.label_col.to_numpy()
              )
          if model:
              labels = np.append(
                  labels,
                  sequence_to_numpy(
                      model.predict(train_dataset.features_columns)
                  ),
              )
      if test_dataset:
          if test_dataset.has_label():
              labels = np.append(
                  labels, test_dataset.label_col.to_numpy()
              )
          if model:
              labels = np.append(
                  labels,
                  sequence_to_numpy(
                      model.predict(test_dataset.features_columns)
                  ),
              )
      if y_pred_train is not None:
          labels = np.append(labels, y_pred_train)
      if y_pred_test is not None:
          labels = np.append(labels, y_pred_test)
  
      return (
          pd.Series(labels)
          if len(labels) > 0
          else pd.Series(dtype="object")
      )
  
file_path: deepchecks/deepchecks/tabular/utils/task_inference.py
imports: from typing import Optional
  import numpy
  import pandas
  from pandas._libs.lib import infer_dtype
  from deepchecks.core.errors import ValidationError
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.utils.array_math import sequence_to_numpy
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.type_inference import is_categorical
  from deepchecks.utils.typing import BasicModel
label_desc: Use image node_id 2 for calling a global function with example usage: get_all_labels(model, train_dataset, test_dataset, y_pred_train, y_pred_test) and returns: unknown