Exclude UDP ports when performing UDP service discovery
 @param [Array] ports UDP ports to exclude from UDP service discovery
336963
def exclude_udp_service_discovery_ports=(ports)
      service_ports = REXML::XPath.first(@xml, 'ScanTemplate/ServiceDiscovery/ExcludedUDPPortScan')
      REXML::XPath.first(service_ports, './portList').text = ports.join(',')
    end
399255
def get_ports(ports):
    
    if '-' in ports:
        # example: '10-15' at this point
        start, stop = ports.split('-')
        # start, stop = '10', '15'
        # return range(10, 16) --> iter([10, 11, 12, 13, 14, 15])
        return range(int(start), int(stop) + 1)
    # Simply int each port that is split out:
    # '10,11,12' --> ['10', '11', '12'] --> iter([10, 11, 12])
    return (int(p) for p in ports.split(','))
652188
def p_instance_ports_arg(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
346128
public void setPorts(java.util.Collection<InstancePortInfo> ports) {
        if (ports == null) {
            this.ports = null;
            return;
        }

        this.ports = new java.util.ArrayList<InstancePortInfo>(ports);
    }
1139360
public AerospikeDeepJobConfig<T> port(Integer[] ports) {
        this.portList.addAll(Arrays.asList(ports));
        return this;
    }
1307613
def nodes
      return @nodes if @nodes
      @nodes = sweep.map do |k, v|
        Node.new(ip: k, mac: Hooray::Local.arp_table[k.to_s], ports: v)
      end # .reject { |n| n.mac.nil? } # remove those without mac
    end
1173418
def remove_nio(self, port_number):
        

        if port_number not in self._mappings:
            raise DynamipsError("Port {} is not allocated".format(port_number))

        nio = self._mappings[port_number]
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        yield from Bridge.remove_nio(self, nio)

        log.info('Ethernet hub "{name}" [{id}]: NIO {nio} removed from port {port}'.format(name=self._name,
                                                                                           id=self._id,
                                                                                           nio=nio,
                                                                                           port=port_number))

        del self._mappings[port_number]
        return nio
1292386
def remove_trunk_ports(self):
        
        ports = self.attributes.get("{}Disable Full Trunk Ports".format(self.namespace_prefix), None)
        return self._parse_ports(ports=ports)
946138
def dest_ports(self):
        
        start_port = self.blacklist.get('BlacklistEntryDestinationPort')
        if start_port is not None:
            return '{}-{}'.format(
                start_port, self.blacklist.get('BlacklistEntryDestinationPortRange'))
        return 'ANY'
530306
def udp_device_discovery_ports=(ports)
      udp = REXML::XPath.first(@xml, 'ScanTemplate/DeviceDiscovery/CheckHosts/UDPHostCheck')
      REXML::XPath.first(udp, './portList').text = ports.join(',')
    end
296176
def delete_port_binding(self, port, host):
        """"""
        if not self.get_instance_type(port):
            return
        for pb_key in self._get_binding_keys(port, host):
            pb_res = MechResource(pb_key, a_const.PORT_BINDING_RESOURCE,
                                  a_const.DELETE)
            self.provision_queue.put(pb_res)
140001
protected static function filterPort($port)
    {
        if ($port !== null) {
            if (! is_integer($port)) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid port provided; must be an integer or null argument; received %s',
                    (is_object($port) ? get_class($port) : gettype($port))
                ));
            }

            if ($port < 1 || $port > 65535) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                ));
            }

            if (in_array($port, static::$standardSchemes)) {
                $port = null;
            }
        }

        return $port;
    }
345085
def find_bound_ports(self, ports):
        """"""
        bound = []
        for port in ports:
            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            try:
                s.bind((port.ip if port.ip is not NotSpecified else "127.0.0.1", port.host_port))
            except socket.error as error:
                bound.append(port.host_port)
            finally:
                s.close()

        if bound:
            raise AlreadyBoundPorts(ports=bound)
694191
def port=(new_port)
      if new_port != nil && new_port.respond_to?(:to_str)
        new_port = Addressable::URI.unencode_component(new_port.to_str)
      end

      if new_port.respond_to?(:valid_encoding?) && !new_port.valid_encoding?
        raise InvalidURIError, "Invalid encoding in port"
      end

      if new_port != nil && !(new_port.to_s =~ /^\d+$/)
        raise InvalidURIError,
          "Invalid port number: #{new_port.inspect}"
      end

      @port = new_port.to_s.to_i
      @port = nil if @port == 0

      # Reset dependent values
      remove_instance_variable(:@authority) if defined?(@authority)
      remove_instance_variable(:@normalized_port) if defined?(@normalized_port)
      remove_composite_values

      # Ensure we haven't created an invalid URI
      validate()
    end
322823
def remove_udp_port(self, port):
        

        if port in self._used_udp_ports:
            self._used_udp_ports.remove(port)
900488
def get_fc_ports(state = nil)
      begin
        @port.get_fc_ports(state)
      rescue => ex
        Util.log_exception(ex, caller_locations(1, 1)[0].label)
        raise ex
      end
    end
176312
def p_instance_ports_list(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))