def frame(I=None, second=5, saveable=True, name='frame', cmap=None, fig_idx=12836):
 if (saveable is False):
  plt.ion()
 fig = plt.figure(fig_idx)
 if (len(I.shape) and (I.shape[(-1)] == 1)):
  I = I[:, :, 0]
 plt.imshow(I, cmap)
 plt.title(name)
 if saveable:
  plt.savefig((name + '.pdf'), format='pdf')
 else:
  plt.draw()
  plt.pause(second)

def frame ( I = None , second = 5 , saveable = True , name = 'frame' , cmap = None , fig_idx = 12836 ) : if ( saveable is False ) : plt . ion ( ) fig = plt . figure ( fig_idx ) if ( len ( I . shape ) and ( I . shape [ ( - 1 ) ] == 1 ) ) : I = I [ : , : , 0 ] plt . imshow ( I , cmap ) plt . title ( name ) if saveable : plt . savefig ( ( name + '.pdf' ) , format = 'pdf' ) else : plt . draw ( ) plt . pause ( second )
display a frame .