(pipeline)
Returns the final estimator in a Pipeline, or the estimator
    if it is not
Returns the final estimator in a Pipeline, or the estimator
    if it is not
Returns the final estimator in a Pipeline or the estimator if it is not
def _return_estimator_from_pipeline(pipeline):
    """Returns the final estimator in a Pipeline, or the estimator
    if it is not"""
    if isinstance(pipeline, Pipeline):
        return pipeline._final_estimator
    else:
        return pipeline
def _return_estimator_from_pipeline ( pipeline ) : if isinstance ( pipeline , Pipeline ) : return pipeline . _final_estimator else : return pipeline