def _build_max_replicas_by_tier(self, bound=math.ceil):
        # Used by walk_tree to know what entries to create for each recursive
        # call.
        tier2children = self._build_tier2children()

        def walk_tree(tier, replica_count):
            if len(tier) == 4:
                # special case for device, it's not recursive
                replica_count = min(1, replica_count)
            mr = {tier: replica_count}
            if tier in tier2children:
                subtiers = tier2children[tier]
                for subtier in subtiers:
                    submax = bound(float(replica_count) / len(subtiers))
                    mr.update(walk_tree(subtier, submax))
            return mr
        mr = defaultdict(float)
        mr.update(walk_tree((), self.replicas))
        return mr
Returns a defaultdict of (tier: replica_count) for all tiers in the
dataset/ETHPy150Open openstack/swift/swift/common/ring/builder.py/RingBuilder._build_max_replicas_by_tier