def get_form(self, *args, **kwargs):
        initial = self.get_form_kwargs()
        if 'ip_type' in self.request.GET and 'ip_str' in self.request.GET:
            ip_str = self.request.GET['ip_str']
            ip_type = self.request.GET['ip_type']
            network = calc_parent_str(ip_str, ip_type)
            if network and network.vlan and network.site:
                expected_name = "{0}.{1}.mozilla.com".format(
                    network.vlan.name,
                    network.site.get_site_path())
                try:
                    domain = Domain.objects.get(name=expected_name)
                except __HOLE__:
                    domain = None

            if domain:
                initial['initial'] = {'ip_str': ip_str, 'domain': domain,
                                      'ip_type': ip_type}
            else:
                initial['initial'] = {'ip_str': ip_str, 'ip_type': ip_type}
        return AddressRecordForm(**initial)
dataset/ETHPy150Open mozilla/inventory/mozdns/address_record/views.py/AddressRecordCreateView.get_form