code: def build_spark_assembly_sbt(extra_profiles, checkstyle=False):
      # Enable all of the profiles for the build:
      build_profiles = extra_profiles + modules.root.build_profile_flags
      sbt_goals = ["assembly/package"]
      profiles_and_goals = build_profiles + sbt_goals
      print(
          "[info] Building Spark assembly using SBT with these arguments: ",
          " ".join(profiles_and_goals),
      )
      exec_sbt(profiles_and_goals)
  
      if checkstyle:
          run_java_style_checks(build_profiles)
  
      if not os.environ.get("SPARK_JENKINS") and not os.environ.get(
          "SKIP_UNIDOC"
      ):
          build_spark_unidoc_sbt(extra_profiles)
  
imports: import itertools
  from argparse import ArgumentParser
  import os
  import re
  import sys
  import subprocess
  from sparktestsupport import SPARK_HOME, USER_HOME, ERROR_CODES
  from sparktestsupport.shellutils import exit_from_command_with_retcode, run_cmd, rm_r, which
  from sparktestsupport.utils import determine_modules_for_files, determine_modules_to_test, determine_tags_to_exclude, identify_changed_files_from_git_commits
  import sparktestsupport.modules
label_desc: Use image node_id 18 for calling a global function with example usage: build_spark_assembly_sbt(extra_profiles, checkstyle) without return types