2f948306ebeabf10050bb0c07a3254b420c30751,pwnagotchi/plugins/__init__.py,,load_from_path,#Any#Any#,47

Before Change


    for filename in glob.glob(os.path.join(path, "*.py")):
        try:
            name, plugin = load_from_file(filename)
            if name in loaded:
                raise Exception("plugin %s already loaded from %s" % (name, plugin.__file__))
            elif name not in enabled:
                // print("plugin %s is not enabled" % name)
                pass
            else:
                loaded[name] = plugin
        except Exception as e:
            logging.warning("error while loading %s: %s" % (filename, e))
            logging.debug(e, exc_info=True)

After Change


    logging.debug("loading plugins from %s - enabled: %s" % (path, enabled))
    for filename in glob.glob(os.path.join(path, "*.py")):
        plugin_name = os.path.basename(filename.replace(".py", ""))
        if plugin_name in enabled:
            try:
                load_from_file(filename)
            except Exception as e:
                logging.warning("error while loading %s: %s" % (filename, e))
                logging.debug(e, exc_info=True)

    return loaded


def load(config):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: evilsocket/pwnagotchi
Commit Name: 2f948306ebeabf10050bb0c07a3254b420c30751
Time: 2019-11-01
Author: evilsocket@gmail.com
File Name: pwnagotchi/plugins/__init__.py
Class Name:
Method Name: load_from_path


Project Name: AlexEMG/DeepLabCut
Commit Name: 96da2cacf837a9b84ecdeafb50dfb4a93b402f33
Time: 2021-01-06
Author: tr.biasi@gmail.com
File Name: deeplabcut/pose_estimation_tensorflow/nnet/net_factory.py
Class Name:
Method Name: pose_net


Project Name: allenai/allennlp
Commit Name: c68862ed7efc1010816a848669e1016c721f326c
Time: 2020-01-08
Author: wuzhaofeng1997@gmail.com
File Name: allennlp/predictors/predictor.py
Class Name: Predictor
Method Name: from_archive


Project Name: ray-project/ray
Commit Name: 8204717eed71923f1e14fa6bd17ca4588c140c09
Time: 2020-07-16
Author: sven@anyscale.io
File Name: rllib/evaluation/rollout_worker.py
Class Name: RolloutWorker
Method Name: __init__