code: def initDSResampler(self, dataSeries, frequency):
      if not resamplebase.is_valid_frequency(frequency):
          raise Exception("Unsupported frequency")
  
      self.__frequency = frequency
      self.__grouper = None
      self.__range = None
  
      dataSeries.getNewValueEvent().subscribe(self.__onNewValue)
  
imports: import abc
  import six
  from pyalgotrade import dataseries
  from pyalgotrade.dataseries import bards
  from pyalgotrade import bar
  from pyalgotrade import resamplebase
label_desc: Use image node_id 1 for calling the DSResampler obj's underlying member method code with example usage: obj.initDSResampler(dataSeries, frequency) without return types