def collect_tokens(cfg): vlans = cfg.get('vlans', []) vlan_names = [v.get('name', '') for v in vlans] filter_opts = 'All VLANs' + ''.join( f'{n}' for n in vlan_names ) return {'VLAN_FILTER_OPTIONS': filter_opts}