def DecayShares(self, timestamp):
    """Decays 'total_shares' and 'colocated_shares' based on 'timestamp'. Updates 'last_share'
    and 'last_colocated' to 'timestamp'.
    """
    def _ComputeDecay(shares, last_time):
      if last_time is None:
        assert shares is None, shares
        return 0
      decay = math.exp(-math.log(2) * (last_time - timestamp) /
                        Friend._SHARE_HALF_LIFE)
      return shares * decay

    self.total_shares = _ComputeDecay(self.total_shares, self.last_share)
    self.last_share = timestamp
    self.colocated_shares = _ComputeDecay(self.colocated_shares, self.last_colocated)
    self.last_colocated = timestamp
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/friend.py/Friend.DecayShares/swapped operands of `-`