code: def check_sru_requirement(abort=False):
      """
      Return True if check pass; if check fails and abort is True,
      raise an Exception, othereise return False.
      """
  
      # Check 1.
      try:
          if platform.system() == "Windows":
              subprocess.check_output(
                  "pip freeze | findstr cupy", shell=True
              )
              subprocess.check_output(
                  "pip freeze | findstr pynvrtc", shell=True
              )
          else:  # Unix-like systems
              subprocess.check_output(
                  "pip freeze | grep -w cupy", shell=True
              )
              subprocess.check_output(
                  "pip freeze | grep -w pynvrtc", shell=True
              )
      except subprocess.CalledProcessError:
          if not abort:
              return False
          raise AssertionError(
              "Using SRU requires 'cupy' and 'pynvrtc' "
              "python packages installed."
          )
  
      # Check 2.
      if torch.cuda.is_available() is False:
          if not abort:
              return False
          raise AssertionError(
              "Using SRU requires pytorch built with cuda."
          )
  
      # Check 3.
      pattern = re.compile(".*cuda/lib.*")
      ld_path = os.getenv("LD_LIBRARY_PATH", "")
      if re.match(pattern, ld_path) is None:
          if not abort:
              return False
          raise AssertionError(
              "Using SRU requires setting cuda lib path, e.g. "
              "export LD_LIBRARY_PATH=/usr/local/cuda/lib64."
          )
  
      return True
  
imports: import subprocess
  import platform
  import os
  import re
  import configargparse
  import torch
  import torch.nn
  from torch.autograd import Function
  from torch.cuda.amp import custom_fwd, custom_bwd
  from collections import namedtuple
label_desc: Use image node_id 1 for calling a global function with example usage: check_sru_requirement(abort) and returns: True, False, False, False