def AddTransfer(self, throttle_name, token_count):
    """Add a count to the amount this thread has transferred.

    Each time a thread transfers some data, it should call this method to
    note the amount sent. The counts may be rotated if sufficient time
    has passed since the last rotation.

    Args:
      throttle_name: The name of the throttle to add to.
      token_count: The number to add to the throttle counter.
    """
    self.VerifyThrottleName(throttle_name)
    transferred = self.transferred[throttle_name]
    try:
      transferred[id(threading.currentThread())] += token_count
    except __HOLE__:
      thread = threading.currentThread()
      raise ThreadNotRegisteredError(
          'Unregistered thread accessing throttled datastore stub: id = %s\n'
          'name = %s' % (id(thread), thread.getName()))

    if self.last_rotate[throttle_name] + self.ROTATE_PERIOD < self.get_time():
      self._RotateCounts(throttle_name)
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/remote_api/throttle.py/Throttle.AddTransfer