code: def _build_train_dataset(
      self,
      target: Sequence[TimeSeries],
      past_covariates: Optional[Sequence[TimeSeries]],
      future_covariates: Optional[Sequence[TimeSeries]],
      max_samples_per_ts: Optional[int],
  ) -> MixedCovariatesSequentialDataset:
      raise_if(
          future_covariates is None and not self.add_relative_index,
          "TFTModel requires future covariates. The model applies multi-head attention queries on future "
          "inputs. Consider specifying a future encoder with `add_encoders` or setting `add_relative_index` "
          "to `True` at model creation (read TFT model docs for more information). "
          "These will automatically generate `future_covariates` from indexes.",
          logger,
      )
  
      return MixedCovariatesSequentialDataset(
          target_series=target,
          past_covariates=past_covariates,
          future_covariates=future_covariates,
          input_chunk_length=self.input_chunk_length,
          output_chunk_length=self.output_chunk_length,
          max_samples_per_ts=max_samples_per_ts,
          use_static_covariates=self.uses_static_covariates,
      )
  
imports: from typing import Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  import torch
  from torch import nn
  from torch.nn import LSTM
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.models.components import glu_variants, layer_norm_variants
  from darts.models.components.glu_variants import GLU_FFN
  from darts.models.forecasting.pl_forecasting_module import PLMixedCovariatesModule, io_processor
  from darts.models.forecasting.tft_submodels import _GateAddNorm, _GatedResidualNetwork, _InterpretableMultiHeadAttention, _MultiEmbedding, _VariableSelectionNetwork, get_embedding_size
  from darts.models.forecasting.torch_forecasting_model import MixedCovariatesTorchModel
  from darts.utils.data import MixedCovariatesSequentialDataset, MixedCovariatesTrainingDataset, TrainingDataset
  from darts.utils.likelihood_models import Likelihood, QuantileRegression
label_desc: Use image node_id 3 for calling the TFTModel obj's underlying member method code with example usage: obj._build_train_dataset(target, past_covariates, future_covariates, max_samples_per_ts) and returns: MixedCovariatesSequentialDataset