code: def test_iap():
      sys.argv = [sys.argv[0]]
      pos_keys = [
          "positional_str",
          "positional_bool",
          "positional_int",
          "positional_float",
      ]
  
      opt_keys = [
          "optional_str",
          "optional_bool",
          "optional_int",
          "optional_float",
          "optional_int_2",
          "optional_float_2",
      ]
  
      pos_results = ["test", 0, 10, 10.2]
      opt_results = ["opt_test", True, 20, 20.2, None, None]
  
      inputs = inputs_from_results(opt_results, opt_keys, optional=True)
      inputs.extend(inputs_from_results(pos_results))
  
      sys.argv.extend(inputs)
      parser = IntrospectiveArgumentParser()
      dummy_flow = DummyFlow()
      parser.add_workflow(dummy_flow)
      args = parser.get_flow_args()
      all_keys = pos_keys + opt_keys
      all_results = pos_results + opt_results
  
      # Test if types and order are respected
      for k, v in zip(all_keys, all_results):
          npt.assert_equal(args[k], v)
  
      # Test if **args really fits dummy_flow's arguments
      return_values = dummy_flow.run(**args)
      npt.assert_array_equal(return_values, all_results + [2.0])
  
file_path: dipy/dipy/workflows/tests/test_iap.py
imports: import sys
  from os.path import join
  from tempfile import TemporaryDirectory
  import numpy.testing
  from dipy.workflows.base import IntrospectiveArgumentParser, none_or_dtype
  from dipy.workflows.flow_runner import run_flow
  from dipy.workflows.tests.workflow_tests_utils import DummyFlow, DummyCombinedWorkflow, DummyWorkflow1, DummyWorkflowOptionalStr, DummyVariableTypeWorkflow, DummyVariableTypeErrorWorkflow
label_desc: Use image node_id 3 for calling a global function with example usage: test_iap() without return types