code: def sample(self, obs):
      sample = np.random.rand()
      if sample < self.e_greed:
          act = np.random.randint(self.act_dim)
      else:
          act = self.predict(obs)
      self.e_greed = max(0.01, self.e_greed - self.e_greed_decrement)
      return act
  
file_path: PARL/benchmark/fluid/DQN/cartpole_agent.py
imports: import numpy
  import paddle.fluid
  import parl
  from parl import layers
label_desc: Use image node_id 3 for calling the CartpoleAgent obj's underlying member method code with example usage: obj.sample(obs) and returns: act