def register_adapter(mod, func):
 if (not hasattr(func, '__call__')):
  raise TypeError('func must be callable')
 imports.when_imported(mod, func)

def register_adapter ( mod , func ) : if ( not hasattr ( func , '__call__' ) ) : raise TypeError ( 'func must be callable' ) imports . when_imported ( mod , func )
registers a callable to be executed when a module is imported .