code: def sample(self, obs):
      if np.random.uniform(0, 1) < (
          1.0 - self.epsilon
      ):  # 根据table的Q值选动作
          action = self.predict(obs)
      else:
          action = np.random.choice(self.act_n)  # 有一定概率随机探索选取一个动作
      return action
  
file_path: PARL/examples/tutorials/homework/lesson2/q_learning_frozenlake/agent.py
imports: import numpy
label_desc: Use image node_id 2 for calling the QLearningAgent obj's underlying member method code with example usage: obj.sample(obs) and returns: action