class_docstr: Runs arbitrary function as an interface
  
  Examples
  --------
  
  >>> func = 'def func(arg1, arg2=5): return arg1 + arg2'
  >>> fi = Function(input_names=['arg1', 'arg2'], output_names=['out'])
  >>> fi.inputs.function_str = func
  >>> res = fi.run(arg1=1)
  >>> res.outputs.out
  6
code: def _run_interface(self, runtime):
      # Create function handle
      function_handle = create_function_from_source(
          self.inputs.function_str, self.imports
      )
      # Get function args
      args = {}
      for name in self._input_names:
          value = getattr(self.inputs, name)
          if isdefined(value):
              args[name] = value
  
      out = function_handle(**args)
      if len(self._output_names) == 1:
          self._out[self._output_names[0]] = out
      else:
          if isinstance(out, tuple) and (
              len(out) != len(self._output_names)
          ):
              raise RuntimeError(
                  "Mismatch in number of expected outputs"
              )
  
          else:
              for idx, name in enumerate(self._output_names):
                  self._out[name] = out[idx]
  
      return runtime
  
file_path: nipype/nipype/interfaces/utility/wrappers.py
imports: from ...None import logging
  from ..base import traits, DynamicTraitedSpec, Undefined, isdefined, BaseInterfaceInputSpec
  from ..io import IOBase, add_traits
  from ...utils.filemanip import ensure_list
  from ...utils.functions import getsource, create_function_from_source
label_desc: Use image node_id 4 for calling the Function obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime