<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tick(self):
 """Updates rates and decays"""

    count = self._uncounted.getAndSet(0)
    instantRate = float(count) / self.interval

    if self._initialized:
      self.rate += (self.alpha * (instantRate - self.rate))
    else:
      self.rate = instantRate
      self._initialized = True