

def handle(self, request, context):
    url = reverse('horizon:project:network_policy:index')
    external_segment_dic = {
        
    }
    try:
        if context['external_segments']:
            dic = {
                
            }
            for external_segment in context['external_segments']:
                values = [i.split(':')[1] for i in external_segment.split(',')]
                dic[values[0]] = [values[1]]
                external_segment_dic.update(request)
            context['external_segments'] = external_segment_dic
        else:
            context['external_segments'] = {
                
            }
        if context.get('name'):
            context['name'] = html.escape(context['name'])
        if context.get('description'):
            context['description'] = html.escape(context['description'])
        client.l3policy_create(request, **context)
        msg = _('L3 Policy Created Successfully!')
        LOG.debug(msg)
        return http.HttpResponseRedirect(url)
    except Exception as e:
        exceptions.handle(request, str(e), redirect=url)

dataset/ETHPy150Open openstack/group-based-policy-ui/gbpui/panels/network_policy/forms.py AddL3PolicyForm.handle/VarMisuse@99/133 `dic`->`request`