def list_asn(self, auth, asn=None):
if asn is None:<EOL><INDENT>asn = {}<EOL><DEDENT>self._logger.debug("<STR_LIT>" % unicode(asn))<EOL>sql = "<STR_LIT>"<EOL>params = list()<EOL>where, params = self._expand_asn_spec(asn)<EOL>if len(params) > <NUM_LIT:0>:<EOL><INDENT>sql += "<STR_LIT>" + where<EOL><DEDENT>sql += "<STR_LIT>"<EOL>self._execute(sql, params)<EOL>res = list()<EOL>for row in self._curs_pg:<EOL><INDENT>res.append(dict(row))<EOL><DEDENT>return res<EOL>
List AS numbers matching `spec`.

            * `auth` [BaseAuth]
                AAA options.
            * `spec` [asn_spec]
                An automous system number specification. If omitted, all ASNs
                are returned.

            Returns a list of dicts.

            This is the documentation of the internal backend function. It's
            exposed over XML-RPC, please also see the XML-RPC documentation for
            :py:func:`nipap.xmlrpc.NipapXMLRPC.list_asn` for full
            understanding.