def _create_plugin_instance(self, module, config=None):
        if (not hasattr(module, 'setup') or
                not inspect.isfunction(module.setup)):
            raise PluginError("Plugin does not have a setup function")

        # Check whether the setup method on the module accepts an argument. If
        # it does, they are expecting our instance of CardinalBot to be passed
        # in. If not, just call setup. If there is more than one argument
        # accepted, the method is invalid.
        argspec = inspect.getargspec(module.setup)
        if len(argspec.args) == 0:
            instance = module.setup()
        elif len(argspec.args) == 1:
            instance = module.setup(self.cardinal)
        elif len(argspec.args) == 2:
            instance = module.setup(self.cardinal, config)
        else:
            raise PluginError("Unknown arguments for setup function")

        return instance
Frobenious norm (squared sum) of difference between two arrays
dataset/ETHPy150Open JohnMaguire/Cardinal/cardinal/plugins.py/PluginManager._create_plugin_instance--crossover with--dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/stats/tests/test_corrpsd.py/norm_f