code: def check_returncode(
      func: Callable[..., CompletedProcess],
  ) -> Callable[..., CompletedProcess]:
      """A decorator to wrap run_command and check the return code."""
  
      @wraps(func)
      def wrapper(*args: Any, **kwargs: Any) -> CompletedProcess:
          result = func(*args, **kwargs)
          result.check_returncode()
          return result
  
      return wrapper
  
file_path: PySyft/packages/syftcli/syftcli/core/proc.py
imports: from functools import wraps
  from subprocess import CalledProcessError
  from subprocess import CompletedProcess
  from subprocess import PIPE
  from subprocess import Popen
  import threading
  from typing import Any
  from typing import Callable
  from typing import Optional
label_desc: Use image node_id 3 for calling a global function with example usage: check_returncode(func) and returns: wrapper, result