code: def setup_jpype():
      import jpype
  
      jar_path = f"{_ARROW_TOOLS_JAR}:{_ARROW_C_DATA_JAR}"
      # XXX Didn't manage to tone down the logging level here (DEBUG -> INFO)
      java_opts = _JAVA_OPTS[:]
      proc = subprocess.run(
          ["java", "--add-opens"],
          stderr=subprocess.PIPE,
          stdout=subprocess.PIPE,
          text=True,
      )
      if "Unrecognized option: --add-opens" not in proc.stderr:
          # Java 9+
          java_opts.append(
              "--add-opens=java.base/java.nio="
              "org.apache.arrow.memory.core,ALL-UNNAMED"
          )
      jpype.startJVM(
          jpype.getDefaultJVMPath(),
          "-Djava.class.path=" + jar_path,
          # This flag is too heavy for IPC and Flight tests
          "-Darrow.memory.debug.allocator=true",
          # Reduce internal use of signals by the JVM
          "-Xrs",
          *java_opts,
      )
  
imports: import contextlib
  import functools
  import os
  import subprocess
  from .None import cdata
  from .tester import Tester, CDataExporter, CDataImporter
  from .util import run_cmd, log
  from ..utils.source import ARROW_ROOT_DEFAULT
label_desc: Use image node_id 2 for calling a global function with example usage: setup_jpype() without return types