def call_plugin(kind, *args, **kwargs):
 if (not (kind in plugin_store)):
  raise ValueError(('Invalid function (%s) requested.' % kind))
 plugin_funcs = plugin_store[kind]
 if (len(plugin_funcs) == 0):
  msg = 'No suitable plugin registered for %s.\n\nYou may load I/O plugins with the `skimage.io.use_plugin` command.  A list of all available plugins are shown in the `skimage.io` docstring.'
  raise RuntimeError((msg % kind))
 plugin = kwargs.pop('plugin', None)
 if (plugin is None):
  (_, func) = plugin_funcs[0]
 else:
  _load(plugin)
  try:
   func = [f for (p, f) in plugin_funcs if (p == plugin)][0]
  except IndexError:
   raise RuntimeError(('Could not find the plugin "%s" for %s.' % (plugin, kind)))
 return func(*args, **kwargs)

def call_plugin ( kind , * args , ** kwargs ) : if ( not ( kind in plugin_store ) ) : raise ValueError ( ( 'Invalid function (%s) requested.' % kind ) ) plugin_funcs = plugin_store [ kind ] if ( len ( plugin_funcs ) == 0 ) : msg = 'No suitable plugin registered for %s.\n\nYou may load I/O plugins with the `skimage.io.use_plugin` command.  A list of all available plugins are shown in the `skimage.io` docstring.' raise RuntimeError ( ( msg % kind ) ) plugin = kwargs . pop ( 'plugin' , None ) if ( plugin is None ) : ( _ , func ) = plugin_funcs [ 0 ] else : _load ( plugin ) try : func = [ f for ( p , f ) in plugin_funcs if ( p == plugin ) ] [ 0 ] except IndexError : raise RuntimeError ( ( 'Could not find the plugin "%s" for %s.' % ( plugin , kind ) ) ) return func ( * args , ** kwargs )
find the appropriate plugin of kind and execute it .