class_docstr: Generate a optimal average template
  
  .. warning::
  
    This can take a VERY long time to complete
  
  Examples
  --------
  
  >>> from nipype.interfaces.ants.legacy import buildtemplateparallel
  >>> tmpl = buildtemplateparallel()
  >>> tmpl.inputs.in_files = ['T1.nii', 'structural.nii']
  >>> tmpl.inputs.max_iterations = [30, 90, 20]
  >>> tmpl.cmdline
  'buildtemplateparallel.sh -d 3 -i 4 -m 30x90x20 -o antsTMPL_ -c 0 -t GR T1.nii structural.nii'
class_docstr_tok: ["Generate","a","optimal","average","template","..","warning",":",":","This","can","take","a","VERY","long","time","to","complete","Examples","--","--","--","--",">",">",">","from","nipype.interfaces.ants.legacy","import","buildtemplateparallel",">",">",">","tmpl","=","buildtemplateparallel","(",")",">",">",">","tmpl.inputs.in_files","=","[","'T1.nii","'",",","'structural.nii","'","]",">",">",">","tmpl.inputs.max_iterations","=","[","30",",","90",",","20","]",">",">",">","tmpl.cmdline","'buildtemplateparallel.sh","-d","3","-i","4","-m","30x90x20","-o","antsTMPL_","-c","0","-t","GR","T1.nii","structural.nii","'"]
code: def _format_arg(self, opt, spec, val):
      if opt == "num_cores":
          if self.inputs.parallelization == 2:
              return "-j " + str(val)
          else:
              return ""
      if opt == "in_files":
          if self.inputs.use_first_as_target:
              start = "-z "
          else:
              start = ""
          return start + " ".join(name for name in val)
      return super()._format_arg(opt, spec, val)
  
imports: import os
  from glob import glob
  from .base import ANTSCommand, ANTSCommandInputSpec
  from ..base import TraitedSpec, File, traits, isdefined, OutputMultiPath
  from ...utils.filemanip import split_filename
label_desc: Use image node_id 1 for calling the buildtemplateparallel obj's underlying member method code with example usage: obj._format_arg(opt, spec, val) and returns: super, unknown, unknown, str