code: def _run_cmd(
      self,
      cmd: Iterable[str],
      args: Iterable[str] = (),
      cwd: Optional[pathlib.Path] = None,
  ) -> int:
      cmd = list(cmd)
      cmd.extend(args)
      if cwd is None:
          cwd = self.builddir
      logger.info('Running "%s" in "%s"', shlex.join(cmd), cwd)
      return subprocess.check_call(
          cmd,
          cwd=os.fspath(cwd),
          env=self.getenv(),
      )
  
imports: import argparse
  import enum
  import dataclasses
  import logging
  import os
  import pathlib
  import re
  import shlex
  import shutil
  import socket
  import subprocess
  import sys
  import sysconfig
  import tempfile
  import time
  import warnings
  import webbrowser
  from typing import cast, Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
label_desc: Use image node_id 8 for calling the BuildProfile obj's underlying member method code with example usage: obj._run_cmd(cmd, args, cwd) and returns: subprocess