docstr: Contains (past_target, <X>_covariates, static_covariates, future_target), where "<X>" is past if
  `shift_covariates = False` and future otherwise.
  The past chunks have length `input_chunk_length` and the future chunks have length `output_chunk_length`.
  The future chunks start `shift` after the past chunks' start.
  
  This is meant to be a "generic" dataset that can be used to build ShiftedDataset's
  (when `input_chunk_length = output_chunk_length`), or SequenceDataset's (when `shift = input_chunk_length`).
  
  Parameters
  ----------
  target_series
      One or a sequence of target `TimeSeries`.
  covariates
      Optionally, one or a sequence of `TimeSeries` containing covariates.
  input_chunk_length
      The length of the emitted past series.
  output_chunk_length
      The length of the emitted future series.
  shift
      The number of time steps by which to shift the output chunks relative to the input chunks.
  shift_covariates
      Whether to shift the covariates forward the same way as the target.
      FutureCovariatesModel's require this set to True, while PastCovariatesModel's require this set to False.
  max_samples_per_ts
      This is an upper bound on the number of (input, output, input_covariates) tuples that can be produced
      per time series. It can be used in order to have an upper bound on the total size of the dataset and
      ensure proper sampling. If `None`, it will read all of the individual time series in advance (at dataset
      creation) to know their sizes, which might be expensive on big datasets.
      If some series turn out to have a length that would allow more than `max_samples_per_ts`, only the
      most recent `max_samples_per_ts` samples will be considered.
  covariate_type
      An instance of `CovariateType` describing the type of `covariates`.
  use_static_covariates
      Whether to use/include static covariate data from input series.
