class_docstr: Base class for contexts.
class_docstr_tok: ["Base","class","for","contexts","."]
docstr: Return train if exists, otherwise raise error.
docstr_tok: ["Return","train","if","exists",",","otherwise","raise","error","."]
code: def train(self):
      """Return train if exists, otherwise raise error."""
      if self._train is None:
          raise DeepchecksNotSupportedError(
              "Check is irrelevant for Datasets without train dataset"
          )
      return self._train
  
file_path: deepchecks/deepchecks/core/context.py
imports: from abc import ABC, abstractmethod
  from deepchecks.core import CheckFailure, CheckResult, DatasetKind
  from deepchecks.core.errors import DeepchecksNotSupportedError, DeepchecksValueError, ModelValidationError
label_desc: Use image node_id 2 for calling the BaseContext obj's underlying member method code with example usage: obj.train() and returns: self