def findAllPlugins(curConfig=None):
    """
    Walks the plugins directories to find all of the plugins. If the plugin has
    a plugin.json file, this reads that file to determine dependencies.
    """
    allPlugins = {}

    # look for plugins enabled via setuptools `entry_points`
    for entry_point in iter_entry_points(group='girder.plugin'):
        # set defaults
        allPlugins[entry_point.name] = {
            'name': entry_point.name,
            'description': '',
            'version': '',
            'dependencies': set()
        }
        allPlugins[entry_point.name].update(
            getattr(entry_point.load(), 'config', {})
        )

    pluginDirs = getPluginDirs(curConfig)
    if not pluginDirs:
        print(TerminalColor.warning('Plugin directory not found.'))
        return allPlugins

    for pluginDir in pluginDirs:
        dirs = [dir for dir in os.listdir(pluginDir) if os.path.isdir(
            os.path.join(pluginDir, dir))]

        for plugin in dirs:
            data = {}
            configJson = os.path.join(pluginDir, plugin, 'plugin.json')
            configYml = os.path.join(pluginDir, plugin, 'plugin.yml')
            if os.path.isfile(configJson):
                with open(configJson) as conf:
                    try:
                        data = json.load(conf)
                    except __HOLE__ as e:
                        print(
                            TerminalColor.error(
                                ('ERROR: Plugin "%s": '
                                 'plugin.json is not valid JSON.') % plugin))
                        print(e)
            elif os.path.isfile(configYml):
                with open(configYml) as conf:
                    try:
                        data = yaml.safe_load(conf)
                    except yaml.YAMLError as e:
                        print(
                            TerminalColor.error(
                                ('ERROR: Plugin "%s": '
                                 'plugin.yml is not valid YAML.') % plugin))
                        print(e)

            allPlugins[plugin] = {
                'name': data.get('name', plugin),
                'description': data.get('description', ''),
                'version': data.get('version', ''),
                'dependencies': set(data.get('dependencies', []))
            }

    return allPlugins
dataset/ETHPy150Open girder/girder/girder/utility/plugin_utilities.py/findAllPlugins