class_docstr: Basic interface class to merge inputs into a single list
  
  ``Merge(1)`` will merge a list of lists
  
  Examples
  --------
  
  >>> from nipype.interfaces.utility import Merge
  >>> mi = Merge(3)
  >>> mi.inputs.in1 = 1
  >>> mi.inputs.in2 = [2, 5]
  >>> mi.inputs.in3 = 3
  >>> out = mi.run()
  >>> out.outputs.out
  [1, 2, 5, 3]
  
  >>> merge = Merge(1)
  >>> merge.inputs.in1 = [1, [2, 5], 3]
  >>> out = merge.run()
  >>> out.outputs.out
  [1, [2, 5], 3]
  
  >>> merge = Merge(1)
  >>> merge.inputs.in1 = [1, [2, 5], 3]
  >>> merge.inputs.ravel_inputs = True
  >>> out = merge.run()
  >>> out.outputs.out
  [1, 2, 5, 3]
  
  >>> merge = Merge(1)
  >>> merge.inputs.in1 = [1, [2, 5], 3]
  >>> merge.inputs.no_flatten = True
  >>> out = merge.run()
  >>> out.outputs.out
  [[1, [2, 5], 3]]
class_docstr_tok: ["Basic","interface","class","to","merge","inputs","into","a","single","list","``","Merge","(","1",")","``","will","merge","a","list","of","lists","Examples","--","--","--","--",">",">",">","from","nipype.interfaces.utility","import","Merge",">",">",">","mi","=","Merge","(","3",")",">",">",">","mi.inputs.in1","=","1",">",">",">","mi.inputs.in2","=","[","2",",","5","]",">",">",">","mi.inputs.in3","=","3",">",">",">","out","=","mi.run","(",")",">",">",">","out.outputs.out","[","1",",","2",",","5",",","3","]",">",">",">","merge","=","Merge","(","1",")",">",">",">","merge.inputs.in1","=","[","1",",","[","2",",","5","]",",","3","]",">",">",">","out","=","merge.run","(",")",">",">",">","out.outputs.out","[","1",",","[","2",",","5","]",",","3","]",">",">",">","merge","=","Merge","(","1",")",">",">",">","merge.inputs.in1","=","[","1",",","[","2",",","5","]",",","3","]",">",">",">","merge.inputs.ravel_inputs","=","True",">",">",">","out","=","merge.run","(",")",">",">",">","out.outputs.out","[","1",",","2",",","5",",","3","]",">",">",">","merge","=","Merge","(","1",")",">",">",">","merge.inputs.in1","=","[","1",",","[","2",",","5","]",",","3","]",">",">",">","merge.inputs.no_flatten","=","True",">",">",">","out","=","merge.run","(",")",">",">",">","out.outputs.out","[","[","1",",","[","2",",","5","]",",","3","]","]"]
code: def _list_outputs(self):
      outputs = self._outputs().get()
      out = []
  
      if self._numinputs < 1:
          return outputs
      else:
          getval = lambda idx: getattr(self.inputs, "in%d" % (idx + 1))
          values = [
              getval(idx)
              for idx in range(self._numinputs)
              if isdefined(getval(idx))
          ]
  
      if self.inputs.axis == "vstack":
          for value in values:
              if isinstance(value, list) and not self.inputs.no_flatten:
                  out.extend(
                      _ravel(value)
                      if self.inputs.ravel_inputs
                      else value
                  )
              else:
                  out.append(value)
      else:
          lists = [ensure_list(val) for val in values]
          out = [
              [val[i] for val in lists] for i in range(len(lists[0]))
          ]
      outputs["out"] = out
      return outputs
  
imports: import os
  import re
  import numpy
  from ..base import traits, TraitedSpec, DynamicTraitedSpec, File, Undefined, isdefined, OutputMultiPath, InputMultiPath, BaseInterface, BaseInterfaceInputSpec, Str, SimpleInterface
  from ..io import IOBase, add_traits
  from ...utils.filemanip import ensure_list, copyfile, split_filename
label_desc: Use image node_id 2 for calling the Merge obj's underlying member method code with example usage: obj._list_outputs() and returns: outputs, outputs