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 must implement an _encode() method to encode the index.
  
  Parameters
  ----------
  index
      The index generated from `self.index_generator` for either the train or inference dataset.
  target_end
      The end time of the target series.
  dtype
      The dtype of the encoded index
docstr_tok: ["Single","Encoders","must","implement","an","_encode","(",")","method","to","encode","the","index",".","Parameters","--","--","--","--","--","index","The","index","generated","from","`","self.index_generator","`","for","either","the","train","or","inference","dataset",".","target_end","The","end","time","of","the","target","series",".","dtype","The","dtype","of","the","encoded","index"]
code: def _encode(
      self,
      index: SupportedIndex,
      target_end: pd.Timestamp,
      dtype: np.dtype,
  ) -> TimeSeries:
      """Single Encoders must implement an _encode() method to encode the index.
  
      Parameters
      ----------
      index
          The index generated from `self.index_generator` for either the train or inference dataset.
      target_end
          The end time of the target series.
      dtype
          The dtype of the encoded index
      """
      pass
  
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 2 for calling the SingleEncoder obj's underlying member method code with example usage: obj._encode(index, target_end, dtype) without return types