def seeds2probs(n: int, seeds: Union[(dict, np.ndarray)]=None) -> np.ndarray:
    'Transform seeds into probability vector.\n\n    Parameters\n    ----------\n    n : int\n        Total number of samples.\n    seeds :\n        If ``None``, the uniform distribution is used.\n        Otherwise, a non-negative, non-zero vector or a dictionary must be provided.\n\n    Returns\n    -------\n    probs: np.ndarray\n        A probability vector.\n    '
    if (seeds is None):
        return (np.ones(n) / n)
    else:
        seeds = check_seeds(seeds, n)
        probs = np.zeros_like(seeds, dtype=float)
        ix = (seeds > 0)
        probs[ix] = seeds[ix]
        w: float = probs.sum()
        if (w > 0):
            return (probs / w)
        else:
            raise ValueError('At least one seeds must have a positive probability.')
Transform seeds into probability vector.

Parameters
----------
n : int
    Total number of samples.
seeds :
    If ``None``, the uniform distribution is used.
    Otherwise, a non-negative, non-zero vector or a dictionary must be provided.

Returns
-------
probs: np.ndarray
    A probability vector.
def seeds2probs(n: int, seeds: Union[(dict, np.ndarray)]=None) -> np.ndarray:
    'Transform seeds into probability vector.\n\n    Parameters\n    ----------\n    n : int\n        Total number of samples.\n    seeds :\n        If ``None``, the uniform distribution is used.\n        Otherwise, a non-negative, non-zero vector or a dictionary must be provided.\n\n    Returns\n    -------\n    probs: np.ndarray\n        A probability vector.\n    '
    if (seeds is None):
        return (np.ones(n) / n)
    else:
        seeds = check_seeds(seeds, n)
        probs = np.zeros_like(seeds, dtype=float)
        ix = (seeds > 0)
        probs[ix] = seeds[ix]
        w: float = probs.sum()
        if (w > 0):
            return (probs / w)
        else:
            raise ValueError('At least one seeds must have a positive probability.')