def get_parsers(parsers_path):

    parsers = {}

    # For each directory in parsers path

    for component_directory in parsers_path.split(os.path.pathsep):

        # Add component directory to path

        sys.path.insert(0, component_directory)

        components_list = glob.glob(component_directory + '/*.py')

        # For each *.py file in directory

        for component_file in components_list:

            component = os.path.splitext(os.path.basename(component_file))[0]

            try:

                current_module = importlib.import_module(component)

                for name in dir(current_module):

                    if not name.startswith('_'):

                        obj = getattr(current_module, name)

                        try:

                            if obj != PythonectInputFileFormatParser and issubclass(obj, PythonectInputFileFormatParser):

                                for ext in obj.FILE_EXTS:

                                    parsers[ext] = obj()

                        except __HOLE__:

                            pass

            except Exception:

                pass

    return parsers
dataset/ETHPy150Open ikotler/pythonect/pythonect/internal/parsers/__init__.py/get_parsers