code: def test_inputs_quotes_needed(path=None):
      ds = Dataset(path).create(force=True)
      ds.save()
      cmd = "import sys; open(sys.argv[-1], 'w').write('!'.join(sys.argv[1:]))"
      # The string form of a command works fine when the inputs/outputs have
      # spaces ...
      cmd_str = '{} -c "{}" {{inputs}} {{outputs[0]}}'.format(
          sys.executable, cmd
      )
      ds.run(
          cmd_str, inputs=["*.t*"], outputs=["out0"], expand="inputs"
      )
      expected = "!".join(
          list(
              sorted(
                  [OBSCURE_FILENAME + ".t", "bar.txt", "foo blah.txt"]
              )
          )
          + ["out0"]
      )
      with open(op.join(path, "out0")) as ifh:
          eq_(ensure_unicode(ifh.read()), expected)
      # ... but the list form of a command does not. (Don't test this failure
      # with the obscure file name because we'd need to know its composition to
      # predict the failure.)
      cmd_list = [sys.executable, "-c", cmd, "{inputs}", "{outputs[0]}"]
      ds.run(cmd_list, inputs=["*.txt"], outputs=["out0"])
      ok_file_has_content(
          op.join(path, "out0"), "bar.txt foo!blah.txt!out0"
      )
  
imports: import logging
  import os
  import os.path
  import sys
  from os import mkdir, remove
  from unittest.mock import patch
  from datalad.api import clone, run
  from datalad.cli.main import main
  from datalad.core.local.run import _format_iospecs, _get_substitutions, format_command, run_command
  from datalad.distribution.dataset import Dataset
  from datalad.support.exceptions import CommandError, IncompleteResultsError, NoDatasetFound
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, OBSCURE_FILENAME, assert_false, assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, neq_, ok_, ok_exists, ok_file_has_content, patch_config, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import chpwd, ensure_unicode, on_windows
label_desc: Use image node_id 11 for calling a global function with example usage: test_inputs_quotes_needed(path) without return types