def _get_sg_name_dict(self, data, page_size, no_nameconv):
if no_nameconv:<EOL><INDENT>return {}<EOL><DEDENT>neutron_client = self.get_client()<EOL>search_opts = {'<STR_LIT>': ['<STR_LIT:id>', '<STR_LIT:name>']}<EOL>if self.pagination_support:<EOL><INDENT>if page_size:<EOL><INDENT>search_opts.update({'<STR_LIT>': page_size})<EOL><DEDENT><DEDENT>sec_group_ids = set()<EOL>for rule in data:<EOL><INDENT>for key in self.replace_rules:<EOL><INDENT>if rule.get(key):<EOL><INDENT>sec_group_ids.add(rule[key])<EOL><DEDENT><DEDENT><DEDENT>sec_group_ids = list(sec_group_ids)<EOL>def _get_sec_group_list(sec_group_ids):<EOL><INDENT>search_opts['<STR_LIT:id>'] = sec_group_ids<EOL>return neutron_client.list_security_groups(<EOL>**search_opts).get('<STR_LIT>', [])<EOL><DEDENT>try:<EOL><INDENT>secgroups = _get_sec_group_list(sec_group_ids)<EOL><DEDENT>except exceptions.RequestURITooLong as uri_len_exc:<EOL><INDENT>sec_group_id_filter_len = <NUM_LIT><EOL>sec_group_count = len(sec_group_ids)<EOL>max_size = ((sec_group_id_filter_len * sec_group_count) -<EOL>uri_len_exc.excess)<EOL>chunk_size = max_size // sec_group_id_filter_len<EOL>secgroups = []<EOL>for i in range(<NUM_LIT:0>, sec_group_count, chunk_size):<EOL><INDENT>secgroups.extend(<EOL>_get_sec_group_list(sec_group_ids[i: i + chunk_size]))<EOL><DEDENT><DEDENT>return dict([(sg['<STR_LIT:id>'], sg['<STR_LIT:name>'])<EOL>for sg in secgroups if sg['<STR_LIT:name>']])<EOL>
Get names of security groups referred in the retrieved rules.

        :return: a dict from secgroup ID to secgroup name