code: def main():
      try:
          logger.info(
              "Getting NASDAQ symbols from http://www.nasdaq.com/"
          )
          url = "http://www.nasdaq.com/screening/companies-by-name.aspx?exchange=NASDAQ&render=download"
          buff = urllib2.urlopen(url).read()
  
          tmpFile = tempfile.NamedTemporaryFile()
          tmpFile.write(buff)
          tmpFile.flush()
          with open(tmpFile.name, "rb") as csvfile:
              symbolsXML = symbolsxml.Writer()
              for row in csv.DictReader(csvfile):
                  symbolsXML.addStock(
                      row["Symbol"],
                      row["Name"],
                      row["Sector"],
                      row["industry"],
                  )
  
          logger.info("Writing nasdaq.xml")
          symbolsXML.write("nasdaq.xml")
      except Exception as e:
          logger.error(str(e))
  
imports: import sys
  import pyalgotrade.logger
  import tempfile
  import urllib2
  import csv
  import symbolsxml
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types