def list_pool(arg, opts, shell_opts):
search_string = '<STR_LIT>'<EOL>if type(arg) == list or type(arg) == tuple:<EOL><INDENT>search_string = '<STR_LIT:U+0020>'.join(arg)<EOL><DEDENT>v = get_vrf(opts.get('<STR_LIT>'), default_var='<STR_LIT>', abort=True)<EOL>if v.rt == '<STR_LIT:all>':<EOL><INDENT>vrf_q = None<EOL><DEDENT>else:<EOL><INDENT>vrf_q = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': v.rt<EOL>}<EOL><DEDENT>offset = <NUM_LIT:0><EOL>limit = <NUM_LIT:100><EOL>while True:<EOL><INDENT>res = Pool.smart_search(search_string, { '<STR_LIT>': offset, '<STR_LIT>': limit }, vrf_q)<EOL>if offset == <NUM_LIT:0>: <EOL><INDENT>if shell_opts.show_interpretation:<EOL><INDENT>print("<STR_LIT>")<EOL>_parse_interp_pool(res['<STR_LIT>'])<EOL><DEDENT>if res['<STR_LIT:error>']:<EOL><INDENT>print("<STR_LIT>" % res['<STR_LIT>'])<EOL>return<EOL><DEDENT>if len(res['<STR_LIT:result>']) == <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>")<EOL>return<EOL><DEDENT>print("<STR_LIT>" % (<EOL>"<STR_LIT:Name>", "<STR_LIT:#>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"<EOL>))<EOL>print("<STR_LIT>")<EOL><DEDENT>for p in res['<STR_LIT:result>']:<EOL><INDENT>if len(str(p.description)) > <NUM_LIT>:<EOL><INDENT>desc = p.description[<NUM_LIT:0>:<NUM_LIT>] + "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>desc = p.description<EOL><DEDENT>vrf_rt = '<STR_LIT:->'<EOL>vrf_name = '<STR_LIT:->'<EOL>if p.vrf is not None:<EOL><INDENT>vrf_rt = p.vrf.rt or '<STR_LIT:->'<EOL>vrf_name = p.vrf.name<EOL><DEDENT>tags = '<STR_LIT:->'<EOL>if len(p.tags) > <NUM_LIT:0>:<EOL><INDENT>tags = "<STR_LIT>" % (len(p.tags))<EOL><DEDENT>print("<STR_LIT>" % (<EOL>p.name, tags, desc, p.default_type,<EOL>str(p.ipv4_default_prefix_length or '<STR_LIT:->'),<EOL>str(p.ipv6_default_prefix_length or '<STR_LIT:->'),<EOL>vrf_rt, vrf_name<EOL>))<EOL><DEDENT>if len(res['<STR_LIT:result>']) < limit:<EOL><INDENT>break<EOL><DEDENT>offset += limit<EOL><DEDENT>
List pools matching a search criteria