HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/parallel.cpython-39.pyc
a

?�fL
�@s$dZddgZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZer�dd
lmZmZmZmZmZddlmZeejejfZed�Zed
�ZzddlZWney�dZYn0dZdZedd��Zddd�Zddd�Z ddd�Z!e�se�reZ"Z#ne Z"e!Z#dS)abConvenient 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)�DEFAULT_POOLSIZE)�PY2��map)�MYPY_CHECK_RUNNING)�Callable�Iterable�Iterator�Union�TypeVar��pool�S�TNTFi��ccsBz"|VW|��|��|��n|��|��|��0dS)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�closing4s
�r�cCs
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.
    r)�func�iterable�	chunksizerrr�
_map_fallbackBsrcCs<tt���}|�|||�Wd�S1s.0YdS)z�Chop iterable into chunks and submit them to a process pool.

    For very long iterables using a large value for chunksize can make
    the job complete much faster than using the default value of 1.

    Return an unordered iterator of the results.
    N)r�ProcessPool�imap_unordered�rrrrrrr�_map_multiprocessMs	r!cCs>ttt���}|�|||�Wd�S1s00YdS)z�Chop iterable into chunks and submit them to a thread pool.

    For very long iterables using a large value for chunksize can make
    the job complete much faster than using the default value of 1.

    Return an unordered iterator of the results.
    N)r�
ThreadPoolrrr rrr�_map_multithreadZs	r#)r)r)r)$�__doc__�__all__�
contextlibrZmultiprocessingrrZmultiprocessing.dummyr"Zpip._vendor.requests.adaptersrZpip._vendor.sixrZpip._vendor.six.movesr	Zpip._internal.utils.typingr
�typingrrr
rrrrrZmultiprocessing.synchronize�ImportErrorZ
LACK_SEM_OPENZTIMEOUTrrr!r#rrrrrr�<module>s: