def acoustic_similarity_mapping(path_mapping, analysis_function, distance_function, stop_check=None, call_back=None, multiprocessing=True):
    """Takes in an explicit mapping of full paths to .wav files to have
    acoustic similarity computed.

    Parameters
    ----------
    path_mapping : iterable of iterables
        Explicit mapping of full paths of .wav files, in the form of a
        list of tuples to be compared.


    Returns
    -------
    dict
        Returns a list of tuples corresponding to the `path_mapping` input,
        with a new final element in the tuple being the similarity/distance
        score for that mapping.

    """

    num_cores = int((3 * cpu_count()) / 4)
    segments = set()
    for x in path_mapping:
        segments.update(x)
    if multiprocessing:
        cache = generate_cache_mp(segments, analysis_function, num_cores, call_back, stop_check)
        asim = calculate_distances_mp(path_mapping, cache, distance_function, num_cores, call_back, stop_check)
    else:
        cache = generate_cache_th(segments, analysis_function, num_cores, call_back, stop_check)
        asim = calculate_distances_th(path_mapping, cache, distance_function, num_cores, call_back, stop_check)
    return asim
def acoustic_similarity_mapping ( path_mapping , analysis_function , distance_function , stop_check = None , call_back = None , multiprocessing = True ) : num_cores = int ( ( 3 * cpu_count ( ) ) / 4 ) segments = set ( ) for x in path_mapping : segments . update ( x ) if multiprocessing : cache = generate_cache_mp ( segments , analysis_function , num_cores , call_back , stop_check ) asim = calculate_distances_mp ( path_mapping , cache , distance_function , num_cores , call_back , stop_check ) else : cache = generate_cache_th ( segments , analysis_function , num_cores , call_back , stop_check ) asim = calculate_distances_th ( path_mapping , cache , distance_function , num_cores , call_back , stop_check ) return asim
Takes in an explicit mapping of full paths to .wav files to have
    acoustic similarity computed.

    Parameters
    ----------
    path_mapping : iterable of iterables
        Explicit mapping of full paths of .wav files, in the form of a
        list of tuples to be compared.


    Returns
    -------
    dict
        Returns a list of tuples corresponding to the `path_mapping` input,
        with a new final element in the tuple being the similarity/distance
        score for that mapping.