code: def check(self):
      from packaging.version import parse
  
      if not self.checked:
          if not shutil.which("singularity"):
              raise WorkflowError(
                  "The apptainer or singularity command has to be "
                  "available in order to use apptainer/singularity "
                  "integration."
              )
          try:
              v = subprocess.check_output(
                  ["singularity", "--version"], stderr=subprocess.PIPE
              ).decode()
          except subprocess.CalledProcessError as e:
              raise WorkflowError(
                  f"Failed to get singularity version:\n{e.stderr.decode()}"
              )
          if v.startswith("apptainer"):
              if self.parseversion(v) < parse("1.0.0"):
                  raise WorkflowError(
                      "Minimum apptainer version is 1.0.0."
                  )
          elif self.parseversion(v) < parse("2.4.1"):
              raise WorkflowError(
                  "Minimum singularity version is 2.4.1."
              )
          self._version = v
  
imports: from pathlib import Path
  import subprocess
  import shutil
  import os
  import hashlib
  from snakemake.common import get_snakemake_searchpaths, is_local_file, parse_uri
  from snakemake.exceptions import WorkflowError
  from snakemake.logging import logger
  from snakemake_interface_common.utils import lazy_property
label_desc: Use image node_id 5 for calling the Singularity obj's underlying member method code with example usage: obj.check() without return types