code: def inputs_from_results(results, keys=None, optional=False):
      prefix = "--"
      inputs = []
      for idx, result in enumerate(results):
          if keys is not None:
              inputs.append(prefix + keys[idx])
          if optional and str(result) in ["True", "False"]:
              continue
          inputs.append(str(result))
  
      return inputs
  
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 7 for calling a global function with example usage: inputs_from_results(results, keys, optional) and returns: inputs