title: How to check that pylab backend of matplotlib runs inline?
body: <p>I am modifying a python module that plots some special graphs using matplotlib.</p>
  
  <p>Right now, this module just saves all figures as files.</p>
  
  <p>I would like to make it possible to import the module while working in ipython notebook and see the results "inline", on the other hand I would like to keep the default functionality of saving the figures as files when the module is imported in all other cases.</p>
  
  <p>So I need somehow to check if the module is imported in ipython notebook and the pylab is operating inline or not.</p>
  
  <p>How can I check this?</p>