code: def _convert_numpy_to_java_array(np_arr: np.ndarray) -> JavaArray:
      """
      Converts a flat numpy array of doubles to a Java array of doubles.
      """
      assert check_argument_types()
      assert len(np_arr.shape) == 1
      assert np_arr.dtype.type == np.double
  
      sc = SparkContext._active_spark_context
      size = np_arr.shape[0]
      # Convert to big endian and serialize
      byte_arr = np.ascontiguousarray(np_arr, ">d").tobytes()
      java_arr = sc._jvm.io.projectglow.common.PythonUtils.doubleArrayFromBytes(
          size, byte_arr
      )
      assert check_return_type(java_arr)
      return java_arr
  
file_path: glow/python/glow/conversions.py
imports: import numpy
  from py4j.java_collections import JavaArray
  from pyspark import SparkContext
  from typeguard import check_argument_types, check_return_type
label_desc: Use image node_id 2 for calling a global function with example usage: _convert_numpy_to_java_array(np_arr) and returns: java_arr