class_docstr: Extends `BaseInterface` class to implement SPM specific interfaces.
  
  WARNING: Pseudo prototype class, meant to be subclassed
class_docstr_tok: ["Extends","`","BaseInterface","`","class","to","implement","SPM","specific","interfaces",".","WARNING",":","Pseudo","prototype","class",",","meant","to","be","subclassed"]
docstr: Recursive function to generate spm job specification as a string
  
  Parameters
  ----------
  prefix : string
      A string that needs to get
  contents : dict
      A non-tuple Python structure containing spm job
      information gets converted to an appropriate sequence of
      matlab commands.
code: def _generate_job(self, prefix="", contents=None):
      """Recursive function to generate spm job specification as a string
  
      Parameters
      ----------
      prefix : string
          A string that needs to get
      contents : dict
          A non-tuple Python structure containing spm job
          information gets converted to an appropriate sequence of
          matlab commands.
  
      """
      jobstring = ""
      if contents is None:
          return jobstring
      if isinstance(contents, list):
          for i, value in enumerate(contents):
              if prefix.endswith(")"):
                  newprefix = "%s,%d)" % (prefix[:-1], i + 1)
              else:
                  newprefix = "%s(%d)" % (prefix, i + 1)
              jobstring += self._generate_job(newprefix, value)
          return jobstring
      if isinstance(contents, dict):
          for key, value in list(contents.items()):
              newprefix = f"{prefix}.{key}"
              jobstring += self._generate_job(newprefix, value)
          return jobstring
      if isinstance(contents, np.ndarray):
          if contents.dtype == np.dtype(object):
              if prefix:
                  jobstring += "%s = {...\n" % (prefix)
              else:
                  jobstring += "{...\n"
              for i, val in enumerate(contents):
                  if isinstance(val, np.ndarray):
                      jobstring += self._generate_job(
                          prefix=None, contents=val
                      )
                  elif isinstance(val, list):
                      items_format = []
                      for el in val:
                          items_format += [
                              "{}"
                              if not isinstance(el, (str, bytes))
                              else "'{}'"
                          ]
                      val_format = ", ".join(items_format).format
                      jobstring += f"[{val_format(*val)}];...\n"
                  elif isinstance(val, (str, bytes)):
                      jobstring += f"'{val}';...\n"
                  else:
                      jobstring += "%s;...\n" % str(val)
              jobstring += "};\n"
          else:
              for i, val in enumerate(contents):
                  for field in val.dtype.fields:
                      if prefix:
                          newprefix = "%s(%d).%s" % (
                              prefix,
                              i + 1,
                              field,
                          )
                      else:
                          newprefix = "(%d).%s" % (i + 1, field)
                      jobstring += self._generate_job(
                          newprefix, val[field]
                      )
          return jobstring
      if isinstance(contents, (str, bytes)):
          jobstring += f"{prefix} = '{contents}';\n"
          return jobstring
      jobstring += f"{prefix} = {str(contents)};\n"
      return jobstring
  
imports: import os
  from copy import deepcopy
  from nibabel import load
  import numpy
  from ...None import logging
  from ...utils import spm_docs
  from ..base import BaseInterface, traits, isdefined, InputMultiPath, BaseInterfaceInputSpec, Directory, Undefined, ImageFile, PackageInfo
  from ..base.traits_extension import NoDefaultSpecified
  from ..matlab import MatlabCommand
  from ...external.due import due, Doi, BibTeX
label_desc: Use image node_id 14 for calling the SPMCommand obj's underlying member method code with example usage: obj._generate_job(prefix, contents) and returns: jobstring, jobstring, jobstring, jobstring, jobstring, jobstring