code: def _dense_value_to_ndarray_test(
      data,
      num_of_dynamic_axes,
      expected_value_shape,
      expected_array_shapes,
  ):
      shape = (5,)
  
      if num_of_dynamic_axes == 2:
          var = C.sequence.input_variable(shape)
      elif num_of_dynamic_axes == 1:
          var = C.input_variable(shape)
      else:
          var = C.input_variable(shape, dynamic_axes=[])
  
      # conversion array -> value
      val = asvalue(var, data)
      assert val.shape == expected_value_shape
  
      # conversion value -> array
      dense_result = _value_as_sequence_or_array(val, var)
  
      if isinstance(dense_result, list):
          result_shapes = [AA(v).shape for v in dense_result]
      else:
          result_shapes = dense_result.shape
  
      assert result_shapes == expected_array_shapes
  
imports: import pytest
  import numpy
  import scipy.sparse
  import cntk
  from cntk.ops.tests.ops_test_utils import cntk_device
  from cntk.internal import _value_as_sequence_or_array
  from cntk import asvalue
  from cntk.tests.test_utils import _to_dense, _to_csr
label_desc: Use image node_id 1 for calling a global function with example usage: _dense_value_to_ndarray_test(data, num_of_dynamic_axes, expected_value_shape, expected_array_shapes) without return types