Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/netaddr/contrib/__pycache__/subnet_splitter.cpython-39.pyc
Ðазад
a ^�h� � @ s( d dl mZmZmZ G dd� de�ZdS )� )� IPNetwork�cidr_exclude� cidr_mergec @ s2 e Zd ZdZdd� Zddd�Zdd� Zd d � ZdS )�SubnetSplitterz� A handy utility class that takes a single (large) subnet and allows smaller subnet within its range to be extracted by CIDR prefix. Any leaving address space is available for subsequent extractions until all space is exhausted. c C s t t|�g�| _dS )z� Constructor. :param base_cidr: an IPv4 or IPv6 address with a CIDR prefix. (see IPNetwork.__init__ for full details). N)�setr �_subnets)�selfZ base_cidr� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/netaddr/contrib/subnet_splitter.py�__init__ s zSubnetSplitter.__init__Nc C sZ | � � D ]L}t|j||d��}|s$q| �|� | j�tt|t|�d ���| _| S g S )z;Extract 1 or more subnets of size specified by CIDR prefix.)�countr ) �available_subnets�listZsubnet� remove_subnetr �unionr r r )r �prefixr Zcidr�subnetsr r r �extract_subnet s ��zSubnetSplitter.extract_subnetc C s t | jdd� dd�S )z2Returns a list of the currently available subnets.c S s | j S )N)� prefixlen)�xr r r �<lambda>* � z2SubnetSplitter.available_subnets.<locals>.<lambda>T)�key�reverse)�sortedr )r r r r r ( s z SubnetSplitter.available_subnetsc C s | j �|� dS )z:Remove a specified IPNetwork from available address space.N)r �remove)r � ip_networkr r r r , s zSubnetSplitter.remove_subnet)N)�__name__� __module__�__qualname__�__doc__r r r r r r r r r s r N)Z netaddr.ipr r r �objectr r r r r �<module> s
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка