code: def double_matrix_to_ndarray(m):
      
      rows = javabridge.get_env().get_object_array_elements(m)
      num_rows = len(rows)
      num_cols = javabridge.get_env().get_array_length(rows[0])
      result = numpy.zeros(num_rows * num_cols).reshape((num_rows, num_cols))
      i = 0
      for row in rows:
          elements = javabridge.get_env().get_double_array_elements(row)
          n = 0
          for element in elements:
              result[i][n] = element
              n += 1
          i += 1
      return result
docs: Turns the Java matrix (2-dim array) of doubles into a numpy 2-dim array.
  
      :param m: the double matrix
      :type: JB_Object
      :return: Numpy array
      :rtype: numpy.darray