def __init__(self, patterns_ini=None, input_format='pdf', dedup=False, library='pdfminer', output_format='csv', output_handler=None):
        basedir = os.path.dirname(os.path.abspath(__file__))
        if patterns_ini is None:
            patterns_ini = os.path.join(basedir, 'patterns.ini')

        self.load_patterns(patterns_ini)
        self.whitelist = WhiteList(basedir)
        self.dedup = dedup
        if output_handler:
            self.handler = output_handler
        else:
            self.handler = output.getHandler(output_format)

        self.ext_filter = "*." + input_format
        parser_format = "parse_" + input_format
        try:
            self.parser_func = getattr(self, parser_format)
        except AttributeError:
            e = 'Selected parser format is not supported: %s' % (input_format)
            raise NotImplementedError(e)

        self.library = library
        if input_format == 'pdf':
            if library not in IMPORTS:
                e = 'Selected PDF parser library not found: %s' % (library)
                raise ImportError(e)
        elif input_format == 'html':
            if 'beautifulsoup' not in IMPORTS:
                e = 'HTML parser library not found: BeautifulSoup'
                raise ImportError(e)
dataset/ETHPy150Open armbues/ioc_parser/iocp.py/IOC_Parser.__init__/original