o
    pi                  	   @   sV   d dl mZmZmZmZ d dlmZ deeee f dedeeee f fddZdS )	    )AnyCallableTupleUnion)Specificationsspecificationsfuncreturnc                    s:   t | tr |d| iS t fddt| g|R  D S )aT  Compute the function using arguments from each of the iterables

    Returns a tuple if provided `specifications` is a tuple,
    otherwise returns the function return value.

    Parameters
    ----------
    specifications : (tuple of) Specifications
        Specifications or tuple of specifications
    func : callable
        Function called for each specification with
        `func(*iterables[i], specifications=specifications[i])`
    *iterables :
        List of iterables with same length as `specifications`.

    Returns
    -------
    output : (tuple of) `func` return value(s)
    r   c                 3   s"    | ]^}} |d |iV  qdS )r   N ).0sir   r
   S/home/ubuntu/.local/lib/python3.10/site-packages/pyannote/audio/utils/multi_task.py	<genexpr>9   s    
z*map_with_specifications.<locals>.<genexpr>)
isinstancer   tuplezip)r   r   	iterablesr
   r   r   map_with_specifications   s
   
r   N)typingr   r   r   r   pyannote.audio.core.modelr   r   r
   r
   r
   r   <module>   s   