code: def parse(fileName, stockCallback, indexCallback):
      root = etree.parse(open(fileName, "r"))
      if stockCallback is not None:
          for symbol in root.xpath("//symbols/symbol[@type='stock']"):
              stockCallback(Stock(symbol))
      if indexCallback is not None:
          for symbol in root.xpath("//symbols/symbol[@type='index']"):
              indexCallback(Index(symbol))
  
file_path: pyalgotrade/tools/symbols/symbolsxml.py
imports: from lxml import etree
label_desc: Use image node_id 1 for calling a global function with example usage: parse(fileName, stockCallback, indexCallback) without return types