def _early_stop_check(callbacks):
    if (LooseVersion(keras.__version__) < LooseVersion('2.3.0')):
        es_callback = keras.callbacks.EarlyStopping
    else:
        es_callback = keras.callbacks.callbacks.EarlyStopping
    for callback in callbacks:
        if isinstance(callback, es_callback):
            return callback
    return None
def _early_stop_check(callbacks):
    if (LooseVersion(keras.__version__) < LooseVersion('2.3.0')):
        es_callback = keras.callbacks.EarlyStopping
    else:
        es_callback = keras.callbacks.callbacks.EarlyStopping
    for callback in callbacks:
        if isinstance(callback, es_callback):
            return callback
    return None