== How to fix it in Numpy

To fix this issue, provide a predictable seed to the random number generator.

=== Code examples

==== Noncompliant code example

[source,python,diff-id=1,diff-type=noncompliant]
----
import numpy as np

def foo():
    generator = np.random.default_rng()  # Noncompliant: no seed parameter is provided
    x = generator.uniform()
----

==== Compliant solution

[source,python,diff-id=1,diff-type=compliant]
----
import numpy as np

def foo():
    generator = np.random.default_rng(42)  # Compliant
    x = generator.uniform()
----
