docstr: :param num_consecutive_playing_steps: The number steps to fetch.
docstr_tok: [":","param","num_consecutive_playing_steps",":","The","number","steps","to","fetch","."]
code: def run(self, num_consecutive_playing_steps):
      """
      :param num_consecutive_playing_steps: The number steps to fetch.
      """
      transitions = 0
      episodes = 0
      steps = 0
      for message in self.pubsub.listen():
          if message and "data" in message:
              try:
                  obj = pickle.loads(message["data"])
                  if type(obj) == Transition:
                      transitions += 1
                      if obj.game_over:
                          episodes += 1
                      yield obj
                  elif type(obj) == Episode:
                      episodes += 1
                      transitions += len(obj.transitions)
                      yield from obj.transitions
              except Exception:
                  continue
  
          if type(num_consecutive_playing_steps) == EnvironmentSteps:
              steps = transitions
          if type(num_consecutive_playing_steps) == EnvironmentEpisodes:
              steps = episodes
  
          if steps >= num_consecutive_playing_steps.num_steps:
              break
  
imports: import redis
  import pickle
  import uuid
  import time
  from rl_coach.memories.backend.memory import MemoryBackend, MemoryBackendParameters
  from rl_coach.core_types import Transition, Episode, EnvironmentSteps, EnvironmentEpisodes
  from rl_coach.logger import screen
label_desc: Use image node_id 2 for calling the RedisSub obj's underlying member method code with example usage: obj.run(num_consecutive_playing_steps) without return types