code: def _reset_cache(self, key=None):
          
          if getattr(self, '_cache', None) is None:
              return
          if key is None:
              self._cache.clear()
          else:
              self._cache.pop(key, None)
docs: Reset cached properties. If ``key`` is passed, only clears that key.