=========================================================================
 IPT

 @param:  <none>
 @return: Array of IPT
=========================================================================
199788
def get_ipts
      recl = 4

      begin
        ipts = (0..11).map do |i|
          ary = (0..2).map do |j|
            File.binread(@bin_path, recl, @pos + recl * j).unpack("I*")[0]
          end
          @pos += recl * 3
          ary
        end
        return ipts
      rescue => e
        raise
      end
    end
217014
def return_values(self):
        

        j = self.json()
        #TODO: FIXME: get rid of old API when its support will be removed
        public_api_value = j.get('returnValues')
        old_private_value = j.get('endpoints')
        new_private_value = self.__collect_interfaces_return(j.get('interfaces', {}))

        retvals = new_private_value or old_private_value or public_api_value or []
        # TODO: Public api hack.
        if self._router.public_api_in_use:
            return retvals
        return self.__parse(retvals)
400249
def find_ips(self, text):
        
        for regex in self.regex_expressions:
            ips = regex.findall(text)
            if len(ips) > 0:
                return ips
        return []
855842
def get_interface_addresses():
    

    addresses = []
    ifaces = netifaces.interfaces()
    for iface in ifaces:
        addrs = netifaces.ifaddresses(iface)
        families = addrs.keys()

        # put IPv4 to the end so it lists as the main iface address
        if netifaces.AF_INET in families:
            families.remove(netifaces.AF_INET)
            families.append(netifaces.AF_INET)

        for family in families:
            for addr in addrs[family]:
                address = {
                    'name': iface,
                    'family': family,
                    'ip': addr['addr'],
                }
                addresses.append(address)

    return addresses
932764
protected Vec[][] makeTemplates() {
    Vec anyVec = dataset.anyVec();
    final long[][] espcPerSplit = computeEspcPerSplit(anyVec._espc, anyVec.length());
    final int num = dataset.numCols(); // number of columns in input frame
    final int nsplits = espcPerSplit.length; // number of splits
    final String[][] domains = dataset.domains(); // domains
    final boolean[] uuids = dataset.uuids();
    final byte[] times = dataset.times();
    Vec[][] t = new Vec[nsplits][/*num*/]; // resulting vectors for all
    for (int i=0; i<nsplits; i++) {
      // vectors for j-th split
      t[i] = new Vec(Vec.newKey(),espcPerSplit[i/*-th split*/]).makeZeros(num, domains, uuids, times);
    }
    return t;
  }
1150259
def array(self):
        
        return np.linspace(self.start, self.stop, self.num, self.endpoint)
511587
def [](key)
      if key.instance_of?(0.class)
        @slave.send("read_#{@type}", key, 1)
      elsif key.instance_of?(Range)
        @slave.send("read_#{@type}s", key.first, key.count)
      else
        raise ModBus::Errors::ProxyException, "Invalid argument, must be integer or range. Was #{key.class}"
      end
    end
769521
def get_ipv4(hostname):
    
    addrinfo = socket.getaddrinfo(hostname, None, socket.AF_INET,
                                  socket.SOCK_STREAM)
    return [addrinfo[x][4][0] for x in range(len(addrinfo))]
1362935
def _get_ipv6addrs(self):
        
        addrs = self._get_addrs()
        ipv6addrs = addrs.get(netifaces.AF_INET6)
        if not ipv6addrs:
            return {}
        return ipv6addrs[0]
274203
function cidArray (path) {
  if (path[path.length - 1] === '/') {
    path = path.substring(0, path.length - 1)
  }
  // skip /ipxs/ prefix
  if (path.match(/^\/ip[fn]s\//)) {
    path = path.substring(6)
  }
  // skip ipxs:// protocol
  if (path.match(/^ip[fn]s:\/\//)) {
    path = path.substring(7)
  }
  return path.split('/')
}
480934
def get_ips(linode_id=None):
    '''
    
    '''
    if linode_id:
        ips = _query('linode', 'ip.list', args={'LinodeID': linode_id})
    else:
        ips = _query('linode', 'ip.list')

    ips = ips['DATA']
    ret = {}

    for item in ips:
        node_id = six.text_type(item['LINODEID'])
        if item['ISPUBLIC'] == 1:
            key = 'public_ips'
        else:
            key = 'private_ips'

        if ret.get(node_id) is None:
            ret.update({node_id: {'public_ips': [], 'private_ips': []}})
        ret[node_id][key].append(item['IPADDRESS'])

    # If linode_id was specified, only return the ips, and not the
    # dictionary based on the linode ID as a key.
    if linode_id:
        _all_ips = {'public_ips': [], 'private_ips': []}
        matching_id = ret.get(six.text_type(linode_id))
        if matching_id:
            _all_ips['private_ips'] = matching_id['private_ips']
            _all_ips['public_ips'] = matching_id['public_ips']

        ret = _all_ips

    return ret
711541
def host_to_ips(host):
    '''
    
    '''
    ips = []
    try:
        for family, socktype, proto, canonname, sockaddr in socket.getaddrinfo(
                host, 0, socket.AF_UNSPEC, socket.SOCK_STREAM):
            if family == socket.AF_INET:
                ip, port = sockaddr
            elif family == socket.AF_INET6:
                ip, port, flow_info, scope_id = sockaddr
            ips.append(ip)
        if not ips:
            ips = None
    except Exception:
        ips = None
    return ips
442361
def network_hosts(value, options=None, version=None):
    '''
    
    '''
    ipaddr_filter_out = _filter_ipaddr(value, options=options, version=version)
    if not ipaddr_filter_out:
        return
    if not isinstance(value, (list, tuple, types.GeneratorType)):
        return _network_hosts(ipaddr_filter_out[0])
    return [
        _network_hosts(ip_a)
        for ip_a in ipaddr_filter_out
    ]
310228
def array(self):
        
        if self._intervals_len:
            if self._array_len != self._intervals_len:
                if not self._array_len:
                    self._array = np.array(self.intervals) \
                        if hasattr(np, 'array') else self.intervals
                else:
                    self._array = np.concatenate((
                        self._array, self.intervals), axis=0) \
                        if hasattr(np, 'concatenate') else \
                        (self._array + self.intervals)
                self._array_len += len(self.intervals)
                self.intervals = []
            return self._array
        return []
795571
def p_array(self,t):
    
    if len(t)==4: t[0] = ArrayLit(t[2].children)
    elif len(t)==5: t[0] = ArrayLit(t[3].children)
    else: raise NotImplementedError('unk_len',len(t)) # pragma: no cover
521106
def list(self, subid, params=None):
        ''' 
        '''
        params = update_params(params, {'SUBID': subid})
        return self.request('/v1/server/list_ipv4', params, 'GET')
1344717
def _create_ip_address_objs(ip_addresses, cloud_manager):
        
        # ip-addresses might be provided as a flat array or as a following dict:
        # {'ip_addresses': {'ip_address': [...]}} || {'ip_address': [...]}

        if 'ip_addresses' in ip_addresses:
            ip_addresses = ip_addresses['ip_addresses']

        if 'ip_address' in ip_addresses:
            ip_addresses = ip_addresses['ip_address']

        return [
            IPAddress(cloud_manager=cloud_manager, **ip_addr)
            for ip_addr in ip_addresses
        ]