docstr: Create an iterator for IO.
  
  Use a couple of inspection tricks to build an IOIterator using the
  previous frame (values of local variables and other contextuals) and
  the run method's docstring.
docstr_tok: ["Create","an","iterator","for","IO",".","Use","a","couple","of","inspection","tricks","to","build","an","IOIterator","using","the","previous","frame","(","values","of","local","variables","and","other","contextuals",")","and","the","run","method","'s","docstring","."]
code: def get_io_iterator(self):
      """Create an iterator for IO.
  
      Use a couple of inspection tricks to build an IOIterator using the
      previous frame (values of local variables and other contextuals) and
      the run method's docstring.
      """
      # To manage different python versions.
      frame = inspect.stack()[1]
      if isinstance(frame, tuple):
          frame = frame[0]
      else:
          frame = frame.frame
  
      io_it = io_iterator_(
          frame,
          self.run,
          output_strategy=self._output_strategy,
          mix_names=self._mix_names,
      )
  
      # Make a list out of a list of lists
      self.flat_outputs = [
          item for sublist in io_it.outputs for item in sublist
      ]
  
      if io_it.out_keys:
          self.last_generated_outputs = dict(
              zip(io_it.out_keys, self.flat_outputs)
          )
      else:
          self.last_generated_outputs = self.flat_outputs
  
      if self.manage_output_overwrite():
          return io_it
      else:
          return []
  
file_path: dipy/dipy/workflows/workflow.py
imports: import inspect
  import logging
  import os
  from dipy.workflows.multi_io import io_iterator_
label_desc: Use image node_id 2 for calling the Workflow obj's underlying member method code with example usage: obj.get_io_iterator() and returns: io_it, list