code: def list_futures(job_name_prefix, sagemaker_session=None):
      """Generates Future objects with information about jobs with given job_name_prefix.
  
      Args:
          job_name_prefix (str): A prefix used to identify the SageMaker jobs associated with remote
            function run.
          sagemaker_session (sagemaker.session.Session): A session object that manages interactions
            with Amazon SageMaker APIs and any other AWS services needed.
  
      Yields:
          A `sagemaker.remote_function.client.Future` instance.
      """
      if not sagemaker_session:
          sagemaker_session = Session()
      job_name = name_from_base(job_name_prefix)
      # perform the following transformation because we might have trimmed the job_name_prefix while
      # creating the job.
      transformed_job_name_prefix = base_from_name(job_name)
      next_token = None
      list_training_job_kwargs = {
          "NameContains": transformed_job_name_prefix
      }
      while True:
          if next_token:
              list_training_job_kwargs["NextToken"] = next_token
          list_training_job_response = (
              sagemaker_session.sagemaker_client.list_training_jobs(
                  **list_training_job_kwargs
              )
          )
          training_job_names = [
              job["TrainingJobName"]
              for job in list_training_job_response[
                  "TrainingJobSummaries"
              ]
          ]
          for training_job_name in training_job_names:
              describe_training_job_response = sagemaker_session.sagemaker_client.describe_training_job(
                  TrainingJobName=training_job_name
              )
              yield Future.from_describe_response(
                  describe_training_job_response, sagemaker_session
              )
          if "NextToken" in list_training_job_response:
              next_token = list_training_job_response["NextToken"]
          else:
              break
  
imports: from __future__ import absolute_import
  from concurrent.futures import ThreadPoolExecutor
  from collections import deque
  import time
  import threading
  from typing import Callable, Dict, List, Optional, Tuple, Any, Union
  import functools
  import itertools
  import inspect
  from botocore.exceptions import ClientError
  from sagemaker.exceptions import UnexpectedStatusException
  from sagemaker.experiments._run_context import _RunContext
  import sagemaker.remote_function.core.serialization
  from sagemaker.remote_function.errors import RemoteFunctionError, ServiceError, DeserializationError
  from sagemaker.remote_function.core.stored_function import RESULTS_FOLDER, EXCEPTION_FOLDER
  from sagemaker.remote_function.runtime_environment.runtime_environment_manager import RuntimeEnvironmentError
  from sagemaker.session import Session
  from sagemaker.s3 import s3_path_join
  from sagemaker.remote_function.job import _JobSettings, _Job, _RunInfo
  from sagemaker.remote_function import logging_config
  from sagemaker.utils import name_from_base, base_from_name
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter
label_desc: Use image node_id 5 for calling a global function with example usage: list_futures(job_name_prefix, sagemaker_session) without return types