def METHOD_NAME(cluster_arr, threshold):
    """
    Apply threshold to cluster list.
    Parameters
    ----------
    cluster_arr : np.ndarray
        Array of clusters.
    threshold : int
        Threshold value on cluster population.
    Returns
    -------
    cluster_arr : np.ndarray
        Array of clusters (unclustered structures are labelled with -1)
    """
    new_cluster_arr = cluster_arr.copy()
    log.info(f"Applying threshold {threshold} to cluster list")
    cluster_pops = np.unique(cluster_arr, return_counts=True)
    uncl_idx = np.where(cluster_pops[1] < threshold)[0]
    invalid_clusters = cluster_pops[0][uncl_idx]
    log.info(f"Invalid clusters: {invalid_clusters}")
    # replacing invalid clusters with -1
    uncl_models = 0
    for cl_idx, cl_id in enumerate(new_cluster_arr):
        if cl_id in invalid_clusters:
            new_cluster_arr[cl_idx] = -1
            uncl_models += 1
    log.info(f"Threshold applied, {uncl_models} models left unclustered")
    return new_cluster_arr