<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
 """Function to create Openstack network. This function does the following: 1. Allocate an IP address with the net_id/subnet_id not filled in the DB. 2. Fill network parameters w/o vlan, segmentation_id, because we don't have net_id to store in DB. 3. Create a Openstack network, using the network parameters created in the previous step. At this point we will have a net_id. 4. Allocate segmentation_id, vlan and along with net_id store it in the DB. 5. Update IP DB with net_id created in step 3. So, after restart deallocate any IP DB entries that does not have a net_id/subnet_id. """

        subnet = self.alloc_retrieve_subnet_info(tenant_id, direc)
        network = self.retrieve_network_info(tenant_id, direc)
        net_id, subnet_id = self.create_openstack_network(subnet, network,
                                                          tenant_id,
                                                          tenant_name, direc)
        if not net_id or not subnet_id:
            return net_id, subnet_id
        self.allocate_seg_vlan(net_id, is_fw_virt, direc, tenant_id)
        self.update_subnet_db_info(tenant_id, direc, net_id, subnet_id)
        return net_id, subnet_id