<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    Re|                     @   s\  d Z ddgZddlmZ ddlmZ ddlmZ ddlmZ	 ddl
mZmZmZmZmZ ddlmZ eejej	f Zed	Zed
ZzddlZW n ey   dZY n0 dZdZeeee dddZdeegef ee eee dddZdeegef ee eee dddZdeegef ee eee dddZerPe ZZneZeZdS )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 dS )z>Return a context manager making sure the pool closes properly.N)closejoin	terminater    r   /builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/parallel.pyclosing.   s    
r      )funciterable	chunksizer   c                 C   s
   t | |S )zMake 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<   t t }|| ||W  d   S 1 s.0    Y  dS )zChop 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r   r   r   r   r   r   r   _map_multiprocessG   s    
r    c                 C   s>   t tt}|| ||W  d   S 1 s00    Y  dS )zChop 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   
ThreadPoolr   r   r   r   r   r   _map_multithreadU   s    
r"   )r   )r   )r   )__doc____all__
contextlibr   multiprocessingr   r   r   Zmultiprocessing.dummyr!   typingr   r	   r
   r   r   Zpip._vendor.requests.adaptersr   r   r   Zmultiprocessing.synchronizeImportErrorZLACK_SEM_OPENTIMEOUTr   intr   r    r"   r   r   r   r   r   r   <module>   sJ   
   
