def to_dist_dict(self):
        obj = {}

        ### status
        obj['status'] = self.status

        ### lb_method  
        obj['lb_method'] = self.lb_method

        ### fallback
        obj['fallback'] = self.fallback

        ### max_addrs_returned
        obj['max_addrs_returned'] = self.max_addrs_returned

        ### distribution tables
        dist_tables = {} 

        # always build the _default distribution table
        dist_tables['_default'] = {}
        dist_tables['_default']['rotation'] = []
        dist_tables['_default']['num_unique_addrs'] = 0
       
        ##################
        ### pool is UP ###
        ##################
        if self.status:
            for member in self.members:
                # do not add members with the weight of 0 - member is disabled
                if member.weight == 0:
                    continue

                # do not add members in DOWN state
                if not member.status:
                    continue

                #
                # add to the _default table
                #

                # add the member IP times it's weight into 
                # the _default distribution table
                for i in range(member.weight):
                    dist_tables['_default']['rotation'].append(member.ip)

                # increase the number of unique addresses in the _default by 1
                dist_tables['_default']['num_unique_addrs'] += 1
       
                # if lb_method is failover group do not add any more members
                if self.lb_method == 'fogroup':
                    break

                #
                # add to a regional table
                #

                # if a topology lb method is used, add the member's IP 
                # to a corresponding regional table 
                if self.lb_method == 'twrr':
                    # create the regional table if it does not exist
                    if member.region not in dist_tables:
                        dist_tables[member.region] = {}
                        dist_tables[member.region]['rotation'] = []
                        dist_tables[member.region]['num_unique_addrs'] = 0

                    # add the member IP times it's weight
                    # into the regional table
                    for i in range(member.weight):
                        dist_tables[member.region]['rotation'].append(
                            member.ip)

                    # increase the number of unique addresses in the table by 1
                    dist_tables[member.region]['num_unique_addrs'] += 1

        ####################
        ### pool is DOWN ###
        ####################
        else:
            for member in self.members:
                # do not add members with weight of 0 - member is disabled
                if member.weight == 0:
                    continue

                # add to the _default table if fallback is set to 'any'
                if self.fallback == 'any':
                    # add the member IP times it's weight into
                    # the _default distribution table
                    for i in range(member.weight):
                        dist_tables['_default']['rotation'].append(member.ip)

                    # increase the number of unique addresses
                    # in the _default by 1
                    dist_tables['_default']['num_unique_addrs'] += 1

        ##################################
        ### post tables creation tasks ###
        ##################################
        for name in dist_tables:
            # randomly shuffle the rotation list
            random.shuffle(dist_tables[name]['rotation']) 
       
            # create index used by ppdns for distribution,
            # set it to a random position, when ppdns is
            # syncing its internal state from shared memory, indexes gets
            # reset, we want to avoid starting from 0 every time
            dist_tables[name]['index'] = \
                int(random.random() * len(dist_tables[name]['rotation'])) 

        obj['dist_tables'] = dist_tables

        return obj
Returns:
dataset/ETHPy150Open polaris-gslb/polaris-gslb/polaris_health/state/pool.py/Pool.to_dist_dict--crossover with--dataset/ETHPy150Open meraki-analytics/cassiopeia/cassiopeia/type/core/summoner.py/Summoner.name