code: def array(jvm_array):
      """
      Construct an (Python) Array from its JVM equivalent.
  
      Parameters
      ----------
      jvm_array : org.apache.arrow.vector.ValueVector
  
      Returns
      -------
      array : Array
      """
      if jvm_array.getField().getType().isComplex():
          minor_type_str = jvm_array.getMinorType().toString()
          raise NotImplementedError(
              "Cannot convert JVM Arrow array of type {},"
              " complex types not yet implemented.".format(
                  minor_type_str
              )
          )
      dtype = field(jvm_array.getField()).type
      buffers = [
          jvm_buffer(buf) for buf in list(jvm_array.getBuffers(False))
      ]
  
      # If JVM has an empty Vector, buffer list will be empty so create manually
      if len(buffers) == 0:
          return pa.array([], type=dtype)
  
      length = jvm_array.getValueCount()
      null_count = jvm_array.getNullCount()
      return pa.Array.from_buffers(dtype, length, buffers, null_count)
  
file_path: arrow/python/pyarrow/jvm.py
imports: import pyarrow
label_desc: Use image node_id 9 for calling a global function with example usage: array(jvm_array) and returns: pa, pa