def extend_list(self, data, parsed_args):
neutron_client = self.get_client()<EOL>search_opts = {'<STR_LIT>': ['<STR_LIT:id>', '<STR_LIT>']}<EOL>if self.pagination_support:<EOL><INDENT>page_size = parsed_args.page_size<EOL>if page_size:<EOL><INDENT>search_opts.update({'<STR_LIT>': page_size})<EOL><DEDENT><DEDENT>subnet_ids = []<EOL>for n in data:<EOL><INDENT>if '<STR_LIT>' in n:<EOL><INDENT>subnet_ids.extend(n['<STR_LIT>'])<EOL><DEDENT><DEDENT>def _get_subnet_list(sub_ids):<EOL><INDENT>search_opts['<STR_LIT:id>'] = sub_ids<EOL>return neutron_client.list_subnets(<EOL>**search_opts).get('<STR_LIT>', [])<EOL><DEDENT>try:<EOL><INDENT>subnets = _get_subnet_list(subnet_ids)<EOL><DEDENT>except exceptions.RequestURITooLong as uri_len_exc:<EOL><INDENT>subnet_count = len(subnet_ids)<EOL>max_size = ((self.subnet_id_filter_len * subnet_count) -<EOL>uri_len_exc.excess)<EOL>chunk_size = max_size // self.subnet_id_filter_len<EOL>subnets = []<EOL>for i in range(<NUM_LIT:0>, subnet_count, chunk_size):<EOL><INDENT>subnets.extend(<EOL>_get_subnet_list(subnet_ids[i: i + chunk_size]))<EOL><DEDENT><DEDENT>subnet_dict = dict([(s['<STR_LIT:id>'], s) for s in subnets])<EOL>for n in data:<EOL><INDENT>if '<STR_LIT>' in n:<EOL><INDENT>n['<STR_LIT>'] = [(subnet_dict.get(s) or {"<STR_LIT:id>": s})<EOL>for s in n['<STR_LIT>']]<EOL><DEDENT><DEDENT>
Add subnet information to a network list.