code: def build_shared_lib_with_ya(
      parsed_args,
      top_src_root_dir,
      package_src_sub_path,
      extra_ya_make_args,
  ):
      print("building dynamic library with `ya`", file=sys.stderr)
      sys.stderr.flush()
  
      native_lib_dir = _get_native_lib_dir(
          top_src_root_dir, package_src_sub_path
      )
  
      env = os.environ.copy()
  
      ya_path = _get_ya_path()
      ya_make_commands = []
  
      common_ya_make_args = (
          [sys.executable, ya_path, "make", native_lib_dir]
          + ["--output", parsed_args.build_output_root_dir]
          + ["--build=" + parsed_args.build_type.lower()]
          + ["-D", "CATBOOST_OPENSOURCE=yes"]
          + ["-D", "CFLAGS=-DCATBOOST_OPENSOURCE=yes"]
          + ["--no-src-links"]
          + ["-DOS_SDK=local"]
          + ["-DUSE_LOCAL_SWIG=yes"]
          + [f'-DUSE_SYSTEM_JDK={os.environ["JAVA_HOME"]}']
          + [f'-DJAVA_HOME={os.environ["JAVA_HOME"]}']
          + [f'-DHAVE_CUDA={"yes" if parsed_args.have_cuda else "no"}']
      )
  
      cpp_ya_make_extra_args = []
      if parsed_args.macos_universal_binaries:
          cpp_ya_make_extra_args = [
              "--lipo",
              "--target-platform=default-darwin-x86_64",
              "--target-platform=default-darwin-arm64",
          ]
      elif parsed_args.target_platform is not None:
          cpp_ya_make_extra_args = [
              "--target-platform",
              _get_ya_make_platform_from_build_native_platform(
                  parsed_args.target_platform
              ),
          ]
  
      if parsed_args.macos_universal_binaries and _is_dll_java(
          native_lib_dir
      ):
          # TODO(akhropov): run separate commands until DLL_JAVA is fully compatible with '--lipo' (YA-60).
  
          ya_make_commands.append(
              common_ya_make_args
              + cpp_ya_make_extra_args
              + extra_ya_make_args
              + ["-D", "BUILD_LANGUAGES=CPP"]
          )
          ya_make_commands.append(
              common_ya_make_args
              + extra_ya_make_args
              + ["-D", "BUILD_LANGUAGES=JAVA"]
          )
      else:
          ya_make_commands.append(
              common_ya_make_args
              + cpp_ya_make_extra_args
              + extra_ya_make_args
          )
  
      for ya_make_command in ya_make_commands:
          if parsed_args.verbose:
              print(" ".join(ya_make_command))
          subprocess.check_call(
              ya_make_command,
              env=env,
              stdout=sys.stdout,
              stderr=sys.stderr,
          )
  
imports: from __future__ import absolute_import, print_function
  import argparse
  import errno
  import os
  import platform
  import re
  import shutil
  import subprocess
  import sys
  import zipfile
label_desc: Use image node_id 13 for calling a global function with example usage: build_shared_lib_with_ya(parsed_args, top_src_root_dir, package_src_sub_path, extra_ya_make_args) without return types