class_docstr: Basic interface class generates identity mappings
  
  Examples
  --------
  
  >>> from nipype.interfaces.utility import IdentityInterface
  >>> ii = IdentityInterface(fields=['a', 'b'], mandatory_inputs=False)
  >>> ii.inputs.a
  <undefined>
  
  >>> ii.inputs.a = 'foo'
  >>> out = ii._outputs()
  >>> out.a
  <undefined>
  
  >>> out = ii.run()
  >>> out.outputs.a
  'foo'
  
  >>> ii2 = IdentityInterface(fields=['a', 'b'], mandatory_inputs=True)
  >>> ii2.inputs.a = 'foo'
  >>> out = ii2.run() # doctest: +SKIP
  ValueError: IdentityInterface requires a value for input 'b' because it was listed in 'fields' Interface IdentityInterface failed to run.
class_docstr_tok: ["Basic","interface","class","generates","identity","mappings","Examples","--","--","--","--",">",">",">","from","nipype.interfaces.utility","import","IdentityInterface",">",">",">","ii","=","IdentityInterface","(","fields=","[","'","a","'",",","'","b","'","]",",","mandatory_inputs=False",")",">",">",">","ii.inputs.a","<","undefined",">",">",">",">","ii.inputs.a","=","'foo'",">",">",">","out","=","ii._outputs","(",")",">",">",">","out.a","<","undefined",">",">",">",">","out","=","ii.run","(",")",">",">",">","out.outputs.a","'foo'",">",">",">","ii2","=","IdentityInterface","(","fields=","[","'","a","'",",","'","b","'","]",",","mandatory_inputs=True",")",">",">",">","ii2.inputs.a","=","'foo'",">",">",">","out","=","ii2.run","(",")","#","doctest",":","+SKIP","ValueError",":","IdentityInterface","requires","a","value","for","input","'","b","'","because","it","was","listed","in","'fields","'","Interface","IdentityInterface","failed","to","run","."]
code: def _list_outputs(self):
      # manual mandatory inputs check
      if self._fields and self._mandatory_inputs:
          for key in self._fields:
              value = getattr(self.inputs, key)
              if not isdefined(value):
                  msg = (
                      "%s requires a value for input '%s' because it was listed in 'fields'. \
                      You can turn off mandatory inputs checking by passing mandatory_inputs = False to the constructor."
                      % (self.__class__.__name__, key)
                  )
                  raise ValueError(msg)
  
      outputs = self._outputs().get()
      for key in self._fields:
          val = getattr(self.inputs, key)
          if isdefined(val):
              outputs[key] = val
      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 3 for calling the IdentityInterface obj's underlying member method code with example usage: obj._list_outputs() and returns: outputs