def find_matches(self, existing_processors, previous_state, copy_at_index_zero=False):
        if not self.__is_glob and self.log_path in existing_processors:
            return []

        self.__lock.acquire()
        self.__last_check = time.time()
        self.__removed_closed_processors()
        self.__lock.release()

        result = []
        # We need to be careful that we throw out any processors that were created if we do hit an exception,
        # so we track if we got to the return statement down below or not.
        reached_return = False

        # See if the file path matches.. even if it is not a glob, this will return the single file represented by it.
        try:
            for matched_file in glob.glob(self.__log_entry_config['path']):
                # Only process it if we have permission to read it and it is not already being processed.
                if not matched_file in existing_processors and self.__can_read_file(matched_file):
                    checkpoint_state = None
                    # Get the last checkpoint state if it exists.
                    if matched_file in previous_state:
                        checkpoint_state = previous_state[matched_file]
                        del previous_state[matched_file]
                    elif copy_at_index_zero:
                        # If we don't have a checkpoint and we are suppose to start copying the file at index zero,
                        # then create a checkpoint to represent that.
                        checkpoint_state = LogFileProcessor.create_checkpoint(0)

                    # Be sure to add in an entry for the logfile name to include in the log attributes.  We only do this
                    # if the field or legacy field is not present.  Maybe we should override this regardless because the
                    # user could get it wrong.. but for now, we just let them screw it up if they want to.
                    log_attributes = dict(self.__log_entry_config['attributes'])
                    if 'logfile' not in log_attributes and 'filename' not in log_attributes:
                        log_attributes['logfile'] = matched_file

                    # Create the processor to handle this log.
                    new_processor = LogFileProcessor(matched_file, self.__overall_config, self.__log_entry_config,
                                                     log_attributes=log_attributes, checkpoint=checkpoint_state)
                    for rule in self.__log_entry_config['redaction_rules']:
                        new_processor.add_redacter(rule['match_expression'], rule['replacement'])
                    for rule in self.__log_entry_config['sampling_rules']:
                        new_processor.add_sampler(rule['match_expression'], rule['sampling_rate'])
                    result.append(new_processor)

            self.__lock.acquire()
            for new_processor in result:
                self.__processors.append(new_processor)
            self.__lock.release()

            reached_return = True
            return result

        finally:
            # If we didn't actually return the result, then we need to be sure to close the processors so that
            # we release any file handles.
            if not reached_return:
                for new_processor in result:
                    new_processor.close()
Test the ability to ping a hook on a repository.
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/log_processing.py/LogMatcher.find_matches--crossover with--dataset/ETHPy150Open sigmavirus24/github3.py/tests/integration/test_repos_repo.py/TestHook.test_ping