Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/past/builtins/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/past/builtins/__pycache__/noniterators.cpython-311.pyc

�

�܋f�$����dZddlmZmZmZddlmZmZddlZddlm	Z	ddl
mZd�Zer$ddl
Z
d�Zd	�Zd
�Zd�ZeZeZeZddlmZeZgd
�ZdSddlZejZejZejZejZejZgZdS)a,
This module is designed to be used as follows::

    from past.builtins.noniterators import filter, map, range, reduce, zip

And then, for example::

    assert isinstance(range(5), list)

The list-producing functions this brings in are::

- ``filter``
- ``map``
- ``range``
- ``reduce``
- ``zip``

�)�division�absolute_import�print_function)�chain�starmapN)�
basestring)�PY3c�F�tjt||����S�N)r�
from_iterable�map)�f�itemss  �Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/past/builtins/noniterators.py�flatmaprs����s�1�e�}�}�-�-�-�c�\�t|d��}t|dt��r)|���t	j|���St|dttf��r|t	j|���Stt	j|���S)a*
        filter(function or None, sequence) -> list, tuple, or string

        Return those items of sequence for which function(item) is true.
        If function is None, return the items that are true.  If sequence
        is a tuple or string, return the same type, else return a list.
        �)�type�
isinstancer�join�builtins�filter�tuple�list)�args�mytypes  r�	oldfilterr$s����d�1�g�����d�1�g�z�*�*�	0��6�8�8�=�=���$�!7�8�8�8�
��Q��%���
/�
/�	0��6�(�/�4�0�1�1�1�����.�/�/�/rc�\�tj|�}t|��}t|��dkrgS|�|}ntt	||����}	td�|D����dkr!tt
j|����Sn#t$r
}Yd}~nd}~wwxYw|S)a
        map(function, sequence[, sequence, ...]) -> list

        Return a list of the results of applying the function to the
        items of the argument sequence(s).  If more than one sequence is
        given, the function is called with an argument list consisting of
        the corresponding item of each sequence, substituting None for
        missing values when not all sequences have the same length.  If
        the function is None, return a list of the items of the sequence
        (or a list of tuples if more than one sequence).

        Test cases:
        >>> oldmap(None, 'hello world')
        ['h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd']

        >>> oldmap(None, range(4))
        [0, 1, 2, 3]

        More test cases are in test_past.test_builtins.
        rNc�,�g|]}t|����S�)�len)�.0�items  r�
<listcomp>zoldmap.<locals>.<listcomp>Xs��1�1�1�$�C��I�I�1�1�1rr)	�	itertools�zip_longestrr"r�maxrr�	TypeError)�func�	iterables�zipped�l�result�es      r�oldmapr08s���*�&�	�2����L�L���q�6�6�Q�;�;��I��<��F�F��'�$��*�*�+�+�F�	��1�1�&�1�1�1�2�2�a�7�7��E�/��7�7�8�8�8�8���	�	�	��D�D�D�D�����	�����
s�=B�
B)�$B)c�>�ttj|i|����Sr)rr�range�r�kwargss  r�oldranger5�s���H�N�D�3�F�3�3�4�4�4rc�>�ttj|i|����Sr)rr�zipr3s  r�oldzipr8�s���H�L�$�1�&�1�1�2�2�2r)�reduce)rr
r2r9r7)�__doc__�
__future__rrrr&rr�
past.typesr�
past.utilsr	rrrr0r5r8rr
r2�	functoolsr9r7�__all__�__builtin__r!rr�<module>rAsL����&A�@�@�@�@�@�@�@�@�@�$�$�$�$�$�$�$�$�����!�!�!�!�!�!�������.�.�.��p��O�O�O�0�0�0�(&�&�&�F5�5�5�3�3�3��F�
�C��E� � � � � � �
�C�9�9�9�G�G�G�����
�
�F�
�/�C���E�
�
�F�
�/�C��G�G�Gr

Hacked By AnonymousFox1.0, Coded By AnonymousFox