code: def _test_markets(self):
      population = 3
      results = dict()
  
      exchanges = select_random_exchanges(
          population
      )  # Type: list[Exchange]
      for exchange in exchanges:
          assets = self._test_markets_exchange(exchange)
  
          if assets is not None:
              results[exchange.name] = len(assets)
  
              folder = get_exchange_folder(exchange.name)
              filename = os.path.join(folder, "whitelist.json")
  
              symbols = [asset.symbol for asset in assets]
              with open(filename, "wt") as handle:
                  json.dump(symbols, handle, indent=4)
  
      series = pd.Series(results)
      print("the tested markets\n{}".format(series))
  
      if population is not None:
          assert len(results) == population
  
      pass
  
imports: import json
  import os
  import random
  from logging import Logger, WARNING
  from time import sleep
  import pandas
  from catalyst.assets._assets import TradingPair
  from logbook import TestHandler
  from catalyst.exchange.exchange_errors import ExchangeRequestError
  from catalyst.exchange.exchange_execution import ExchangeLimitOrder
  from catalyst.exchange.utils.exchange_utils import get_exchange_folder
  from catalyst.exchange.utils.test_utils import select_random_exchanges, handle_exchange_error, select_random_assets
  from catalyst.testing import CatalystTestCase
  from catalyst.testing.fixtures import WithLogger
  from catalyst.exchange.utils.factory import get_exchanges, get_exchange
label_desc: Use image node_id 2 for calling the TestSuiteExchange obj's underlying member method code with example usage: obj._test_markets() without return types