def modcos_pair(X, len_spectra):
    'Single molnet pair calculation\n    '
    (spectra_i, spectra_j, i, j, mass_shift, tol, min_intens, method, counter) = X
    if (method == 'greedy'):
        (molnet_pair, used_matches) = cosine_score_greedy(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens, use_numba=False)
    elif (method == 'greedy-numba'):
        (molnet_pair, used_matches) = cosine_score_greedy(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens, use_numba=True)
    elif (method == 'hungarian'):
        (molnet_pair, used_matches) = cosine_score_hungarian(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens)
    else:
        print('Given method does not exist...')
    if ((((counter + 1) % 1000) == 0) or (counter == (len_spectra - 1))):
        print('\r', ' Calculated MolNet for pair {} -- {}'.format(i, j), '. ( ', np.round(((200 * (counter + 1)) / (len_spectra ** 2)), 2), ' % done).', end='')
    return (molnet_pair, len(used_matches))
Single molnet pair calculation
def modcos_pair(X, len_spectra):
    '\n    '
    (spectra_i, spectra_j, i, j, mass_shift, tol, min_intens, method, counter) = X
    if (method == 'greedy'):
        (molnet_pair, used_matches) = cosine_score_greedy(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens, use_numba=False)
    elif (method == 'greedy-numba'):
        (molnet_pair, used_matches) = cosine_score_greedy(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens, use_numba=True)
    elif (method == 'hungarian'):
        (molnet_pair, used_matches) = cosine_score_hungarian(spectra_i, spectra_j, mass_shift, tol, min_intens=min_intens)
    else:
        print('Given method does not exist...')
    if ((((counter + 1) % 1000) == 0) or (counter == (len_spectra - 1))):
        print('\r', ' Calculated MolNet for pair {} -- {}'.format(i, j), '. ( ', np.round(((200 * (counter + 1)) / (len_spectra ** 2)), 2), ' % done).', end=)
    return (molnet_pair, len(used_matches))