docstr: If model is a pipeline, return it, else append model to copy of prep_pipe.
docstr_tok: ["If","model","is","a","pipeline",",","return","it",",","else","append","model","to","copy","of","prep_pipe","."]
code: def _construct_pipeline_if_needed(
      self, model, prep_pipe: Pipeline
  ) -> Pipeline:
      """If model is a pipeline, return it, else append model to copy of prep_pipe."""
      if not isinstance(model, Pipeline):
          prep_pipe_temp = deepcopy(prep_pipe)
          prep_pipe_temp.steps.append(["trained_model", model])
      else:
          prep_pipe_temp = model
      return prep_pipe_temp
  
file_path: pycaret/pycaret/loggers/base_logger.py
imports: from abc import ABC
  from copy import deepcopy
  from sklearn.pipeline import Pipeline
label_desc: Use image node_id 7 for calling the BaseLogger obj's underlying member method code with example usage: obj._construct_pipeline_if_needed(model, prep_pipe) and returns: prep_pipe_temp