code: def _validate_input_for_to_pipeline_api(
      pipeline_name: str, step: Callable
  ) -> None:
      """Validate input to to_pipeline API.
  
      The provided callable is considered valid if it's wrapped by feature_processor decorator
      and uses pyspark mode.
  
      Args:
          pipeline_name (str): The name of the pipeline.
          step (Callable): A user provided function wrapped by feature_processor and optionally
              wrapped by remote_decorator.
  
      Raises (ValueError): raises ValueError when any of the following scenario happen:
             1. pipeline name is longer than 80 characters.
             2. function is not annotated with either feature_processor or remote decorator.
             3. provides a mode other than pyspark.
      """
      if len(pipeline_name) > PIPELINE_NAME_MAXIMUM_LENGTH:
          raise ValueError(
              "Pipeline name used by feature processor should be less than 80 "
              "characters. Please choose another pipeline name."
          )
  
      if (
          not hasattr(step, "feature_processor_config")
          or not step.feature_processor_config
      ):
          raise ValueError(
              "Please wrap step parameter with feature_processor decorator"
              " in order to use to_pipeline API."
          )
  
      if not hasattr(step, "job_settings") or not step.job_settings:
          raise ValueError(
              "Please wrap step parameter with remote decorator in order to use to_pipeline API."
          )
  
      if (
          FeatureProcessorMode.PYSPARK
          != step.feature_processor_config.mode
      ):
          raise ValueError(
              f"Mode {step.feature_processor_config.mode} is not supported by to_pipeline API."
          )
  
imports: from __future__ import absolute_import
  import logging
  import json
  import re
  from datetime import datetime
  from typing import Callable, List, Optional, Dict, Sequence, Union, Any, Tuple
  import pytz
  from botocore.exceptions import ClientError
  from sagemaker.feature_store.feature_processor._config_uploader import ConfigUploader
  from sagemaker.feature_store.feature_processor._enums import FeatureProcessorMode
  from sagemaker.feature_store.feature_processor._event_bridge_rule_helper import EventBridgeRuleHelper
  from sagemaker.feature_store.feature_processor._feature_processor_pipeline_events import FeatureProcessorPipelineEvents
  from sagemaker.feature_store.feature_processor.lineage._feature_processor_lineage_name_helper import _get_feature_group_lineage_context_name, _get_feature_group_pipeline_lineage_context_name, _get_feature_group_pipeline_version_lineage_context_name, _get_feature_processor_pipeline_lineage_context_name, _get_feature_processor_pipeline_version_lineage_context_name
  from sagemaker.lineage import context
  from sagemaker.lineage._utils import get_resource_name_from_arn
  from sagemaker.remote_function.runtime_environment.runtime_environment_manager import RuntimeEnvironmentManager
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.vpc_utils import SUBNETS_KEY, SECURITY_GROUP_IDS_KEY
  from sagemaker.feature_store.feature_processor._constants import EXECUTION_TIME_PIPELINE_PARAMETER, EXECUTION_TIME_PIPELINE_PARAMETER_FORMAT, RESOURCE_NOT_FOUND_EXCEPTION, SPARK_JAR_FILES_PATH, SPARK_PY_FILES_PATH, SPARK_FILES_PATH, FEATURE_PROCESSOR_TAG_KEY, FEATURE_PROCESSOR_TAG_VALUE, PIPELINE_CONTEXT_TYPE, DEFAULT_SCHEDULE_STATE, SCHEDULED_TIME_PIPELINE_PARAMETER, PIPELINE_CONTEXT_NAME_TAG_KEY, PIPELINE_VERSION_CONTEXT_NAME_TAG_KEY, PIPELINE_NAME_MAXIMUM_LENGTH, RESOURCE_NOT_FOUND, FEATURE_GROUP_ARN_REGEX_PATTERN, TO_PIPELINE_RESERVED_TAG_KEYS, DEFAULT_TRIGGER_STATE, EVENTBRIDGE_RULE_ARN_REGEX_PATTERN
  from sagemaker.feature_store.feature_processor._feature_processor_config import FeatureProcessorConfig
  from sagemaker.s3 import s3_path_join
  from sagemaker import Session, get_execution_role
  from sagemaker.feature_store.feature_processor._event_bridge_scheduler_helper import EventBridgeSchedulerHelper
  from sagemaker.workflow.pipeline import Pipeline
  from sagemaker.workflow.retry import StepRetryPolicy, StepExceptionTypeEnum, SageMakerJobStepRetryPolicy, SageMakerJobExceptionTypeEnum
  from sagemaker.workflow.steps import TrainingStep
  from sagemaker.estimator import Estimator
  from sagemaker.feature_store.feature_processor.lineage._feature_processor_lineage import FeatureProcessorLineageHandler, TransformationCode
  from sagemaker.remote_function.job import _JobSettings, JOBS_CONTAINER_ENTRYPOINT, SPARK_APP_SCRIPT_PATH
  from sagemaker.feature_store.feature_processor._data_source import CSVDataSource, FeatureGroupDataSource, ParquetDataSource
label_desc: Use image node_id 11 for calling a global function with example usage: _validate_input_for_to_pipeline_api(pipeline_name, step) without return types