code: def _wait_for_other_builds(ticket_number):
      sorted_files = _list_tickets()
  
      print("build queue status:")
      print()
  
      for order, file in enumerate(sorted_files):
          (
              file_ticket_number,
              build_id,
              source_version,
          ) = _build_info_from_file(file)
          print(
              "%s -> %s %s, ticket number: %s status: %s"
              % (
                  order,
                  build_id,
                  source_version,
                  file_ticket_number,
                  file.key.split("/")[1],
              )
          )
      print()
      build_id = re.sub(
          "[_/]",
          "-",
          os.environ.get("CODEBUILD_BUILD_ID", "CODEBUILD-BUILD-ID"),
      )
      source_version = re.sub(
          "[_/]",
          "-",
          os.environ.get(
              "CODEBUILD_SOURCE_VERSION", "CODEBUILD-SOURCE-VERSION"
          ),
      )
      filename = "%s_%s_%s" % (ticket_number, build_id, source_version)
      s3_file_obj = _write_ticket(filename, status="waiting")
      print("Build %s waiting to be scheduled" % filename)
  
      while True:
          _cleanup_tickets_with_terminal_states()
          waiting_tickets = _list_tickets("waiting")
          if waiting_tickets:
              first_waiting_ticket_number, _, _ = _build_info_from_file(
                  _list_tickets("waiting")[0]
              )
          else:
              first_waiting_ticket_number = ticket_number
  
          if (
              len(_list_tickets(status="in-progress")) < 3
              and last_in_progress_elapsed_time_check()
              and first_waiting_ticket_number == ticket_number
          ):
              # put the build in progress
              print("Scheduling build %s for running.." % filename)
              s3_file_obj.delete()
              _write_ticket(filename, status="in-progress")
              break
          else:
              # wait
              time.sleep(30)
  
file_path: sagemaker-python-sdk/ci-scripts/queue_build.py
imports: from __future__ import absolute_import
  import os
  import re
  import time
  import boto3
label_desc: Use image node_id 3 for calling a global function with example usage: _wait_for_other_builds(ticket_number) without return types