code: def __init__(self, dateTime):
      super(MonthRange, self).__init__()
      self.__begin = datetime.datetime(dateTime.year, dateTime.month, 1)
  
      # Calculate the ending date.
      if dateTime.month == 12:
          self.__end = datetime.datetime(dateTime.year + 1, 1, 1)
      else:
          self.__end = datetime.datetime(
              dateTime.year, dateTime.month + 1, 1
          )
  
      if not dt.datetime_is_naive(dateTime):
          self.__begin = dt.localize(self.__begin, dateTime.tzinfo)
          self.__end = dt.localize(self.__end, dateTime.tzinfo)
  
imports: import abc
  import datetime
  import six
  from pyalgotrade.utils import dt
  from pyalgotrade import bar
label_desc: Use image node_id 1 to create a new MonthRange object from inherited base classes: TimeRange with example: obj = MonthRange(dateTime)