| Server IP : 185.143.234.130 / Your IP : 185.215.232.195 Web Server : LiteSpeed System : Linux jambul.7ho.st 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : renecafe ( 1327) PHP Version : 8.1.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.9/site-packages/pip/_internal/utils/__pycache__/ |
Upload File : |
a
[��f| � @ s\ d Z ddgZddlmZ ddlmZ ddlmZ ddlmZ ddl
mZmZm
Z
mZmZ ddlmZ eejej f Zed �Zed
�ZzddlZW n ey� dZY n0 d
ZdZeee
e d�dd��Zdeegef ee ee
e d�dd�Zdeegef ee ee
e d�dd�Zdeegef ee ee
e d�dd�Ze�rPe ZZneZeZdS )ab Convenient parallelization of higher order functions.
This module provides two helper functions, with appropriate fallbacks on
Python 2 and on systems lacking support for synchronization mechanisms:
- map_multiprocess
- map_multithread
These helpers work like Python 3's map, with two differences:
- They don't guarantee the order of processing of
the elements of the iterable.
- The underlying process/thread pools chop the iterable into
a number of chunks, so that for very long iterables using
a large value for chunksize can make the job complete much faster
than using the default value of 1.
�map_multiprocess�map_multithread� )�contextmanager)�Pool��pool)�Callable�Iterable�Iterator�TypeVar�Union)�DEFAULT_POOLSIZE�S�TNTFi�� )r �returnc c sB z"| V W | � � | �� | �� n| � � | �� | �� 0 dS )z>Return a context manager making sure the pool closes properly.N)�close�joinZ terminater � r �@/usr/lib/python3.9/site-packages/pip/_internal/utils/parallel.py�closing. s
�r � )�func�iterable� chunksizer c C s
t | |�S )z�Make an iterator applying func to each element in iterable.
This function is the sequential fallback either on Python 2
where Pool.imap* doesn't react to KeyboardInterrupt
or when sem_open is unavailable.
)�map)r r r r r r �
_map_fallback; s r c C s<