src/quagen/ai/biased.py
def _get_distributed_candidates(self, available_spots, num_candidates):
        """
        Randomly chooses spots equally distributed from the available spots

        Args:
            available_spots (list): All spots to choose from
            num_candidates (int): Number of spots to choose

        Returns:
            (list) of choosen candidates
        """
        candidate_spots = []

        # Break up and shuffle the available spots
        distributed_chunks = chunk_list(available_spots, num_candidates)
        random.shuffle(distributed_chunks)
        for spots in distributed_chunks:
            random.shuffle(spots)

        # Grab candidates until we hit spot count or run out of spots.
        i = 0
        while len(candidate_spots) < num_candidates and distributed_chunks:

            spots = distributed_chunks[i]
            if spots:
                candidate_spots.append(spots.pop())
            else:
                del distributed_chunks[i]

            i = (i + 1) if i < (len(distributed_chunks) - 1) else 0

        return candidate_spots

        Randomly chooses spots equally distributed from the available spots

        Args:
            available_spots (list): All spots to choose from
            num_candidates (int): Number of spots to choose

        Returns:
            (list) of choosen candidates
        
Randomly chooses spots equally distributed from the available spots
Randomly chooses spots equally distributed from the available spots
def _get_distributed_candidates(self, available_spots, num_candidates):
        candidate_spots = []
        distributed_chunks = chunk_list(available_spots, num_candidates)
        random.shuffle(distributed_chunks)
        for spots in distributed_chunks:
            random.shuffle(spots)
        i = 0
        while len(candidate_spots) < num_candidates and distributed_chunks:
            spots = distributed_chunks[i]
            if spots:
                candidate_spots.append(spots.pop())
            else:
                del distributed_chunks[i]
            i = (i + 1) if i < (len(distributed_chunks) - 1) else 0
        return candidate_spots
def _get_distributed_candidates ( self , available_spots , num_candidates ) : candidate_spots = [ ] distributed_chunks = chunk_list ( available_spots , num_candidates ) random . shuffle ( distributed_chunks ) for spots in distributed_chunks : random . shuffle ( spots ) i = 0 while len ( candidate_spots ) < num_candidates and distributed_chunks : spots = distributed_chunks [ i ] if spots : candidate_spots . append ( spots . pop ( ) ) else : del distributed_chunks [ i ] i = ( i + 1 ) if i < ( len ( distributed_chunks ) - 1 ) else 0 return candidate_spots
Randomly chooses spots equally distributed from the available spots
Randomly chooses spots equally distributed from the available spots
"""
        Randomly chooses spots equally distributed from the available spots

        Args:
            available_spots (list): All spots to choose from
            num_candidates (int): Number of spots to choose

        Returns:
            (list) of choosen candidates
        """ # Break up and shuffle the available spots # Grab candidates until we hit spot count or run out of spots.
(list) of choosen candidates
( list ) of choosen candidates
self
available_spots
All spots to choose from
All spots to choose from
num_candidates
Number of spots to choose
Number of spots to choose