def use_plugin(name, kind=None):
 if (kind is None):
  kind = plugin_store.keys()
 else:
  if (not (kind in plugin_provides[name])):
   raise RuntimeError(('Plugin %s does not support `%s`.' % (name, kind)))
  if (kind == 'imshow'):
   kind = [kind, '_app_show']
  else:
   kind = [kind]
 _load(name)
 for k in kind:
  if (not (k in plugin_store)):
   raise RuntimeError(("'%s' is not a known plugin function." % k))
  funcs = plugin_store[k]
  funcs = ([(n, f) for (n, f) in funcs if (n == name)] + [(n, f) for (n, f) in funcs if (n != name)])
  plugin_store[k] = funcs

def use_plugin ( name , kind = None ) : if ( kind is None ) : kind = plugin_store . keys ( ) else : if ( not ( kind in plugin_provides [ name ] ) ) : raise RuntimeError ( ( 'Plugin %s does not support `%s`.' % ( name , kind ) ) ) if ( kind == 'imshow' ) : kind = [ kind , '_app_show' ] else : kind = [ kind ] _load ( name ) for k in kind : if ( not ( k in plugin_store ) ) : raise RuntimeError ( ( "'%s' is not a known plugin function." % k ) ) funcs = plugin_store [ k ] funcs = ( [ ( n , f ) for ( n , f ) in funcs if ( n == name ) ] + [ ( n , f ) for ( n , f ) in funcs if ( n != name ) ] ) plugin_store [ k ] = funcs
set the default plugin for a specified operation .