code: def normalize_command(command):
      """Convert `command` to the string representation."""
      if isinstance(command, list):
          command = list(map(ensure_unicode, command))
          if len(command) == 1 and command[0] != "--":
              # This is either a quoted compound shell command or a simple
              # one-item command. Pass it as is.
              #
              # FIXME: This covers the predominant command-line case, but, for
              # Python API callers, it means values like ["./script with spaces"]
              # requires additional string-like escaping, which is inconsistent
              # with the handling of multi-item lists (and subprocess's
              # handling). Once we have a way to detect "running from Python API"
              # (discussed in gh-2986), update this.
              command = command[0]
          else:
              if command and command[0] == "--":
                  # Strip disambiguation marker. Note: "running from Python API"
                  # FIXME from below applies to this too.
                  command = command[1:]
              command = join_cmdline(command)
      else:
          command = ensure_unicode(command)
      return command
  
imports: import json
  import logging
  import os
  import os.path
  import warnings
  from argparse import REMAINDER
  from pathlib import Path
  from tempfile import mkdtemp
  import datalad
  import datalad.support.ansi_colors
  from datalad.config import anything2bool
  from datalad.core.local.save import Save
  from datalad.core.local.status import Status
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset
  from datalad.distribution.get import Get
  from datalad.distribution.install import Install
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import jobs_opt, save_message_opt
  from datalad.interface.results import get_status_dict
  from datalad.interface.utils import generic_result_renderer
  from datalad.local.unlock import Unlock
  from datalad.support.constraints import EnsureBool, EnsureChoice, EnsureNone
  from datalad.support.exceptions import CapturedException, CommandError
  from datalad.support.globbedpaths import GlobbedPaths
  from datalad.support.json_py import dump2stream
  from datalad.support.param import Parameter
  from datalad.ui import ui
  from datalad.utils import SequenceFormatter, chpwd, ensure_list, ensure_unicode, get_dataset_root, getpwd, join_cmdline, quote_cmdlinearg
label_desc: Use image node_id 9 for calling a global function with example usage: normalize_command(command) and returns: command