class_docstr: Dynamic Instruments Filter Abstract class to filter a series of certain features
  
  Filters should provide parameters:
  
  - filter start time
  - filter end time
  - filter rule
  
  Override __init__ to assign a certain rule to filter the series.
  
  Override _getFilterSeries to use the rule to filter the series and get a dict of {inst => series}, or override filter_main for more advanced series filter rule
class_docstr_tok: ["Dynamic","Instruments","Filter","Abstract","class","to","filter","a","series","of","certain","features","Filters","should","provide","parameters",":","-","filter","start","time","-","filter","end","time","-","filter","rule","Override","__init__","to","assign","a","certain","rule","to","filter","the","series",".","Override","_getFilterSeries","to","use","the","rule","to","filter","the","series","and","get","a","dict","of","{","inst","=",">","series","}",",","or","override","filter_main","for","more","advanced","series","filter","rule"]
docstr: Get time bound for all instruments.
  
  Parameters
  ----------
  instruments: dict
      the dict of instruments in the form {instrument_name => list of timestamp tuple}.
  
  Returns
  ----------
  pd.Timestamp, pd.Timestamp
      the lower time bound and upper time bound of all the instruments.
docstr_tok: ["Get","time","bound","for","all","instruments",".","Parameters","--","--","--","--","--","instruments",":","dict","the","dict","of","instruments","in","the","form","{","instrument_name","=",">","list","of","timestamp","tuple","}",".","Returns","--","--","--","--","--","pd.Timestamp",",","pd.Timestamp","the","lower","time","bound","and","upper","time","bound","of","all","the","instruments","."]
code: def _getTimeBound(self, instruments):
      """Get time bound for all instruments.
  
      Parameters
      ----------
      instruments: dict
          the dict of instruments in the form {instrument_name => list of timestamp tuple}.
  
      Returns
      ----------
      pd.Timestamp, pd.Timestamp
          the lower time bound and upper time bound of all the instruments.
      """
      trange = Cal.calendar(freq=self.filter_freq)
      ubound, lbound = trange[0], trange[-1]
      for _, timestamp in instruments.items():
          if timestamp:
              lbound = (
                  timestamp[0][0]
                  if timestamp[0][0] < lbound
                  else lbound
              )
              ubound = (
                  timestamp[-1][-1]
                  if timestamp[-1][-1] > ubound
                  else ubound
              )
      return lbound, ubound
  
imports: from __future__ import print_function
  from abc import abstractmethod
  import re
  import pandas
  import numpy
  import abc
  from .data import Cal, DatasetD
label_desc: Use image node_id 2 for calling the SeriesDFilter obj's underlying member method code with example usage: obj._getTimeBound(instruments) and returns: lbound,  ubound