docstr: This task generator tries to generate tasks for different horizons based on an existing task
  
  Parameters
  ----------
  horizon : List[int]
      the possible horizons of the tasks
  label_leak_n : int
      How many future days it will take to get complete label after the day making prediction
      For example:
      - User make prediction on day `T`(after getting the close price on `T`)
      - The label is the return of buying stock on `T + 1` and selling it on `T + 2`
      - the `label_leak_n` will be 2 (e.g. two days of information is leaked to leverage this sample)
docstr_tok: ["This","task","generator","tries","to","generate","tasks","for","different","horizons","based","on","an","existing","task","Parameters","--","--","--","--","--","horizon",":","List","[","int","]","the","possible","horizons","of","the","tasks","label_leak_n",":","int","How","many","future","days","it","will","take","to","get","complete","label","after","the","day","making","prediction","For","example",":","-","User","make","prediction","on","day","`","T","`","(","after","getting","the","close","price","on","`","T","`",")","-","The","label","is","the","return","of","buying","stock","on","`","T","+","1","`","and","selling","it","on","`","T","+","2","`","-","the","`","label_leak_n","`","will","be","2","(","e.g",".","two","days","of","information","is","leaked","to","leverage","this","sample",")"]
code: def __init__(self, horizon: List[int] = [5], label_leak_n=2):
      """
      This task generator tries to generate tasks for different horizons based on an existing task
  
      Parameters
      ----------
      horizon : List[int]
          the possible horizons of the tasks
      label_leak_n : int
          How many future days it will take to get complete label after the day making prediction
          For example:
          - User make prediction on day `T`(after getting the close price on `T`)
          - The label is the return of buying stock on `T + 1` and selling it on `T + 2`
          - the `label_leak_n` will be 2 (e.g. two days of information is leaked to leverage this sample)
      """
      self.horizon = list(horizon)
      self.label_leak_n = label_leak_n
      self.ta = TimeAdjuster()
      self.test_key = "test"
  
imports: import abc
  import copy
  import pandas
  from typing import Dict, List, Union, Callable
  from qlib.utils import transform_end_date
  from .utils import TimeAdjuster
label_desc: Use image node_id 1 to create a new MultiHorizonGenBase object from inherited base classes: TaskGen with example: obj = MultiHorizonGenBase(horizon, label_leak_n)