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: Process a list request to produce results.
  
  All AWS boto3 ``list_*`` requests return results in batches, and if the
  key "NextToken" is contained in the result, there are more results to
  fetch. The default AWS batch size is 10, and configurable up to 100.
  This function iteratively loads all results (or up to a given maximum).
  
  Each boto3 ``list_*`` function returns the results in a list with a
  different name. The key of this structure must be given to iterate over
  the results, e.g. "TransformJobSummaries" for ``list_transform_jobs()``.
  
  :param partial_func: boto3 function with arguments
  :param result_key: the result key to iterate over
  :param max_results: maximum number of results to return (None = infinite)
  :return: Results of the list_* request
code: def _list_request(
      self,
      partial_func: Callable,
      result_key: str,
      max_results: int | None = None,
  ) -> list[dict]:
      """Process a list request to produce results.
  
      All AWS boto3 ``list_*`` requests return results in batches, and if the
      key "NextToken" is contained in the result, there are more results to
      fetch. The default AWS batch size is 10, and configurable up to 100.
      This function iteratively loads all results (or up to a given maximum).
  
      Each boto3 ``list_*`` function returns the results in a list with a
      different name. The key of this structure must be given to iterate over
      the results, e.g. "TransformJobSummaries" for ``list_transform_jobs()``.
  
      :param partial_func: boto3 function with arguments
      :param result_key: the result key to iterate over
      :param max_results: maximum number of results to return (None = infinite)
      :return: Results of the list_* request
      """
      sagemaker_max_results = 100  # Fixed number set by AWS
  
      results: list[dict] = []
      next_token = None
  
      while True:
          kwargs = {}
          if next_token is not None:
              kwargs["NextToken"] = next_token
  
          if max_results is None:
              kwargs["MaxResults"] = sagemaker_max_results
          else:
              kwargs["MaxResults"] = min(
                  max_results - len(results), sagemaker_max_results
              )
  
          response = partial_func(**kwargs)
          self.log.debug(
              "Fetched %s results.", len(response[result_key])
          )
          results.extend(response[result_key])
  
          if "NextToken" not in response or (
              max_results is not None and len(results) == max_results
          ):
              # Return when there are no results left (no NextToken) or when we've reached max_results.
              return results
          else:
              next_token = response["NextToken"]
  
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 30 for calling the SageMakerHook obj's underlying member method code with example usage: obj._list_request(partial_func, result_key, max_results) and returns: results