/
var
/
opt
/
nydus
/
ops
/
customer_local_ops
/
util
/
__pycache__
/
up file
home
� =�jY � �P � d dl mZ d dlZd dlZd dlZdedefd�Zd� Zd dedefd�Z y) � )� b64encodeN�s�returnc �P � t | j � � j � S )z?Return `s` base64-encoded. :param s: string to encode )r �encode�decode)r s �Q/opt/nydus/tmp/pip-target-hb7welcc/lib/python/customer_local_ops/util/__init__.py�b64strr s � � �Q�X�X�Z� �'�'�)�)� c �B � t |t � r-t t t j t | � |� � S t |t t f� }|s! t |t t t t f� }|rtt |d� r;t t t j t | � |j � � � S t t t j t | � |� � S t |d� r|j | � S | |� S # t $ r Y ��w xY w)z!Homomorphic mapping of a function�items�fmap)� isinstance�tuple�map� functools�partialr �list�dict�filter�zip�range� TypeError�hasattrr )�func�obj� iterableitemss r r r s� � � �#�u���S��*�*�4��6��<�=�=��s�T�4�L�1�M�� �&�s�V�S�#�u�,E�F�M� ��3�� ���I�-�-�d�D�9�3�9�9�;�G�H�H��C� �)�)�$��5�s�;�<�<��s�F���x�x��~����9��� � � � �s � D � D�D�lengthc �v � | st j dd� } t j j dd� j dd� j dd� }dj t | � D �cg c]9 }t j t j t j z |z � ��; c}� S c c}w )z}Create a random password. :param length: An int specifying password length :returns: the password, in cleartext � � �"� �'�\) �random�randint�string�punctuation�replace�joinr �choice�digits� ascii_letters)r �edited_punctuation�Xs r �random_passwordr1 '