code: def test_as_ndarray(
      input_dtype,
      input_order,
      copy,
      output_dtype,
      output_order,
      was_copied,
  ):
      shape = (10, 11)
      arr1 = np.ones(shape, dtype=input_dtype, order=input_order)
      arr2 = as_ndarray(
          arr1, copy=copy, dtype=output_dtype, order=output_order
      )
  
      # check if nd_array copied the original array or not
      assert are_arrays_identical(arr1[0], arr2[0]) != was_copied
  
      if output_dtype is None:
          assert arr2.dtype == input_dtype
      else:
          assert arr2.dtype == output_dtype
  
      result_order = (
          output_order if output_order is not None else input_order
      )
  
      if result_order == "F":
          assert arr2.flags["F_CONTIGUOUS"]
      else:
          assert arr2.flags["C_CONTIGUOUS"]
  
file_path: nilearn/nilearn/_utils/tests/test_numpy_conversions.py
imports: import os
  import tempfile
  import numpy
  import pytest
  from nilearn._utils.numpy_conversions import as_ndarray, csv_to_array
label_desc: Use image node_id 3 for calling a global function with example usage: test_as_ndarray(input_dtype, input_order, copy, output_dtype, output_order, was_copied) without return types