docstr: Iterate through all sub-worlds and shut them down.
docstr_tok: ["Iterate","through","all","sub-worlds","and","shut","them","down","."]
code: def _expire_all_conversations(self):
      """
      Iterate through all sub-worlds and shut them down.
      """
      self.running = False
      for (
          agent_id,
          overworld_fut,
      ) in self.agent_id_to_overworld_future.items():
          self.observe_message(
              agent_id,
              "System: The conversation bot going to go offline soon, "
              "finish any active conversations in the next 5 minutes.",
          )
          overworld_fut.cancel()
  
      # 5 minute grace period for conversations to finish
      time_passed = 0
      while time_passed < 5 * 60:
          any_alive = False
          for task_fut in self.active_worlds.values():
              if task_fut is not None:
                  any_alive = any_alive or task_fut.running()
          if not any_alive:
              break
          time.sleep(1)
  
      # Tell the worlds that they should be shutting down at this point,
      # agents will refer to this value
      self.shutting_down = True
  
imports: from abc import ABC, abstractmethod
  from asyncio import Future
  import copy
  import sys
  import logging
  import datetime
  import threading
  import time
  import traceback
  from typing import Dict, Any, Optional, List, Callable
  from parlai.chat_service.core.agents import ChatServiceAgent
  import parlai.chat_service.utils.logging
  import parlai.chat_service.utils.misc
  import parlai.chat_service.utils.server
  from parlai.chat_service.core.world_runner import ChatServiceWorldRunner
  from parlai.core.opt import Opt
label_desc: Use image node_id 9 for calling the ChatServiceManager obj's underlying member method code with example usage: obj._expire_all_conversations() without return types