code: def run_dcos_command(command, raise_on_error=False, print_output=True):
      
  
      call = shlex.split(command)
      call.insert(0, 'dcos')
  
      print("\n{}{}\n".format(shakedown.fchr('>>'), ' '.join(call)))
  
      proc = subprocess.Popen(call, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      output, error = proc.communicate()
      return_code = proc.wait()
      stdout = output.decode('utf-8')
      stderr = error.decode('utf-8')
  
      if print_output:
          print(stdout, stderr, return_code)
  
      if return_code != 0 and raise_on_error:
          raise DCOSException(
              'Got error code {} when running command "dcos {}":\nstdout: "{}"\nstderr: "{}"'.format(
              return_code, command, stdout, stderr))
  
      return stdout, stderr, return_code
docs: Run `dcos {command}` via DC/OS CLI
  
          :param command: the command to execute
          :type command: str
          :param raise_on_error: whether to raise a DCOSException if the return code is nonzero
          :type raise_on_error: bool
          :param print_output: whether to print the resulting stdout/stderr from running the command
          :type print_output: bool
  
          :return: (stdout, stderr, return_code)
          :rtype: tuple