Rec@sdZddgZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZerdd lmZmZmZmZmZdd lmZeejejfZed Zed ZnyddlZWnek reZnXeZdZedZ ddZ!ddZ"ddZ#esfe rse!Z$Z%n e"Z$e#Z%dS(sbConvenient 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. tmap_multiprocesstmap_multithreadi(tcontextmanager(tPool(tDEFAULT_POOLSIZE(tPY2(tmap(tMYPY_CHECK_RUNNING(tCallabletIterabletIteratortUniontTypeVar(tpooltStTNiccs/z |VWd|j|j|jXdS(s>Return a context manager making sure the pool closes properly.N(tclosetjoint terminate(R ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/parallel.pytclosing4s    icCs t||S(sMake 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(tfunctiterablet chunksize((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/parallel.pyt _map_fallbackBscCs/tt}|j|||SWdQXdS(sChop 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(Rt ProcessPooltimap_unordered(RRRR ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/parallel.pyt_map_multiprocessMs cCs2ttt}|j|||SWdQXdS(sChop 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(Rt ThreadPoolRR(RRRR ((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/parallel.pyt_map_multithreadZs (&t__doc__t__all__t contextlibRtmultiprocessingRRtmultiprocessing.dummyRtpip._vendor.requests.adaptersRtpip._vendor.sixRtpip._vendor.six.movesRtpip._internal.utils.typingRttypingRR R R R R RRtmultiprocessing.synchronizet ImportErrortTruet LACK_SEM_OPENtFalsetTIMEOUTRRRRRR(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/parallel.pyts8 (