def default_rng(
    seed: int | BitGenerator | Generator | None = None,
) -> Generator:
    """
    Construct a new Generator with the default BitGenerator (XORWOW).

    Parameters
    ----------
    seed : {None, int,  BitGenerator, Generator}, optional
        A seed to initialize the ``BitGenerator``. If ``None``, then fresh,
        unpredictable entropy will be pulled from the OS.
        Additionally, when passed a ``BitGenerator``, it will be wrapped by
        ``Generator``. If passed a ``Generator``, it will be returned
        unaltered.

    Returns
    -------
    Generator
        The initialized generator object.

    Notes
    -----
    If ``seed`` is not a ``BitGenerator`` or a ``Generator``, a new
    ``BitGenerator`` is instantiated. This function does not manage
    a default global instance.

    See Also
    --------
    numpy.random.default_rng

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    """
    if seed is None:
        return Generator(XORWOW())
    elif isinstance(seed, BitGenerator):
        return Generator(seed)
    elif isinstance(seed, Generator):
        return seed
    else:
        return Generator(XORWOW(seed))

    Construct a new Generator with the default BitGenerator (XORWOW).

    Parameters
    ----------
    seed : {None, int,  BitGenerator, Generator}, optional
        A seed to initialize the ``BitGenerator``. If ``None``, then fresh,
        unpredictable entropy will be pulled from the OS.
        Additionally, when passed a ``BitGenerator``, it will be wrapped by
        ``Generator``. If passed a ``Generator``, it will be returned
        unaltered.

    Returns
    -------
    Generator
        The initialized generator object.

    Notes
    -----
    If ``seed`` is not a ``BitGenerator`` or a ``Generator``, a new
    ``BitGenerator`` is instantiated. This function does not manage
    a default global instance.

    See Also
    --------
    numpy.random.default_rng

    Availability
    --------
    Multiple GPUs, Multiple CPUs
    
cupynumeric/random/_generator.py