docstr_tok: ["Contains","(","past_target",",","<","X",">","_covariates",",","static_covariates",",","future_target",")",",","where","``","<","X",">","''","is","past","if","`","shift_covariates","=","False","`","and","future","otherwise",".","The","past","chunks","have","length","`","input_chunk_length","`","and","the","future","chunks","have","length","`","output_chunk_length","`",".","The","future","chunks","start","`","shift","`","after","the","past","chunks","'","start",".","This","is","meant","to","be","a","``","generic","''","dataset","that","can","be","used","to","build","ShiftedDataset's","(","when","`","input_chunk_length","=","output_chunk_length","`",")",",","or","SequenceDataset","'s","(","when","`","shift","=","input_chunk_length","`",")",".","Parameters","--","--","--","--","--","target_series","One","or","a","sequence","of","target","`","TimeSeries","`",".","covariates","Optionally",",","one","or","a","sequence","of","`","TimeSeries","`","containing","covariates",".","input_chunk_length","The","length","of","the","emitted","past","series",".","output_chunk_length","The","length","of","the","emitted","future","series",".","shift","The","number","of","time","steps","by","which","to","shift","the","output","chunks","relative","to","the","input","chunks",".","shift_covariates","Whether","to","shift","the","covariates","forward","the","same","way","as","the","target",".","FutureCovariatesModel","'s","require","this","set","to","True",",","while","PastCovariatesModel","'s","require","this","set","to","False",".","max_samples_per_ts","This","is","an","upper","bound","on","the","number","of","(","input",",","output",",","input_covariates",")","tuples","that","can","be","produced","per","time","series",".","It","can","be","used","in","order","to","have","an","upper","bound","on","the","total","size","of","the","dataset","and","ensure","proper","sampling",".","If","`","None","`",",","it","will","read","all","of","the","individual","time","series","in","advance","(","at","dataset","creation",")","to","know","their","sizes",",","which","might","be","expensive","on","big","datasets",".","If","some","series","turn","out","to","have","a","length","that","would","allow","more","than","`","max_samples_per_ts","`",",","only","the","most","recent","`","max_samples_per_ts","`","samples","will","be","considered",".","covariate_type","An","instance","of","`","CovariateType","`","describing","the","type","of","`","covariates","`",".","use_static_covariates","Whether","to","use\/include","static","covariate","data","from","input","series","."]
code: def __init__(
      self,
      target_series: Union[TimeSeries, Sequence[TimeSeries]],
      covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      input_chunk_length: int = 12,
      output_chunk_length: int = 1,
      shift: int = 1,
      shift_covariates: bool = False,
      max_samples_per_ts: Optional[int] = None,
      covariate_type: CovariateType = CovariateType.NONE,
      use_static_covariates: bool = True,
  ):
      """
      Contains (past_target, <X>_covariates, static_covariates, future_target), where "<X>" is past if
      `shift_covariates = False` and future otherwise.
      The past chunks have length `input_chunk_length` and the future chunks have length `output_chunk_length`.
      The future chunks start `shift` after the past chunks' start.
  
      This is meant to be a "generic" dataset that can be used to build ShiftedDataset's
      (when `input_chunk_length = output_chunk_length`), or SequenceDataset's (when `shift = input_chunk_length`).
  
      Parameters
      ----------
      target_series
          One or a sequence of target `TimeSeries`.
      covariates
          Optionally, one or a sequence of `TimeSeries` containing covariates.
      input_chunk_length
          The length of the emitted past series.
      output_chunk_length
          The length of the emitted future series.
      shift
          The number of time steps by which to shift the output chunks relative to the input chunks.
      shift_covariates
          Whether to shift the covariates forward the same way as the target.
          FutureCovariatesModel's require this set to True, while PastCovariatesModel's require this set to False.
      max_samples_per_ts
          This is an upper bound on the number of (input, output, input_covariates) tuples that can be produced
          per time series. It can be used in order to have an upper bound on the total size of the dataset and
          ensure proper sampling. If `None`, it will read all of the individual time series in advance (at dataset
          creation) to know their sizes, which might be expensive on big datasets.
          If some series turn out to have a length that would allow more than `max_samples_per_ts`, only the
          most recent `max_samples_per_ts` samples will be considered.
      covariate_type
          An instance of `CovariateType` describing the type of `covariates`.
      use_static_covariates
          Whether to use/include static covariate data from input series.
      """
      super().__init__()
  
      self.target_series = (
          [target_series]
          if isinstance(target_series, TimeSeries)
          else target_series
      )
      self.covariates = (
          [covariates]
          if isinstance(covariates, TimeSeries)
          else covariates
      )
      self.covariate_type = covariate_type
  
      raise_if_not(
          covariates is None
          or len(self.target_series) == len(self.covariates),
          "The provided sequence of target series must have the same length as "
          "the provided sequence of covariate series.",
      )
  
      self.input_chunk_length, self.output_chunk_length = (
          input_chunk_length,
          output_chunk_length,
      )
      self.shift, self.shift_covariates = shift, shift_covariates
      self.max_samples_per_ts = max_samples_per_ts
  
      self.size_of_both_chunks = max(
          self.input_chunk_length, self.shift + self.output_chunk_length
      )
  
      if self.max_samples_per_ts is None:
          # read all time series to get the maximum size
          self.max_samples_per_ts = (
              max(len(ts) for ts in self.target_series)
              - self.size_of_both_chunks
              + 1
          )
  
      self.ideal_nr_samples = (
          len(self.target_series) * self.max_samples_per_ts
      )
      self.use_static_covariates = use_static_covariates
  
imports: from typing import Optional, Sequence, Tuple, Union
  import numpy
  from darts import TimeSeries
  from darts.logging import raise_if_not
  from .training_dataset import DualCovariatesTrainingDataset, FutureCovariatesTrainingDataset, MixedCovariatesTrainingDataset, PastCovariatesTrainingDataset, SplitCovariatesTrainingDataset, TrainingDataset
  from .utils import CovariateType
label_desc: Use image node_id 1 to create a new GenericShiftedDataset object from inherited base classes: TrainingDataset with example: obj = GenericShiftedDataset(target_series, covariates, input_chunk_length, output_chunk_length, shift, shift_covariates, max_samples_per_ts, covariate_type, use_static_covariates)