code: def run_command(runner_args, cwd="./", **kwargs):
      """Helper function to run commands with error handling.
  
      Args:
          runner_args (list): Commands to run via subprocess
  
      Keyword Args:
          cwd (str): A path from which to execute commands
          error_message (str): Message to output if command fails
          quiet (bool): Set to True to suppress command output
      """
      default_error_message = (
          "An error occurred while running: {}".format(
              " ".join(runner_args)
          )
      )
      error_message = kwargs.get("error_message", default_error_message)
  
      # Add the -force-copy flag for s3 state copying to suppress dialogs that
      # the user must type 'yes' into.
      if runner_args[0] == "terraform":
          if runner_args[1] == "init":
              runner_args.append("-force-copy")
  
      stdout_option = None
      if kwargs.get("quiet"):
          stdout_option = open(os.devnull, "w")
  
      try:
          subprocess.check_call(
              runner_args, stdout=stdout_option, cwd=cwd
          )  # nosec
      except subprocess.CalledProcessError as err:
          LOGGER.error("%s\n%s", error_message, err.cmd)
          return False
      except OSError as err:
          LOGGER.error(
              "%s\n%s (%s)", error_message, err.strerror, runner_args[0]
          )
          return False
  
      return True
  
file_path: streamalert/streamalert_cli/helpers.py
imports: from getpass import getpass
  import json
  import os
  import re
  import subprocess
  import boto3
  from botocore.exceptions import ClientError, NoCredentialsError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: run_command(runner_args, cwd) and returns: True, False, False