federated/utils/data_utils.py
def randomly_select_clients_for_round(
    population: int, num_of_clients: int, replace: bool = False, seed: int = None
) -> functools.partial:
    """This function creates a partial function for sampling random clients.

    Args:
        population (int): Client population size.\n
        num_of_clients (int): Number of clients.\n
        replace (bool, optional): With or without replacement. Defaults to False.\n
        seed (int, optional): Random seed. Defaults to None.\n

    Returns:
        functools.partial: A partial function for randomly selecting clients.
    """

    def select(round_number, seed, replace):
        return np.random.RandomState().choice(
            population, num_of_clients, replace=replace
        )

    return functools.partial(select, seed=seed, replace=False)
This function creates a partial function for sampling random clients.

    Args:
        population (int): Client population size.\n
        num_of_clients (int): Number of clients.\n
        replace (bool, optional): With or without replacement. Defaults to False.\n
        seed (int, optional): Random seed. Defaults to None.\n

    Returns:
        functools.partial: A partial function for randomly selecting clients.
    
This function creates a partial function for sampling random clients.
This function creates a partial function for sampling random clients .
def randomly_select_clients_for_round(
    population: int, num_of_clients: int, replace: bool = False, seed: int = None
) -> functools.partial:
    def select(round_number, seed, replace):
        return np.random.RandomState().choice(
            population, num_of_clients, replace=replace
        )
    return functools.partial(select, seed=seed, replace=False)
def randomly_select_clients_for_round ( population : int , num_of_clients : int , replace : bool = False , seed : int = None ) -> functools . partial : def select ( round_number , seed , replace ) : return np . random . RandomState ( ) . choice ( population , num_of_clients , replace = replace ) return functools . partial ( select , seed = seed , replace = False )
This function creates a partial function for sampling random clients.
This function creates a partial function for sampling random clients .
"""This function creates a partial function for sampling random clients.

    Args:
        population (int): Client population size.\n
        num_of_clients (int): Number of clients.\n
        replace (bool, optional): With or without replacement. Defaults to False.\n
        seed (int, optional): Random seed. Defaults to None.\n

    Returns:
        functools.partial: A partial function for randomly selecting clients.
    """
A partial function for randomly selecting clients.
A partial function for randomly selecting clients .
functools.partial
population
int
Client population size.\n
Client population size . \ n
num_of_clients
int
Number of clients.\n
Number of clients . \ n
replace
bool
With or without replacement. Defaults to False.\n
With or without replacement . Defaults to False . \ n
False
seed
int
Random seed. Defaults to None.\n
Random seed . Defaults to None . \ n
None