class_docstr: Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.
  
  Parameters
  ----------
  train: Union[Dataset, pd.DataFrame, None] , default: None
      Dataset or DataFrame object, representing data an estimator was fitted on
  test: Union[Dataset, pd.DataFrame, None] , default: None
      Dataset or DataFrame object, representing data an estimator predicts on
  model: Optional[BasicModel] , default: None
      A scikit-learn-compatible fitted estimator instance
  {additional_context_params:indent}
code: def __init__(
      self,
      train: t.Union[Dataset, pd.DataFrame, None] = None,
      test: t.Union[Dataset, pd.DataFrame, None] = None,
      model: t.Optional[BasicModel] = None,
      feature_importance: t.Optional[pd.Series] = None,
      feature_importance_force_permutation: bool = False,
      feature_importance_timeout: int = 120,
      with_display: bool = True,
      y_pred_train: t.Optional[np.ndarray] = None,
      y_pred_test: t.Optional[np.ndarray] = None,
      y_proba_train: t.Optional[np.ndarray] = None,
      y_proba_test: t.Optional[np.ndarray] = None,
      model_classes: t.Optional[t.List] = None,
  ):
      # Validations
      if train is None and test is None and model is None:
          raise DeepchecksValueError(
              "At least one dataset (or model) must be passed to the method!"
          )
      if train is not None:
          train = Dataset.cast_to_dataset(train)
          if train.name is None:
              train.name = DEFAULT_DATASET_NAMES[0]
      if test is not None:
          test = Dataset.cast_to_dataset(test)
          if test.name is None:
              test.name = DEFAULT_DATASET_NAMES[1]
      # If both dataset, validate they fit each other
      if train and test:
          if (
              test.has_label()
              and train.has_label()
              and not Dataset.datasets_share_label(train, test)
          ):
              raise DatasetValidationError(
                  "train and test requires to have and to share the same label"
              )
          if not Dataset.datasets_share_features(train, test):
              raise DatasetValidationError(
                  "train and test requires to share the same features columns"
              )
          if not Dataset.datasets_share_categorical_features(
              train, test
          ):
              raise DatasetValidationError(
                  "train and test datasets should share "
                  "the same categorical features. Possible reason is that some columns were"
                  "inferred incorrectly as categorical features. To fix this, manually edit the "
                  "categorical features using Dataset(cat_features=<list_of_features>"
              )
          if not Dataset.datasets_share_index(train, test):
              raise DatasetValidationError(
                  "train and test requires to share the same index column"
              )
          if not Dataset.datasets_share_date(train, test):
              raise DatasetValidationError(
                  "train and test requires to share the same date column"
              )
      if test and not train:
          raise DatasetValidationError(
              "Can't initialize context with only test. if you have single dataset, "
              "initialize it as train"
          )
      self._calculated_importance = (
          feature_importance is not None or model is None
      )
      if model is not None:
          # Here validate only type of model, later validating it can predict on the data if needed
          model_type_validation(model)
      if feature_importance is not None:
          feature_importance = validate_feature_importance(
              feature_importance, train.features
          )
      if model_classes and len(model_classes) == 0:
          raise DeepchecksValueError("Received empty model_classes")
      if model_classes and sorted(model_classes) != model_classes:
          supported_models_link = doclink(
              "supported-prediction-format",
              template="For more information please refer to the Supported Models guide {link}",
          )
          raise DeepchecksValueError(
              f"Received unsorted model_classes. {supported_models_link}"
          )
  
      if model_classes is None:
          model_classes = infer_classes_from_model(model)
      labels = None
      if train and train.label_type:
          task_type = train.label_type
      elif model_classes:
          task_type = infer_task_type_by_class_number(
              len(model_classes)
          )
      else:
          labels = get_all_labels(
              model, train, test, y_pred_train, y_pred_test
          )
          task_type = infer_task_type_by_labels(labels)
  
      observed_classes = None
  
      if model is None and (
          y_pred_train is not None
          or y_pred_test is not None
          or y_proba_train is not None
          or y_proba_test is not None
      ):
          # If there is no pred, we use the observed classes to zip between the proba and the classes
          if y_pred_train is None and model_classes is None:
              # Does not calculate labels twice
              labels = (
                  labels
                  if labels is not None
                  else get_all_labels(
                      model, train, test, y_pred_train, y_pred_test
                  )
              )
              observed_classes = sorted(
                  labels.dropna().unique().tolist()
              )
          model = _DummyModel(
              train=train,
              test=test,
              y_pred_train=y_pred_train,
              y_pred_test=y_pred_test,
              y_proba_test=y_proba_test,
              y_proba_train=y_proba_train,
              # Use model classes if exists, else observed classes
              model_classes=model_classes or observed_classes,
          )
  
      self._task_type = task_type
      self._observed_classes = observed_classes
      self._model_classes = model_classes
      self._train = train
      self._test = test
      self._model = model
      self._feature_importance_force_permutation = (
          feature_importance_force_permutation
      )
      self._feature_importance = feature_importance
      self._feature_importance_timeout = feature_importance_timeout
      self._importance_type = None
      self._validated_model = False
      self._with_display = with_display
  
imports: import typing
  import numpy
  import pandas
  from deepchecks.core.context import BaseContext
  from deepchecks.core.errors import DatasetValidationError, DeepchecksNotSupportedError, DeepchecksValueError, ModelValidationError
  from deepchecks.tabular._shared_docs import docstrings
  from deepchecks.tabular.dataset import Dataset
  from deepchecks.tabular.metric_utils import DeepcheckScorer, get_default_scorers, init_validate_scorers
  from deepchecks.tabular.metric_utils.scorers import validate_proba
  from deepchecks.tabular.utils.feature_importance import calculate_feature_importance_or_none, validate_feature_importance
  from deepchecks.tabular.utils.task_inference import get_all_labels, infer_classes_from_model, infer_task_type_by_class_number, infer_task_type_by_labels
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.tabular.utils.validation import ensure_predictions_proba, ensure_predictions_shape, model_type_validation, validate_model
  from deepchecks.utils.docref import doclink
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES
  from deepchecks.utils.typing import BasicModel
label_desc: Use image node_id 1 to create a new Context object from inherited base classes: BaseContext with example: obj = Context(train, test, model, feature_importance, feature_importance_force_permutation, feature_importance_timeout, with_display, y_pred_train, y_pred_test, y_proba_train, y_proba_test, model_classes)