class_docstr: `SingleEncoder`: Abstract class for single index encoders.
  Single encoders can be used to implement new encoding techniques.
  Each single encoder must implement an `_encode()` method that carries the encoding logic.
  
  The `_encode()` method must take an `index` as input and generate a encoded single `TimeSeries` as output.
class_docstr_tok: ["`","SingleEncoder","`",":","Abstract","class","for","single","index","encoders",".","Single","encoders","can","be","used","to","implement","new","encoding","techniques",".","Each","single","encoder","must","implement","an","`","_encode","(",")","`","method","that","carries","the","encoding","logic",".","The","`","_encode","(",")","`","method","must","take","an","`","index","`","as","input","and","generate","a","encoded","single","`","TimeSeries","`","as","output","."]
docstr: Single encoders take an `index_generator` to generate the required index for encoding past and future
  covariates.
  See darts.utils.data.covariate_index_generators.py for the `CovariatesIndexGenerator` subclasses.
  For past covariates encoders, use a `PastCovariatesIndexGenerator`.
  For future covariates encoders use a `FutureCovariatesIndexGenerator`.
  
  Parameters
  ----------
  index_generator
      An instance of `CovariatesIndexGenerator` with methods `generate_train_idx()` and
      `generate_inference_idx()`. Used to generate the index for encoders.
docstr_tok: ["Single","encoders","take","an","`","index_generator","`","to","generate","the","required","index","for","encoding","past","and","future","covariates",".","See","darts.utils.data.covariate_index_generators.py","for","the","`","CovariatesIndexGenerator","`","subclasses",".","For","past","covariates","encoders",",","use","a","`","PastCovariatesIndexGenerator","`",".","For","future","covariates","encoders","use","a","`","FutureCovariatesIndexGenerator","`",".","Parameters","--","--","--","--","--","index_generator","An","instance","of","`","CovariatesIndexGenerator","`","with","methods","`","generate_train_idx","(",")","`","and","`","generate_inference_idx","(",")","`",".","Used","to","generate","the","index","for","encoders","."]
code: def __init__(self, index_generator: CovariatesIndexGenerator):
      """Single encoders take an `index_generator` to generate the required index for encoding past and future
      covariates.
      See darts.utils.data.covariate_index_generators.py for the `CovariatesIndexGenerator` subclasses.
      For past covariates encoders, use a `PastCovariatesIndexGenerator`.
      For future covariates encoders use a `FutureCovariatesIndexGenerator`.
  
      Parameters
      ----------
      index_generator
          An instance of `CovariatesIndexGenerator` with methods `generate_train_idx()` and
          `generate_inference_idx()`. Used to generate the index for encoders.
      """
  
      super().__init__()
      self.index_generator = index_generator
      self._components = pd.Index([])
  
imports: from abc import ABC, abstractmethod
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  from darts import TimeSeries
  from darts.dataprocessing.transformers import FittableDataTransformer
  from darts.logging import get_logger, raise_if, raise_log
  from darts.utils.timeseries_generation import generate_index
label_desc: Use image node_id 1 to create a new SingleEncoder object from inherited base classes: Encoder, ABC with example: obj = SingleEncoder(index_generator)