code: def __init__(self, cache=False):
      if cache:
          self._cache = []
          self._cache_lock = _thread.allocate_lock()
          self._invalidate_cache()
      else:
          self._cache = None
          self._cache_complete = False
          self._len = None
  
imports: import calendar
  import datetime
  import heapq
  import itertools
  import re
  import sys
  from functools import wraps
  from warnings import warn
  from six import advance_iterator, integer_types
  from six.moves import _thread, range
  from ._common import weekday
label_desc: Use image node_id 1 to create a new rrulebase object from inherited base classes: object with example: obj = rrulebase(cache)