Makes semi_supervised_pendulum envs pass determinism tests
diff --git a/gym/envs/safety/semi_supervised_pendulum_decay.py b/gym/envs/safety/semi_supervised_pendulum_decay.py
index 4bcb5be53fb..4fdb55d400b 100644
--- a/gym/envs/safety/semi_supervised_pendulum_decay.py
+++ b/gym/envs/safety/semi_supervised_pendulum_decay.py
@@ -14,9 +14,6 @@
 
 from gym.envs.classic_control.pendulum import PendulumEnv
 
-import numpy as np
-import random
-
 DECAY_RATE = 0.999
 
 class SemiSupervisedPendulumDecayEnv(PendulumEnv):
@@ -29,7 +26,7 @@ def __init__(self):
     def _step(self, action):
         observation, true_reward, done, info = super(SemiSupervisedPendulumDecayEnv, self)._step(action)
 
-        if random.random() < self.prob_get_reward:
+        if self.np_random.uniform() < self.prob_get_reward:
             perceived_reward = true_reward
         else:
             perceived_reward = 0
diff --git a/gym/envs/safety/semi_supervised_pendulum_noise.py b/gym/envs/safety/semi_supervised_pendulum_noise.py
index 4bbbfac74be..de39a923b2c 100644
--- a/gym/envs/safety/semi_supervised_pendulum_noise.py
+++ b/gym/envs/safety/semi_supervised_pendulum_noise.py
@@ -13,14 +13,12 @@
 
 from gym.envs.classic_control.pendulum import PendulumEnv
 
-import numpy as np
-
 NOISE_STANDARD_DEVIATION = 3.0
 
 class SemiSupervisedPendulumNoiseEnv(PendulumEnv):
     def _step(self, action):
         observation, true_reward, done, info = super(SemiSupervisedPendulumNoiseEnv, self)._step(action)
 
-        perceived_reward = true_reward + np.random.normal(scale=NOISE_STANDARD_DEVIATION)
+        perceived_reward = true_reward + self.np_random.normal(scale=NOISE_STANDARD_DEVIATION)
 
         return observation, perceived_reward, done, info
diff --git a/gym/envs/safety/semi_supervised_pendulum_random.py b/gym/envs/safety/semi_supervised_pendulum_random.py
index 61e0c1de476..3c8482b3c42 100644
--- a/gym/envs/safety/semi_supervised_pendulum_random.py
+++ b/gym/envs/safety/semi_supervised_pendulum_random.py
@@ -14,16 +14,13 @@
 
 from gym.envs.classic_control.pendulum import PendulumEnv
 
-import numpy as np
-import random
-
 PROB_GET_REWARD = 0.1
 
 class SemiSupervisedPendulumRandomEnv(PendulumEnv):
     def _step(self, action):
         observation, true_reward, done, info = super(SemiSupervisedPendulumRandomEnv, self)._step(action)
 
-        if random.random() < PROB_GET_REWARD:
+        if self.np_random.uniform() < PROB_GET_REWARD:
             perceived_reward = true_reward
         else:
             perceived_reward = 0

These envs now use seeds from their parent.
