class_docstr: Interact with Amazon SageMaker.
  
  Provide thick wrapper around
  :external+boto3:py:class:`boto3.client("sagemaker") <SageMaker.Client>`.
  
  Additional arguments (such as ``aws_conn_id``) may be specified and
  are passed down to the underlying AwsBaseHook.
  
  .. seealso::
      - :class:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
class_docstr_tok: ["Interact","with","Amazon","SageMaker",".","Provide","thick","wrapper","around",":","external+boto3",":","py",":","class",":","`","boto3.client","(","``","sagemaker","''",")","<","SageMaker.Client",">","`",".","Additional","arguments","(","such","as","``","aws_conn_id","``",")","may","be","specified","and","are","passed","down","to","the","underlying","AwsBaseHook",".","..","seealso",":",":","-",":","class",":","`","airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook","`"]
docstr: Get the number of processing jobs found with the provided name prefix.
  
  :param processing_job_name: The prefix to look for.
  :param job_name_suffix: The optional suffix which may be appended to deduplicate an existing job name.
  :param throttle_retry_delay: Seconds to wait if a ThrottlingException is hit.
  :param retries: The max number of times to retry.
  :returns: The number of processing jobs that start with the provided prefix.
code: def count_processing_jobs_by_name(
      self,
      processing_job_name: str,
      job_name_suffix: str | None = None,
      throttle_retry_delay: int = 2,
      retries: int = 3,
  ) -> int:
      """Get the number of processing jobs found with the provided name prefix.
  
      :param processing_job_name: The prefix to look for.
      :param job_name_suffix: The optional suffix which may be appended to deduplicate an existing job name.
      :param throttle_retry_delay: Seconds to wait if a ThrottlingException is hit.
      :param retries: The max number of times to retry.
      :returns: The number of processing jobs that start with the provided prefix.
      """
      try:
          jobs = self.get_conn().list_processing_jobs(
              NameContains=processing_job_name
          )
          # We want to make sure the job name starts with the provided name, not just contains it.
          matching_jobs = [
              job["ProcessingJobName"]
              for job in jobs["ProcessingJobSummaries"]
              if self._name_matches_pattern(
                  processing_job_name,
                  job["ProcessingJobName"],
                  job_name_suffix,
              )
          ]
          return len(matching_jobs)
      except ClientError as e:
          if e.response["Error"]["Code"] == "ResourceNotFound":
              # No jobs found with that name.  This is good, return 0.
              return 0
          if (
              e.response["Error"]["Code"] == "ThrottlingException"
              and retries
          ):
              # If we hit a ThrottlingException, back off a little and try again.
              time.sleep(throttle_retry_delay)
              return self.count_processing_jobs_by_name(
                  processing_job_name,
                  job_name_suffix,
                  throttle_retry_delay * 2,
                  retries - 1,
              )
          raise
  
imports: from __future__ import annotations
  import os
  import re
  import tarfile
  import tempfile
  import time
  import warnings
  from collections import Counter, namedtuple
  from datetime import datetime
  from functools import partial
  from typing import Any, Callable, Generator, cast
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
  from airflow.providers.amazon.aws.utils.tags import format_tags
  from airflow.utils import timezone
label_desc: Use image node_id 32 for calling the SageMakerHook obj's underlying member method code with example usage: obj.count_processing_jobs_by_name(processing_job_name, job_name_suffix, throttle_retry_delay, retries) and returns: len, int, self