code: def _run_command(self, cmd, card_uuid, env, wait=True, timeout=None):
      fail = False
      timeout_args = {}
      async_timeout = ASYNC_TIMEOUT
      if timeout is not None:
          async_timeout = int(timeout) + 10
          timeout_args = dict(timeout=int(timeout) + 10)
  
      if wait:
          self._wait_for_async_processes_to_finish(
              card_uuid, async_timeout
          )
          try:
              rep = subprocess.check_output(
                  cmd, env=env, stderr=subprocess.STDOUT, **timeout_args
              )
          except subprocess.CalledProcessError as e:
              rep = e.output
              fail = True
          except subprocess.TimeoutExpired as e:
              rep = e.output
              fail = True
          return rep, fail
      else:
          (
              _async_proc,
              _async_started,
          ) = CardProcessManager._get_card_process(card_uuid)
          if _async_proc and _async_proc.poll() is None:
              if time.time() - _async_started > async_timeout:
                  CardProcessManager._remove_card_process(card_uuid)
                  # Since we have removed the card process, we are free to run a new one
                  # This will also ensure that when a old process is removed a new one is replaced.
                  return self._run_command(
                      cmd, card_uuid, env, wait=wait, timeout=timeout
                  )
              else:
                  # silently refuse to run an async process if a previous one is still running
                  # and timeout hasn't been reached
                  return "".encode(), False
          else:
              CardProcessManager._register_card_process(
                  card_uuid,
                  subprocess.Popen(
                      cmd,
                      env=env,
                      stderr=subprocess.DEVNULL,
                      stdout=subprocess.DEVNULL,
                  ),
              )
              return "".encode(), False
  
file_path: metaflow/metaflow/plugins/cards/card_creator.py
imports: import time
  import subprocess
  import tempfile
  import json
  import sys
  import os
  from metaflow import current
label_desc: Use image node_id 5 for calling the CardCreator obj's underlying member method code with example usage: obj._run_command(cmd, card_uuid, env, wait, timeout) and returns: rep,  fail, str,  False, self, str,  False