class_docstr: Expression base class
  
  Expression is designed to handle the calculation of data with the format below
  data with two dimension for each instrument,
  
  - feature
  - time:  it  could be observation time or period time.
  
      - period time is designed for Point-in-time database.  For example, the period time maybe 2014Q4, its value can observed for multiple times(different value may be observed at different time due to amendment).
class_docstr_tok: ["Expression","base","class","Expression","is","designed","to","handle","the","calculation","of","data","with","the","format","below","data","with","two","dimension","for","each","instrument",",","-","feature","-","time",":","it","could","be","observation","time","or","period","time",".","-","period","time","is","designed","for","Point-in-time","database",".","For","example",",","the","period","time","maybe","2014Q4",",","its","value","can","observed","for","multiple","times","(","different","value","may","be","observed","at","different","time","due","to","amendment",")","."]
docstr: load  feature
  This function is responsible for loading feature/expression based on the expression engine.
  
  The concrete implementation will be separated into two parts:
  
  1) caching data, handle errors.
  
      - This part is shared by all the expressions and implemented in Expression
  2) processing and calculating data based on the specific expression.
  
      - This part is different in each expression and implemented in each expression
  
  Expression Engine is shared by different data.
  Different data will have different extra information for `args`.
  
  Parameters
  ----------
  instrument : str
      instrument code.
  start_index : str
      feature start index [in calendar].
  end_index : str
      feature end  index  [in calendar].
  
  *args may contain following information:
  1) if it is used in basic expression engine data, it contains following arguments
      freq: str
          feature frequency.
  
  2) if is used in PIT data, it contains following arguments
      cur_pit:
          it is designed for the point-in-time data.
      period: int
          This is used for query specific period.
          The period is represented with int in Qlib. (e.g. 202001 may represent the first quarter in 2020)
  
  Returns
  ----------
  pd.Series
      feature series: The index of the series is the calendar index
docstr_tok: ["load","feature","This","function","is","responsible","for","loading","feature\/expression","based","on","the","expression","engine",".","The","concrete","implementation","will","be","separated","into","two","parts",":","1",")","caching","data",",","handle","errors",".","-","This","part","is","shared","by","all","the","expressions","and","implemented","in","Expression","2",")","processing","and","calculating","data","based","on","the","specific","expression",".","-","This","part","is","different","in","each","expression","and","implemented","in","each","expression","Expression","Engine","is","shared","by","different","data",".","Different","data","will","have","different","extra","information","for","`","args","`",".","Parameters","--","--","--","--","--","instrument",":","str","instrument","code",".","start_index",":","str","feature","start","index","[","in","calendar","]",".","end_index",":","str","feature","end","index","[","in","calendar","]",".","*","args","may","contain","following","information",":","1",")","if","it","is","used","in","basic","expression","engine","data",",","it","contains","following","arguments","freq",":","str","feature","frequency",".","2",")","if","is","used","in","PIT","data",",","it","contains","following","arguments","cur_pit",":","it","is","designed","for","the","point-in-time","data",".","period",":","int","This","is","used","for","query","specific","period",".","The","period","is","represented","with","int","in","Qlib",".","(","e.g",".","202001","may","represent","the","first","quarter","in","2020",")","Returns","--","--","--","--","--","pd.Series","feature","series",":","The","index","of","the","series","is","the","calendar","index"]
code: def load(self, instrument, start_index, end_index, *args):
      """load  feature
      This function is responsible for loading feature/expression based on the expression engine.
  
      The concrete implementation will be separated into two parts:
  
      1) caching data, handle errors.
  
          - This part is shared by all the expressions and implemented in Expression
      2) processing and calculating data based on the specific expression.
  
          - This part is different in each expression and implemented in each expression
  
      Expression Engine is shared by different data.
      Different data will have different extra information for `args`.
  
      Parameters
      ----------
      instrument : str
          instrument code.
      start_index : str
          feature start index [in calendar].
      end_index : str
          feature end  index  [in calendar].
  
      *args may contain following information:
      1) if it is used in basic expression engine data, it contains following arguments
          freq: str
              feature frequency.
  
      2) if is used in PIT data, it contains following arguments
          cur_pit:
              it is designed for the point-in-time data.
          period: int
              This is used for query specific period.
              The period is represented with int in Qlib. (e.g. 202001 may represent the first quarter in 2020)
  
      Returns
      ----------
      pd.Series
          feature series: The index of the series is the calendar index
      """
      from .cache import H  # pylint: disable=C0415
  
      # cache
      cache_key = str(self), instrument, start_index, end_index, *args
      if cache_key in H["f"]:
          return H["f"][cache_key]
      if (
          start_index is not None
          and end_index is not None
          and start_index > end_index
      ):
          raise ValueError(
              "Invalid index range: {} {}".format(
                  start_index, end_index
              )
          )
      try:
          series = self._load_internal(
              instrument, start_index, end_index, *args
          )
      except Exception as e:
          get_module_logger("data").debug(
              f"Loading data error: instrument={instrument}, expression={str(self)}, "
              f"start_index={start_index}, end_index={end_index}, args={args}. "
              f"error info: {str(e)}"
          )
          raise
      series.name = str(self)
      H["f"][cache_key] = series
      return series
  
imports: from __future__ import division
  from __future__ import print_function
  import abc
  import pandas
  from ..log import get_module_logger
label_desc: Use image node_id 25 for calling the Expression obj's underlying member method code with example usage: obj.load(instrument, start_index, end_index) and returns: series, H