Tensorflow control sources of randomness
Detects if a random seed is set before random number generation. Setting a seed is important for improving reproducibility and avoiding non-determinism.
def tensorflow_control_sources_of_randomness_noncompliant():
    import tensorflow as tf
    # Noncompliant: seed is not set.
    print(tf.random.uniform([1]))
def tensorflow_control_sources_of_randomness_compliant(seed):
    import tensorflow as tf
    # Compliant: sets the seed.
    tf.random.set_seed(seed)
    print(tf.random.uniform([1]))