def __init__(self, rule_files, processing_mode='raw',
                 compiled=False, **kwargs):
        """
        Default initializer.

        Keyword arguments:
        rule_files -- (List) Filepaths to yara rule files.
                      (Ex. ['/path/to/file1', '/path/to/file2'])

        processing_mode -- (String) Mode used in processing data. Allowed
                           options include; fixed_buffer, sliding_window,
                           and raw. Default is raw mode.

        compiled -- (Boolean) If True, treat the provided rule file as compiled.

        Optional arguments:
        "fixed_buffer" processing mode:
        Data will be processed by yara in fixed sized buffers.

            buffer_size -- (Integer) Amount of data to buffer
                           before processing in bytes. Default is
                           1024 bytes.

        "sliding_window" processing mode:
        Data will be processed by yara in fixed sized buffers, but it
        is possible for buffers to "overlap" by controlling the buffer
        increment.

            buffer_size -- (Integer) Amount of data to process in bytes.
                           Default is 1024 bytes.

            window_step -- (Integer) Amount to increment window per chunk.
                           Default is 1 byte.

        """
        # Get handle to logger
        self.logger = logging.getLogger('yaraprocessor')

        # Validate all file names to ensure they exist and can be read
        for f in rule_files:
            if os.path.isfile(f):
                try:
                    with open(f):
                        pass

                except IOError:
                    raise IOError((errno.EACCES, 'Cannot open/read file.', f))

            else:
                raise IOError((errno.ENOENT, 'Cannot find file.', f))

        if not compiled:
            self._rule_files = self._prepare_rules(rule_files)

            # Try to load the rules into yara
            try:
                self._rules = yara.compile(filepaths=self._rule_files)
            except yara.SyntaxError as e:
                err = ('Rule syntax error. If using compiled rules, you must '
                       'pass the "compiled" argument. Original error: %s' % e)
                raise ProcessorException(err)
            except yara.Error:
                raise

        else:  # rules are compiled
            try:
                # yara.load only accepts a single file
                assert(len(rule_files) == 1)
            except AssertionError:
                err = ('Compiled rules must be compiled to one file. Loading '
                       'from compiled rules does not support multiple rule files.')
                raise ProcessorException(err)

            self._rule_files = rule_files[0]

            try:
                self._rules = yara.load(self._rule_files)
            except yara.Error as e:
                err = ('Generic error loading compiled rules. '
                       'Original error: %s' % e)
                raise ProcessorException(err)

        # Validate that the processing mode is supported
        self._allowed_modes = ['raw', 'fixed_buffer', 'sliding_window']
        if not self._allowed_modes in processing_mode.lower():
            raise ProcessorException("%s is not a supported processing mode." \
                                     % processing_mode)

        self._processing_mode = processing_mode

        # Optional arguments with defaults
        self._buffer_size = kwargs.get('buffer_size', 1024)
        self._window_step = kwargs.get('window_step', 1)

        # Set window_step to buffer size when processing in fixed buffer mode
        # This makes the analysis code simpler
        if self._processing_mode == 'fixed_buffer':
            self._window_step = self._buffer_size

        # Attribute used to hold data and results to be processed
        self._raw_results = []
        self._formatted_results = []
        self.data = ''

        # Private variables for buffering and window processing
        self._current = ''
        self._next = None
        self._window_index = 0
        self._offset = 0
dataset/ETHPy150Open MITRECND/yaraprocessor/yaraprocessor.py/Processor.__init__/swapped operands of `in`