Retrieve a named (symbol list name) list of strings (symbols)

    If you've installed the QSTK Quantitative analysis toolkit
        `get_symbols_from_list('sp5002012')` will produce a list of the symbols that
        were members of the S&P 500 in 2012.
    Otherwise an import error exception will be raised.
        If the symbol list cannot be found you'll get an empty list returned

    Example:
      >> len(get_symbols_from_list('sp5002012')) in (0, 501)
      True

def get_symbols_from_list(list_name):
    """Retrieve a named (symbol list name) list of strings (symbols)

    If you've installed the QSTK Quantitative analysis toolkit
        `get_symbols_from_list('sp5002012')` will produce a list of the symbols that
        were members of the S&P 500 in 2012.
    Otherwise an import error exception will be raised.
        If the symbol list cannot be found you'll get an empty list returned

    Example:
      >> len(get_symbols_from_list('sp5002012')) in (0, 501)
      True
    """
    try:
        # quant software toolkit has a method for retrieving lists of symbols like S&P500 for 2012 with 'sp5002012'
        import QSTK.qstkutil.DataAccess as da
        dataobj = da.DataAccess('Yahoo')
    except ImportError:
        raise
    except:
        return []
    try:
        return dataobj.get_symbols_from_list(list_name)
    except:
        raise