def _check_cb(cb_):
 if (cb_ is not None):
  if hasattr(cb_, '__call__'):
   return cb_
  else:
   log.error('log_callback is not callable, ignoring')
 return (lambda x: x)

def _check_cb ( cb_ ) : if ( cb_ is not None ) : if hasattr ( cb_ , '__call__' ) : return cb_ else : log . error ( 'log_callback is not callable, ignoring' ) return ( lambda x : x )
if the callback is none or is not callable .