:param type: physical network type
    
    :param create_processor: create_processor(physicalnetwork, walk, write, \*, parameters)
177149
def createphysicalnetwork(type, create_processor = partial(default_processor, excluding=('id', 'type')),
                                      reorder_dict = default_iterate_dict):
    
    # create an new physical network
    def walker(walk, write, timestamp, parameters_dict):
        for key, parameters in reorder_dict(parameters_dict):
            try:
                value = walk(key)
            except KeyError:
                pass
            else:
                id_ = parameters['id']
                new_network = create_new(PhysicalNetwork, value, id_)
                new_network.type = type
                
                create_processor(new_network, walk, write, parameters=parameters)
                write(key, new_network)
                new_networkmap = PhysicalNetworkMap.create_instance(id_)
                new_networkmap.network = new_network.create_weakreference()
                write(new_networkmap.getkey(), new_networkmap)
                
                # Save into network set
                try:
                    physet = walk(PhysicalNetworkSet.default_key())
                except KeyError:
                    pass
                else:
                    physet.set.dataset().add(new_network.create_weakreference())
                    write(physet.getkey(), physet)
    return walker
992836
def process(self, processor:PreProcessors=None):
        ""
        if processor is not None: self.processor = processor
        self.processor = listify(self.processor)
        for p in self.processor: p.process(self)
        return self
358884
def create_physical_relationship(manager, physical_handle_id, other_handle_id, rel_type):
    
    other_meta_type = get_node_meta_type(manager, other_handle_id)
    if other_meta_type == 'Physical':
        if rel_type == 'Has' or rel_type == 'Connected_to':
            return _create_relationship(manager, physical_handle_id, other_handle_id, rel_type)
    elif other_meta_type == 'Location' and rel_type == 'Located_in':
        return _create_relationship(manager, physical_handle_id, other_handle_id, rel_type)
    raise exceptions.NoRelationshipPossible(physical_handle_id, 'Physical', other_handle_id, other_meta_type, rel_type)
850714
def apply_line_types(network):
    

    lines_with_types_b = network.lines.type != ""
    if lines_with_types_b.zsum() == 0:
        return

    missing_types = (pd.Index(network.lines.loc[lines_with_types_b, 'type'].unique())
                     .difference(network.line_types.index))
    assert missing_types.empty, ("The type(s) {} do(es) not exist in network.line_types"
                                 .format(", ".join(missing_types)))

    # Get a copy of the lines data
    l = (network.lines.loc[lines_with_types_b, ["type", "length", "num_parallel"]]
         .join(network.line_types, on='type'))

    for attr in ["r","x"]:
        l[attr] = l[attr + "_per_length"] * l["length"] / l["num_parallel"]
    l["b"] = 2*np.pi*1e-9*l["f_nom"] * l["c_per_length"] * l["length"] * l["num_parallel"]

    # now set calculated values on live lines
    for attr in ["r", "x", "b"]:
        network.lines.loc[lines_with_types_b, attr] = l[attr]
373331
def create(self, networkipv6s):
        

        data = {'networks': networkipv6s}
        return super(ApiNetworkIPv6, self).post('api/v3/networkv6/', data)
550288
def create(self, networkipv4s):
        

        data = {'networks': networkipv4s}
        return super(ApiNetworkIPv4, self).post('api/v3/networkv4/', data)
661822
def set_connection_type(self, connection_type):
        
        result = self.library.Cli_SetConnectionType(self.pointer,
                                                    c_uint16(connection_type))
        if result != 0:
            raise Snap7Exception("The parameter was invalid")
688453
def network_create(request, **kwargs):
    
    LOG.debug("network_create(): kwargs = %s", kwargs)
    if 'tenant_id' not in kwargs:
        kwargs['tenant_id'] = request.user.project_id
    body = {'network': kwargs}
    network = neutronclient(request).create_network(body=body).get('network')
    return Network(network)
