code: def _validate_user_code_output(transformer_fn):
      transformer = transformer_fn()
      if transformer is not None and not (
          hasattr(transformer, "fit") and callable(transformer.fit)
      ):
          raise MlflowException(
              message="The transformer provided doesn't have a fit method."
          ) from None
  
      if transformer is not None and not (
          hasattr(transformer, "transform")
          and callable(transformer.transform)
      ):
          raise MlflowException(
              message="The transformer provided doesn't have a transform method."
          ) from None
  
      return transformer
  
imports: import importlib
  import logging
  import os
  import sys
  import time
  import cloudpickle
  from packaging.version import Version
  from mlflow.exceptions import INVALID_PARAMETER_VALUE, MlflowException
  from mlflow.recipes.artifacts import DataframeArtifact, TransformerArtifact
  from mlflow.recipes.cards import BaseCard
  from mlflow.recipes.step import BaseStep, StepClass
  from mlflow.recipes.utils.execution import get_step_output_path
  from mlflow.recipes.utils.step import get_pandas_data_profiles, validate_classification_config
  from mlflow.recipes.utils.tracking import TrackingConfig, get_recipe_tracking_config
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_user_code_output(transformer_fn) and returns: transformer