class_docstr: Execute using PBS/Torque
  
  The plugin_args input to run can be used to control the SGE execution.
  Currently supported options are:
  
  - template : template to use for batch job submission
  - qsub_args : arguments to be prepended to the job execution script in the
                qsub call
  - max_jobname_len: maximum length of the job name.  Default 15.
code: def _is_pending(self, taskid):
      result = CommandLine(
          f"qstat -f {taskid}",
          environ=dict(os.environ),
          terminal_output="file_split",
          resource_monitor=False,
          ignore_exception=True,
      ).run()
  
      stdout = result.runtime.stdout
      stderr = result.runtime.stderr
      errmsg = "Unknown Job Id"
      success = "Job has finished"
      if (success in stderr) or ("job_state = C" in stdout):
          return False
      else:
          return errmsg not in stderr
  
file_path: nipype/nipype/pipeline/plugins/pbs.py
imports: import os
  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 PBSPlugin obj's underlying member method code with example usage: obj._is_pending(taskid) and returns: False, unknown