code: def command(
      engine, format_, filepath=None, renderer=None, formatter=None
  ):
      """Return args list for ``subprocess.Popen`` and name of the rendered file."""
      if formatter is not None and renderer is None:
          raise RequiredArgumentError(
              "formatter given without renderer"
          )
  
      if engine not in ENGINES:
          raise ValueError("unknown engine: %r" % engine)
      if format_ not in FORMATS:
          raise ValueError("unknown format: %r" % format_)
      if renderer is not None and renderer not in RENDERERS:
          raise ValueError("unknown renderer: %r" % renderer)
      if formatter is not None and formatter not in FORMATTERS:
          raise ValueError("unknown formatter: %r" % formatter)
  
      output_format = [
          f for f in (format_, renderer, formatter) if f is not None
      ]
      cmd = ["dot", "-K%s" % engine, "-T%s" % ":".join(output_format)]
  
      if filepath is None:
          rendered = None
      else:
          cmd.extend(["-O", filepath])
          suffix = ".".join(reversed(output_format))
          rendered = "%s.%s" % (filepath, suffix)
  
      return cmd, rendered
  
imports: import errno
  import logging
  import os
  import platform
  import re
  import subprocess
  from .None import _compat
  from .None import tools
label_desc: Use image node_id 1 for calling a global function with example usage: command(engine, format_, filepath, renderer, formatter) and returns: cmd,  rendered