从stock_ip_list删除列表exclude_ip_list中的ip
    从stock_ip_list删除列表future_ip_list中的ip

    :param exclude_ip_list:  需要删除的ip_list
    :return: None
481582
def exclude_from_stock_ip_list(exclude_ip_list):
    
    for exc in exclude_ip_list:
        if exc in stock_ip_list:
            stock_ip_list.remove(exc)

    # 扩展市场
    for exc in exclude_ip_list:
        if exc in future_ip_list:
            future_ip_list.remove(exc)
272595
def QA_fetch_get_macroindex_list(ip=None, port=None):
    
    global extension_market_list
    extension_market_list = QA_fetch_get_extensionmarket_list(
    ) if extension_market_list is None else extension_market_list

    return extension_market_list.query('market==38')
1103584
def ip_address_list(ips):
    
    # first, try it as a single IP address
    try:
        return ip_address(ips)
    except ValueError:
        pass
    # then, consider it as an ipaddress.IPv[4|6]Network instance and expand it
    return list(ipaddress.ip_network(u(ips)).hosts())
911989
def GetForwardedIps(self, interface, interface_ip=None):
    
    try:
      ips = netifaces.ifaddresses(interface)
      ips = ips[netifaces.AF_INET]
    except (ValueError, IndexError):
      return []
    forwarded_ips = []
    for ip in ips:
      if ip['addr'] != interface_ip:
        full_addr = '%s/%d' % (ip['addr'], netaddr.IPAddress(ip['netmask']).netmask_bits())
        forwarded_ips.append(full_addr)
    return self.ParseForwardedIps(forwarded_ips)
5846
def strip_ip_port(ip_address):
    

    # IPv4 with or without port
    if '.' in ip_address:
        cleaned_ip = ip_address.split(':')[0]

    # IPv6 with port
    elif ']:' in ip_address:
        # Remove the port following last ':', and then strip first and last chars for [].
        cleaned_ip = ip_address.rpartition(':')[0][1:-1]

    # IPv6 without port
    else:
        cleaned_ip = ip_address

    return cleaned_ip
1088561
def public_ip_addresses_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        pub_ips = __utils__['azurearm.paged_object_to_list'](netconn.public_ip_addresses.list_all())

        for ip in pub_ips:
            result[ip['name']] = ip
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
637312
def internal_only(view_func):
    

    @functools.wraps(view_func)
    def wrapper(request, *args, **kwargs):
        forwards = request.META.get("HTTP_X_FORWARDED_FOR", "").split(",")
        # The nginx in the docker container adds the loadbalancer IP to the list inside
        # X-Forwarded-For, so if the list contains more than a single item, we know
        # that it went through our loadbalancer
        if len(forwards) > 1:
            raise PermissionDenied()
        return view_func(request, *args, **kwargs)

    return wrapper
540039
def ip_info(self, ip, repository_ids=None):
        
        if not repository_ids:
            repository_ids = []
        repos = []
        for rid in repository_ids:
            repos.append({'id': rid})
        return self.raw_query('vuln', 'getIP', data={
            'ip': ip, 'repositories': repos})
1096970
def system_address
      ::Socket.ip_address_list.find { |address|
        address.ipv4? && !address.ipv4_loopback?
      }.ip_address rescue nil
    end
813050
def sort(iterable):
    
    ips = sorted(normalize_ip(ip) for ip in iterable)
    return [clean_ip(ip) for ip in ips]
262858
def _process_reservations(self, reservations):
        

        reservations = reservations['Reservations']

        private_ip_addresses = []
        private_hostnames = []
        public_ips = []
        public_hostnames = []
        for reservation in reservations:
            for instance in reservation['Instances']:
                private_ip_addresses.append(instance['PrivateIpAddress'])
                private_hostnames.append(instance['PrivateDnsName'])

                if 'PublicIpAddress' in instance:
                    public_ips.append(instance['PublicIpAddress'])
                elif not self.remove_nones:
                    public_ips.append(None)

                if ('PublicDnsName' in instance) & (not self.remove_nones):
                    public_hostnames.append(instance['PublicDnsName'])
                elif not self.remove_nones:
                    public_hostnames.append(None)

        return {
            'private': {
                'ips': private_ip_addresses,
                'hostnames': private_hostnames
            },
            'public': {
                'ips': public_ips,
                'hostnames': public_hostnames
            },
            'reservations': reservations
        }
1303433
def floating_ip_pool_list(self):
        '''
        
        '''
        nt_ks = self.compute_conn
        pools = nt_ks.floating_ip_pools.list()
        response = {}
        for pool in pools:
            response[pool.name] = {
                'name': pool.name,
            }
        return response
1174600
def list_unspent(oa_address_list = [])
      btc_address_list = oa_address_list.map { |oa_address| oa_address_to_address(oa_address)}
      outputs = get_unspent_outputs(btc_address_list)
      result = outputs.map{|out| out.to_hash}
      result
    end
1097790
def floating_ip_associate(self, server_name, floating_ip):
        '''
        
        '''
        nt_ks = self.compute_conn
        server_ = self.server_by_name(server_name)
        server = nt_ks.servers.get(server_.__dict__['id'])
        server.add_floating_ip(floating_ip)
        return self.floating_ip_list()[floating_ip]
942199
def exclude(*list, &block)
      @@exclusion << list.map { |s| "@#{s}".to_sym }
      @@exclusion.flatten!
      @@exclusion_block = block if block_given?
    end
1245
def get_today_all(output='pd'):
    

    data = []
    today = str(datetime.date.today())
    codes = QA_fetch_get_stock_list('stock').code.tolist()
    bestip = select_best_ip()['stock']
    for code in codes:
        try:
            l = QA_fetch_get_stock_day(
                code, today, today, '00', ip=bestip)
        except:
            bestip = select_best_ip()['stock']
            l = QA_fetch_get_stock_day(
                code, today, today, '00', ip=bestip)
        if l is not None:
            data.append(l)

    res = pd.concat(data)
    if output in ['pd']:
        return res
    elif output in ['QAD']:
        return QA_DataStruct_Stock_day(res.set_index(['date', 'code'], drop=False))
921660
def ip_in_ip_mask(ip, mask_ip, mask):
    '''
    
    '''
    ip = ip2hex(ip)
    if ip is None: raise Exception("bad ip format")
    if (mask_ip & mask) == (ip & mask):
        return True
    return False