class_docstr: Wrapper around a W&B launch run.
  
  A launched run is a subprocess running an entry point
  command, that exposes methods for waiting on and cancelling the run.
  This class defines the interface that the W&B launch runner uses to manage the lifecycle
  of runs launched in different environments (e.g. runs launched locally or in a cluster).
  ``AbstractRun`` is not thread-safe. That is, concurrent calls to wait() / cancel()
  from multiple threads may inadvertently kill resources (e.g. local processes) unrelated to the
  run.
docstr: Run the command and returns a popen object or the stdout of the command.
  
  Arguments:
  cmd: The command to run
  output_only: If true just return the stdout bytes
docstr_tok: ["Run","the","command","and","returns","a","popen","object","or","the","stdout","of","the","command",".","Arguments",":","cmd",":","The","command","to","run","output_only",":","If","true","just","return","the","stdout","bytes"]
code: def _run_cmd(
      self, cmd: List[str], output_only: Optional[bool] = False
  ) -> Optional[Union["subprocess.Popen[bytes]", bytes]]:
      """Run the command and returns a popen object or the stdout of the command.
  
      Arguments:
      cmd: The command to run
      output_only: If true just return the stdout bytes
      """
      try:
          env = os.environ
          popen = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE)
          if output_only:
              popen.wait()
              if popen.stdout is not None:
                  return popen.stdout.read()
          return popen
      except subprocess.CalledProcessError as e:
          wandb.termerror(f"Command failed: {e}")
          return None
  
imports: import logging
  import os
  import subprocess
  import sys
  from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Optional, Union
  from dockerpycreds.utils import find_executable
  import wandb
  from wandb.apis.internal import Api
  from wandb.sdk.lib import runid
  from .._project_spec import LaunchProject
label_desc: Use image node_id 3 for calling the AbstractRun obj's underlying member method code with example usage: obj._run_cmd(cmd, output_only) and returns: popen, None, popen