code: def _build_profiles_and_card(self, scored_sdf) -> BaseCard:
      # Build profiles for scored dataset
      card = BaseCard(self.recipe_name, self.name)
  
      scored_size = scored_sdf.count()
  
      if not self.skip_data_profiling:
          _logger.info("Profiling scored dataset")
          if scored_size > _MAX_PROFILE_SIZE:
              _logger.info(
                  "Sampling scored dataset for profiling because dataset size is large."
              )
              sample_percentage = _MAX_PROFILE_SIZE / scored_size
              scored_sdf = scored_sdf.sample(sample_percentage)
          scored_df = scored_sdf.toPandas()
          scored_dataset_profile = get_pandas_data_profiles(
              [["Profile of Scored Dataset", scored_df]]
          )
  
          # Optional tab : data profile for scored data:
          card.add_tab(
              "Scored Data Profile", "{{PROFILE}}"
          ).add_pandas_profile("PROFILE", scored_dataset_profile)
  
      # Tab #1/2: run summary.
      (
          card.add_tab(
              "Run Summary",
              """
                  {{ SCORED_DATA_NUM_ROWS }}
                  {{ EXE_DURATION }}
                  {{ LAST_UPDATE_TIME }}
                  """,
          ).add_markdown(
              "SCORED_DATA_NUM_ROWS",
              f"**Number of scored dataset rows:** `{scored_size}`",
          )
      )
  
      return card
  
imports: import logging
  import os
  import time
  from typing import Any, Dict
  import mlflow
  from mlflow.exceptions import BAD_REQUEST, INVALID_PARAMETER_VALUE, MlflowException
  from mlflow.recipes.artifacts import DataframeArtifact, RegisteredModelVersionInfo
  from mlflow.recipes.cards import BaseCard
  from mlflow.recipes.step import BaseStep, StepClass
  from mlflow.recipes.steps.register import _REGISTERED_MV_INFO_FILE
  from mlflow.recipes.utils.execution import get_step_output_path
  from mlflow.recipes.utils.step import get_pandas_data_profiles
  from mlflow.recipes.utils.tracking import TrackingConfig, apply_recipe_tracking_config, get_recipe_tracking_config
  from mlflow.utils._spark_utils import _create_local_spark_session_for_recipes, _get_active_spark_session
  from mlflow.utils.databricks_utils import get_databricks_env_vars
  from mlflow.utils.file_utils import write_spark_dataframe_to_parquet_on_local_disk
label_desc: Use image node_id 3 for calling the PredictStep obj's underlying member method code with example usage: obj._build_profiles_and_card(scored_sdf) and returns: card