def _most_frequent(array, extra_value, n_repeat):
    # Compute the most frequent value in array only
    if array.size > 0:
        mode = stats.mode(array)
        most_frequent_value = mode[0][0]
        most_frequent_count = mode[1][0]
    else:
        most_frequent_value = 0
        most_frequent_count = 0

    # Compare to array + [extra_value] * n_repeat
    if most_frequent_count == 0 and n_repeat == 0:
        return np.nan
    elif most_frequent_count < n_repeat:
        return extra_value
    elif most_frequent_count > n_repeat:
        return most_frequent_value
    elif most_frequent_count == n_repeat:
        # Ties the breaks. Copy the behaviour of scipy.stats.mode
        if most_frequent_value < extra_value:
            return most_frequent_value
        else:
            return extra_value
Starts the specified redis instance.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/preprocessing/imputation.py/_most_frequent--crossover with--dataset/ETHPy150Open weblabdeusto/weblabdeusto/tools/wcloud/wcloud/tasks/starter_tasks.py/start_redis