class_docstr: Interface for performing queries against exchange API's
      
class_docstr_tok: ["Interface","for","performing","queries","against","exchange","API","'s"]
docstr: Get market data for all symbol pairs listed on all configured exchanges.
  
  Args:
      markets (list, optional): A list of markets to get from the exchanges. Default is all
          markets.
      exchanges (list, optional): A list of exchanges to collect market data from. Default is
          all enabled exchanges.
  
  Decorators:
      retry
  
  Returns:
      dict: A dictionary containing market data for all symbol pairs.
docstr_tok: ["Get","market","data","for","all","symbol","pairs","listed","on","all","configured","exchanges",".","Args",":","markets","(","list",",","optional",")",":","A","list","of","markets","to","get","from","the","exchanges",".","Default","is","all","markets",".","exchanges","(","list",",","optional",")",":","A","list","of","exchanges","to","collect","market","data","from",".","Default","is","all","enabled","exchanges",".","Decorators",":","retry","Returns",":","dict",":","A","dictionary","containing","market","data","for","all","symbol","pairs","."]
code: def get_exchange_markets(self, exchanges=[], markets=[]):
      """Get market data for all symbol pairs listed on all configured exchanges.
  
      Args:
          markets (list, optional): A list of markets to get from the exchanges. Default is all
              markets.
          exchanges (list, optional): A list of exchanges to collect market data from. Default is
              all enabled exchanges.
  
      Decorators:
          retry
  
      Returns:
          dict: A dictionary containing market data for all symbol pairs.
      """
  
      if not exchanges:
          exchanges = self.exchanges
  
      exchange_markets = dict()
      for exchange in exchanges:
          exchange_markets[exchange] = self.exchanges[
              exchange
          ].load_markets()
  
          if markets:
              curr_markets = exchange_markets[exchange]
  
              # Only retrieve markets the users specified
              exchange_markets[exchange] = {
                  key: curr_markets[key]
                  for key in curr_markets
                  if key in markets
              }
  
              for market in markets:
                  if market not in exchange_markets[exchange]:
                      self.logger.info(
                          "%s has no market %s, ignoring.",
                          exchange,
                          market,
                      )
  
          time.sleep(self.exchanges[exchange].rateLimit / 1000)
  
      return exchange_markets
  
file_path: Crypto-Signal/app/exchange.py
imports: import re
  import sys
  import time
  from datetime import datetime, timedelta, timezone
  import ccxt
  import structlog
  from tenacity import retry, retry_if_exception_type, stop_after_attempt
label_desc: Use image node_id 3 for calling the ExchangeInterface obj's underlying member method code with example usage: obj.get_exchange_markets(exchanges, markets) and returns: exchange_markets