code: def run_command(
      args: list[str],
      *,
      retries: int = 0,
      timeout: int | None = None,
      stdin: BinaryIO | None = None,
      input: bytes | None = None,
      check: bool = False,
      cwd: os.PathLike[Any] | None = None,
  ) -> subprocess.CompletedProcess[bytes]:
      remaining_retries = retries
      while True:
          try:
              return _run_command(
                  args,
                  timeout=timeout,
                  stdin=stdin,
                  input=input,
                  check=check,
                  cwd=cwd,
              )
          except subprocess.TimeoutExpired as err:
              if remaining_retries == 0:
                  raise err
              remaining_retries -= 1
              logging.warning(
                  "(%s/%s) Retrying because command failed with: %r",
                  retries - remaining_retries,
                  retries,
                  err,
              )
              time.sleep(1)
  
imports: from __future__ import annotations
  import argparse
  import concurrent.futures
  import dataclasses
  import enum
  import json
  import logging
  import os
  import subprocess
  import sys
  import time
  from typing import Any, BinaryIO
label_desc: Use image node_id 4 for calling a global function with example usage: run_command(args) and returns: _run_command