'Called once per pass for each account this server is the primary for
and attempts to delete the data for the given account. The reaper will
only delete one account at any given time. It will call
:func:`reap_container` up to sqrt(self.concurrency) times concurrently
while reaping the account.
If there is any exception while deleting a single container, the
process will continue for any other containers and the failed
containers will be tried again the next time this function is called
with the same parameters.
If there is any exception while listing the containers for deletion,
the process will stop (but will obviously be tried again the next time
this function is called with the same parameters). This isn\'t likely
since the listing comes from the local database.
After the process completes (successfully or not) statistics about what
was accomplished will be logged.
This function returns nothing and should raise no exception but only
update various self.stats_* values for what occurs.
:param broker: The AccountBroker for the account to delete.
:param partition: The partition in the account ring the account is on.
:param nodes: The primary node dicts for the account to delete.
:param container_shard: int used to shard containers reaped. If None,
will reap all containers.
.. seealso::
:class:`swift.account.backend.AccountBroker` for the broker class.
.. seealso::
:func:`swift.common.ring.Ring.get_nodes` for a description
of the node dicts.'

def reap_account(self, broker, partition, nodes, container_shard=None):

    begin = time()
    info = broker.get_info()
    if ((time() - float(Timestamp(info['delete_timestamp']))) <= self.delay_reaping):
        return False
    account = info['account']
    self.logger.info(_('Beginning    pass    on    account    %s'), account)
    self.reset_stats()
    container_limit = 1000
    if (container_shard is not None):
        container_limit *= len(nodes)
    try:
        marker = ''
        while True:
            containers = list(broker.list_containers_iter(container_limit, marker, None, None, None))
            if (not containers):
                break
            try:
                for (container, _junk, _junk, _junk, _junk) in containers:
                    this_shard = (int(md5(container).hexdigest(), 16) % len(nodes))
                    if (container_shard not in (this_shard, None)):
                        continue
                    self.container_pool.spawn(self.reap_container, account, partition, nodes, container)
                self.container_pool.waitall()
            except (Exception, Timeout):
                self.logger.exception(_('Exception    with    containers    for    account    %s'), account)
            marker = containers[(-1)][0]
            if (marker == ''):
                break
        log = ('Completed    pass    on    account    %s' % account)
    except (Exception, Timeout):
        self.logger.exception(_('Exception    with    account    %s'), account)
        log = (_('Incomplete    pass    on    account    %s') % account)
    if self.stats_containers_deleted:
        log += (_(',    %s    containers    deleted') % self.stats_containers_deleted)
    if self.stats_objects_deleted:
        log += (_(',    %s    objects    deleted') % self.stats_objects_deleted)
    if self.stats_containers_remaining:
        log += (_(',    %s    containers    remaining') % self.stats_containers_remaining)
    if self.stats_objects_remaining:
        log += (_(',    %s    objects    remaining') % self.stats_objects_remaining)
    if self.stats_containers_possibly_remaining:
        log += (_(',    %s    containers    possibly    remaining') % self.stats_containers_possibly_remaining)
    if self.stats_objects_possibly_remaining:
        log += (_(',    %s    objects    possibly    remaining') % self.stats_objects_possibly_remaining)
    if self.stats_return_codes:
        log += _(',    return    codes:    ')
        for code in sorted(self.stats_return_codes):
            log += ('%s    %sxxs,    ' % (self.stats_return_codes[code], code))
        log = log[:(-2)]
    log += (_(',    elapsed:    %.02fs') % (time() - begin))
    self.logger.info(log)
    self.logger.timing_since('timing', self.start_time)
    delete_timestamp = Timestamp(info['delete_timestamp'])
    if (self.stats_containers_remaining and ((begin - float(delete_timestamp)) >= self.reap_not_done_after)):
        self.logger.warning((_('Account    %(account)s    has    not    been    reaped    since    %(time)s') % {'account': account, 'time': delete_timestamp.isoformat}))
    return True