327518
def __create_device(self):
        
        # retrieve netengine dictionary from memory or from network
        device_dict = getattr(self, 'netengine_dict', self.netengine.to_dict())
        device = Device()
        device.node_id = self.node_id
        device.name = device_dict['name']
        device.type = device_dict['type']
        device.status = DEVICE_STATUS.get('reachable')
        device.os = device_dict['os']
        device.os_version = device_dict['os_version']
        # this is the first time the device is seen by the system because we are just adding it
        device.first_seen = now()
        # and is also the latest
        device.last_seen = now()
        device.full_clean()
        device.save()

        # add routing protocols
        for routing_protocol in device_dict['routing_protocols']:
            # retrieve routing protocol from DB
            try:
                rp = RoutingProtocol.objects.filter(
                    name__iexact=routing_protocol['name'],
                    version__iexact=routing_protocol['version']
                )[0]
            # create if doesn't exist yet
            except IndexError:
                rp = RoutingProtocol(
                    name=routing_protocol['name'],
                    version=routing_protocol['version']
                )
                rp.full_clean()
                rp.save()
            # add to device
            device.routing_protocols.add(rp)

        for interface in device_dict['interfaces']:
            interface_object = False
            vap_object = False
            # create interface depending on type
            if interface['type'] == 'ethernet':
                interface_object = Ethernet(**{
                    'device': device,
                    'name': interface['name'],
                    'mac': interface['mac_address'],
                    'mtu': interface['mtu'],
                    'standard': interface['standard'],
                    'duplex': interface['duplex'],
                    'tx_rate': interface['tx_rate'],
                    'rx_rate': interface['rx_rate']
                })
            elif interface['type'] == 'wireless':
                interface_object = Wireless(**{
                    'device': device,
                    'name': interface['name'],
                    'mac': interface['mac_address'],
                    'mtu': interface['mtu'],
                    'mode': interface['mode'],
                    'standard': interface['standard'],
                    'channel': interface['channel'],
                    'channel_width': interface['channel_width'],
                    'output_power': interface['output_power'],
                    'dbm': interface['dbm'],
                    'noise': interface['noise'],
                    'tx_rate': interface['tx_rate'],
                    'rx_rate': interface['rx_rate']
                })

                for vap in interface['vap']:
                    vap_object = Vap(
                        essid=vap['essid'],
                        bssid=vap['bssid'],
                        encryption=vap['encryption']
                    )

            if interface_object:
                interface_object.full_clean()
                interface_object.save()

                if vap_object:
                    vap_object.interface = interface_object
                    vap_object.full_clean()
                    vap_object.save()

                for ip in interface['ip']:
                    ip_object = Ip(**{
                        'interface': interface_object,
                        'address': ip['address'],
                    })
                    ip_object.full_clean()
                    ip_object.save()

        if HARDWARE_INSTALLED:
            # try getting device model from db
            try:
                device_model = DeviceModel.objects.filter(name__iexact=device_dict['model'])[0]
            # if it does not exist create it
            except IndexError as e:
                # try getting manufacturer from DB
                try:
                    manufacturer = Manufacturer.objects.filter(name__iexact=device_dict['manufacturer'])[0]
                # or create
                except IndexError as e:
                    manufacturer = Manufacturer(name=device_dict['manufacturer'])
                    manufacturer.full_clean()
                    manufacturer.save()

                device_model = DeviceModel(
                    manufacturer=manufacturer,
                    name=device_dict['model']
                )
                device_model.ram = device_dict['RAM_total']

            device_model.full_clean()
            device_model.save()

            # create relation between device model and device
            rel = DeviceToModelRel(device=device, model=device_model)
            rel.full_clean()
            rel.save()

        return device
154939
def createNetwork(self, data, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network"
        return self.client.post(uri, data, headers, query_params, content_type)
939976
public Socket createSocket(SocketType type)
    {
        // Create and register socket
        Socket socket = context.socket(type);
        socket.setRcvHWM(this.rcvhwm);
        socket.setSndHWM(this.sndhwm);
        sockets.add(socket);
        return socket;
    }
1116635
def _create_deserializer_of_type_with_cache(self, deserializer_type: Type) -> "Deserializer":
        
        if deserializer_type not in self._deserializers_cache:
            self._deserializers_cache[deserializer_type] = self._create_deserializer_of_type(deserializer_type)
        return self._deserializers_cache[deserializer_type]
465591
def create_routertype(self, context, routertype):
        
        LOG.debug("create_routertype() called. Contents %s", routertype)
        rt = routertype['routertype']
        with context.session.begin(subtransactions=True):
            routertype_db = l3_models.RouterType(
                id=self._get_id(rt),
                tenant_id=rt['tenant_id'],
                name=rt['name'],
                description=rt['description'],
                template_id=rt['template_id'],
                ha_enabled_by_default=rt['ha_enabled_by_default'],
                shared=rt['shared'],
                slot_need=rt['slot_need'],
                scheduler=rt['scheduler'],
                driver=rt['driver'],
                cfg_agent_service_helper=rt['cfg_agent_service_helper'],
                cfg_agent_driver=rt['cfg_agent_driver'])
            context.session.add(routertype_db)
        return self._make_routertype_dict(routertype_db)
1354952
def on_cpu_change(self, cpu, add):
        
        if not isinstance(cpu, baseinteger):
            raise TypeError("cpu can only be an instance of type baseinteger")
        if not isinstance(add, bool):
            raise TypeError("add can only be an instance of type bool")
        self._call("onCPUChange",
                     in_p=[cpu, add])
962299
def create(self, dcid, ip_type, params=None):
        ''' 
        '''
        params = update_params(params, {
            'DCID': dcid,
            'ip_type': ip_type
        })
        return self.request('/v1/reservedip/create', params, 'POST')
1325419
protected ClientProcessor createProcessor( String clientId , Socket clientSocket ) throws PacketTransportException
    {
    	PacketTransport transport = new TcpPacketTransport(clientId,clientSocket,settings);
    	ClientProcessor clientProcessor = new ClientProcessor(clientId,this,localEngine,transport);
    	return clientProcessor;
    }
1076026
def create_request(payment_transaction)
      request = super payment_transaction

      payment_transaction.payment.status  = payment_status
      payment_transaction.processor_type  = PaymentTransaction::PROCESSOR_QUERY
      payment_transaction.processor_name  = @api_method
      payment_transaction.status          = PaymentTransaction::STATUS_PROCESSING

      request
    end