class_docstr: Helper methods for Kubeflow Handler.
class_docstr_tok: ["Helper","methods","for","Kubeflow","Handler","."]
docstr: Creates/updates pipeline in the Kubeflow Pipelines cluster.
docstr_tok: ["Creates\/updates","pipeline","in","the","Kubeflow","Pipelines","cluster","."]
code: def _save_pipeline(
      self,
      pipeline_name: str,
      pipeline_package_path: str,
      update: bool = False,
  ) -> None:
      """Creates/updates pipeline in the Kubeflow Pipelines cluster."""
  
      pipeline_id = self._get_pipeline_id(pipeline_name, check=update)
      if pipeline_id is not None and not update:
          sys.exit(
              f'Pipeline "{pipeline_name}" already exists. id="{pipeline_id}")'
          )
  
      if update:
          # A timestamp will be appended for the uniqueness of `version_name`.
          version_name = "{}_{}".format(
              pipeline_name, time.strftime("%Y%m%d%H%M%S")
          )
          self._client.upload_pipeline_version(
              pipeline_package_path=pipeline_package_path,
              pipeline_version_name=version_name,
              pipeline_id=pipeline_id,
          )
      else:  # creating a new pipeline.
          upload_response = self._client.upload_pipeline(
              pipeline_package_path=pipeline_package_path,
              pipeline_name=pipeline_name,
          )
          pipeline_id = upload_response.id
  
          # Create experiment with pipeline name as experiment name.
          self._client.create_experiment(pipeline_name)
  
      # Display the link to the pipeline detail page in KFP UI.
      click.echo(
          "Please access the pipeline detail page at "
          "{prefix}/#/pipelines/details/{pipeline_id}".format(
              prefix=self._client._get_url_prefix(),  # pylint: disable=protected-access
              pipeline_id=pipeline_id,
          )
      )
  
imports: import functools
  import os
  import sys
  import time
  from typing import Any, Dict, Optional
  import click
  import kfp
  from tfx.orchestration.kubeflow import kubeflow_dag_runner
  from tfx.tools.cli import labels
  from tfx.tools.cli.container_builder import builder
  from tfx.tools.cli.handler import base_handler
  from tfx.tools.cli.handler import kubeflow_dag_runner_patcher
label_desc: Use image node_id 16 for calling the KubeflowHandler obj's underlying member method code with example usage: obj._save_pipeline(pipeline_name, pipeline_package_path, update) without return types