관리-도구
편집 파일: evr_utils.cpython-311.pyc
� P�CgN � �� � d dl mZmZmZmZmZ dgZdee deee fd�Zdeeeef defd�Z deee ee ef defd �Z d ee dee fd�ZdS ) � )�Union�List�AnyStr�Tuple�Optional� serialize_evr�intgr�returnc �� � g }| }|dk r.t |d� � \ }}|� |� � |dk �.|� dt |� � z � � |� � � |S )z� Encode int in real-numbers segment. See http://en.wikipedia.org/wiki/Arithmetic_coding. @param intgr: int for coding in Float an segment [seg_begin, seg_end] @return: list encoding segment r � � )�divmod�append�len�reverse)r �lst�number� remainders ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.17-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/evr_utils.py�"encode_int_to_real_numbers_segmentr sx � � �C� �F� �1�*�*�"�6�3�/�/��� �� � �9���� �1�*�*� �J�J�s�S��X�X�~�����K�K�M�M�M��J� �rpm_datac �( � g }| D ]�}t |t � � r#|� t |� � � � n�t |t � � rD|� � � r0|� t t |� � � � � � nGt |t � � r |� d� |D � � � � nt d|� �� � �|� d� � ��d� d� |D � � � � S )z� Encode List of parts of Version or Epoch or Release in real-numbers segment. See http://en.wikipedia.org/wiki/Arithmetic_coding. @param rpm_data: list to convert in double @return: Converted string c 3 �4 K � | ]}t |� � V � �d S )N)�ord)�.0�chs r � <genexpr>zevr_to_float.<locals>.<genexpr>6 s( � � � �.�.�2�s�2�w�w�.�.�.�.�.�.r z ThisStrange: r � c � � g | ]}|d ���S )�02x� )r �ns r � <listcomp>z evr_to_float.<locals>.<listcomp>: s � �,�,�,�1�q�J�J�,�,�,r ) � isinstance�int�extendr �str�isdigit� NameErrorr �join)r �evr�elems r �evr_to_floatr. '