class_docstr: Execute using SLURM
  
  The plugin_args input to run can be used to control the SLURM execution.
  Currently supported options are:
  
  - template : template to use for batch job submission
  
  - sbatch_args: arguments to pass prepend to the sbatch call
code: def _is_pending(self, taskid):
      try:
          res = CommandLine(
              "squeue",
              args=" ".join(["-j", "%s" % taskid]),
              resource_monitor=False,
              terminal_output="allatonce",
          ).run()
          return res.runtime.stdout.find(str(taskid)) > -1
      except RuntimeError as e:
          if any(
              ss in str(e)
              for ss in [
                  "Socket timed out",
                  "not available at the moment",
              ]
          ):
              # do not raise error and allow recheck
              logger.warning(
                  "SLURM timeout encountered while checking job status,"
                  " treating job %d as pending",
                  taskid,
              )
              return True
          if "Invalid job id" not in str(e):
              raise (e)
          return False
  
file_path: nipype/nipype/pipeline/plugins/slurm.py
imports: import os
  import re
  from time import sleep
  from ...None import logging
  from ...interfaces.base import CommandLine
  from .base import SGELikeBatchManagerBase, logger
label_desc: Use image node_id 2 for calling the SLURMPlugin obj's underlying member method code with example usage: obj._is_pending(taskid) and returns: unknown, False, True