def arbitrary(module_name, func_name, args, kwargs={}):
 if module_name.startswith('calibre_plugins'):
  from calibre.customize.ui import find_plugin
  find_plugin
 module = importlib.import_module(module_name)
 func = getattr(module, func_name)
 return func(*args, **kwargs)

def arbitrary ( module_name , func_name , args , kwargs = { } ) : if module_name . startswith ( 'calibre_plugins' ) : from calibre . customize . ui import find_plugin find_plugin module = importlib . import_module ( module_name ) func = getattr ( module , func_name ) return func ( * args , ** kwargs )
an entry point that allows arbitrary functions to be run in a parallel process .